Page 1 of 1

ServerAlias does not work

Posted: Wed Sep 10, 2014 8:26 pm
by Messiah
Hello!
Recently I upgraded the code of the portal and added real multilingual support. The best solution I found is a languages on subdomains, pointing to the same file structure and the same scripts to avoid unnecessary copies. I just ordered a new VPS, installed VESTA, added mysql replication.

So, I added my domain, let it be MYDOMAIN.ua, and automatically I got the alias http://www.MYDOMAIN.ua. I added en.MYDOMAIN.ua and pl.MYDOMAIN.ua to the same field immediately (it seems they are separated with a line break)
but I found that only MYDOMAIN.ua and http://www.MYDOMAIN.ua is working, en and pl shows the
default.domain
Powered by VESTA
page. I thought something is wrong and added one more, ua.MYDOMAIN.ua: the same result for all 3 subdomains.

I checked the web server configs:
/home/admin/conf/web/apache2.conf
ServerName MYDOMAIN.ua
ServerAlias http://www.MYDOMAIN.ua en.MYDOMAIN.ua pl.MYDOMAIN.ua ua.MYDOMAIN.ua
/home/admin/conf/web/nginx.conf
server_name MYDOMAIN.ua http://www.MYDOMAIN.ua en.MYDOMAIN.ua pl.MYDOMAIN.ua ua.MYDOMAIN.ua;
I tried to connect to the backend directly, i.e.
http://en.MYDOMAIN.ua:8080/index.php and I got standart
The requested URL /index.php was not found on this server. Apache/2.2.22 (Debian) Server at en.MYDOMAIN.ua Port 8080
Everything seems to be OK in config, so what is the problem?

Re: ServerAlias does not work

Posted: Thu Sep 11, 2014 2:21 pm
by Messiah
Sorry, I wrote
ServerAlias http://www.MYDOMAIN.ua en.MYDOMAIN.ua pl.MYDOMAIN.ua ua.MYDOMAIN.ua
but I mean
ServerAlias www.MYDOMAIN.ua en.MYDOMAIN.ua pl.MYDOMAIN.ua ua.MYDOMAIN.ua
This is very clever Google Chrome which aded http:// to copy-pasted.

Now I found that only first ServerAlias works, i.e. I changed it to
ServerAlias en.MYDOMAIN.ua pl.MYDOMAIN.ua ua.MYDOMAIN.ua www.MYDOMAIN.ua
and EN started to work. Temporary solution is wildcard, i.e.
ServerAlias *.MYDOMAIN.ua
but I don't know if it will cause problems adding other sub-domains as separate sites, if it depends on the order of VIRTUALHOST directives in the config.

Re: ServerAlias does not work

Posted: Sun Sep 14, 2014 2:35 pm
by Messiah
this is not confirmed on the other server with the same configuration o_O

Re: ServerAlias does not work

Posted: Fri Oct 31, 2014 3:47 pm
by kandalf
I have a similar problem do you found any solution?