Friday, March 21, 2014

Lighttpd: full site with SSL with exception of a url / path / directory

Well.. perhaps you need SSL in your site but you want to exclude a concrete path / url. This is my config:


Wednesday, March 19, 2014

curl + IPv6: common errors using direct IP

FAIL!
$ curl -6 "http://a00:1450:4007:805::1018/" 
curl: (3) IPv6 numerical address used in URL without brackets 
FAIL!
$ curl -6 "http://[a00:1450:4007:805::1018]/"
curl: (3) [globbing] bad range in column 13
BINGO!
$ curl -g -6 "http://[2a00:1450:4007:805::1018]/"

302 Moved 
The document has moved

Wednesday, March 12, 2014

Myloader: resolving errors with no clear message

If you have a special configuration in mysqld (no default config) perhaps you will find these two cases of error working with myloader tool:

1) The first issue looks like a problem with the backup file...... but it is not. Message:
** (myloader:42526): CRITICAL **: cannot open file vcadminweb.message.sql.gz (24) * (myloader:46190): CRITICAL
In my case, I needed to check and to change the open files:
ulimit -n 10000        ..... and solved!
2) The second one looks like a problem accessing to the database.... but it is not. Message:
**: Error switching to database CMSB076 whilst restoring table multidevicevideo_players
In my case, it was a timewait very low in the mysqld config.
wait_timeout       = 300 
solved the issue for me.

Monday, March 10, 2014

Mysql: Drop database with dash in name

The issue:
mysql> drop database my-web;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-web' at line 1
mysql> drop database "my-web";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"my-web"' at line 1
mysql> drop database 'my-web';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''my-web'' at line 1
 
The trick:
mysql> drop database `my-web`;
Query OK, 83 rows affected, 1 warning (0,02 sec)

Wednesday, March 5, 2014

Glassfish 4 tricks on CentOS 6

Three tricks here.

One. Init.d script for CentOS 6:




Two. Changing umask permission in Glassfish 4:

Add "umask 002" just before the "exec" line in $GLASSFISH_HOME/bin/asadmin

Three. Changing general logging file in Glassfish 4:

Change logging.properties file line to (by example):
 com.sun.enterprise.server.logging.GFFileHandler.file=/var/log/glassfish/server.log