Hello all,
me again, but I am pulling my hair out by now. I read almost everything and tried all the guides here, but it seems I can't web server's virtual hosts to work correctly. What is even worse, they work rather mysteriously.
So here goes basic info:
ZentyalZentyal 3.3.4 running in virtual box
Zentyal is gateway, runs also as DNS
Zentyal hostname: keskvisrv01
Zentyal domain: sushinet.lan
I only have 1 hostname registered under sushinet.lan (the keskvisrv01 with IP 10.201.1.1)
LAN interface: 10.201.1.1
WAN interface: 192.168.111.99, gateway 192.168.111.1 (to hw router)
Zentyal FW allows access on WAN interface on ports 80 and 443.
Zentyal administration port has been moved to another number.
HW routerLAN side: 192.168.111.x
WAN side: 192.168.4.96 (it's ISPs "LAN")
(but I have public IP of 194.1.130.107 by which you can reach the router on all ports - it works, don't ask me how, but it has been working in the past without zentyal perfectly, so issue is not here, as you will see later)
Ports 80 and 443 are forwarded to 192.168.111.99 (zentyal WAN interface)
I own domains susilafamily.com and teamdiehards.com
They are registered at my registrat and contain, among others, A record * (i.e. *.susilafamily.com and *.teamdiehards.com), which points to my public IP 194.1.130.107. In fact, all other A records point to this public IP.
Goal:1) To have both sites accessible via
http://www.sitename.com and
http://sitename.com (yes christian, I know the latter is a misconception - see my Site #2 attempt below).
2) Later I would like to turn on redirection/rewrite, so that you always get redirected to
https://www.sitename.comAfter reading many many posts on this forum, I did quite few experiments and based on [christian's] instructions found in different posts, I settled with two experiments, but none of them work quite well.
Site 1So, in webserver module I created virtual host (?) named susilafamily.com
Enabled and Force SSL on.
The directory /srv/www/susilafamily.com was created as expected.
Also in DNS module, the domain susilafamily.com was created and a hostname of keskvisrv01 created there with IPs (10.201.1.1 and 192.168.111.99). I have removed these IPs (I also tried with them, but no luck) and created hostname www with IPs 10.201.1.1, 192.168.111.99, 127.0.0.1, 194.1.130.107
Site 2In webserver module I created another virtual host, this time named
www.teamdiehards.comEnabled, SSL disabled.
The directory /srv/www/www.teamdiehards.com was created as expected.
In DNS module was created:
domain teamdiehards.com
hostnames: keskvisrv01 (10.201.1.1, 192.168.111.99); www (no IPs)
Again, after reading posts and experimenting with different setups, I have changed that to:
keskvisrv01 (no IPs)
renamed www hostname to * (IP 192.168.111.99)
This is setup as it is now. I also checked the generated ebox-susilafamily.com and ebox-www.teamdiehards.com files in /etc/apache2/sites-available (sites are also enabled) and the content points to correct directories.
FYI, before I experimented with different site names, so my /srv/www/ contains:
susilafamily.com/
www.susilafamily.com/teamdiehards.com/
www.teamdiehards.com/In each folder I have created index.html, which contains the name of the folder it is located in, so if you access the site from web, you know where Zentyal gets the data from.
Feel free to try, the server's up and running
Here comes the strange stuff (I am accessing it from a truly outside network, laptop is connected via mobile modem):
Going to:
1a)
http://www.teamdiehards.com shows index.html file from directory /srv/www/teamdiehards.com (and not ..../www.teamdiehards.com as I would expect!).
1b)
http://teamdiehards.com shows index.html file from directory /srv/www/teamdiehards.com (incorrect, as above).
2a)
http://www.susilafamily.com shows index.html file from directory /srv/www/susilafamily.com (this is correct, according to the definition of virtual host in web server module).
2b)
http://susilafamily.com shows index.html file from directory /srv/www/susilafamily.com (this is, again, correct).
(But for both, #2a and #2b please note, how the Force SSL has no effect!)
4)
https://www.susilafamily.com (timed out) -> wrong, https should work
5)
https://susilafamily.com (timed out) -> wrong, https should work
6&7) https for diehards also timed out -> ok, no https for this virtual host
(FYI, I did experiment by editing generated conf files for the sites by adding ServerAlias, but none of that helped. In fact, sometimes my experiments would cause the https to redirect me to the default web site in /var/www )
Well, I do not know where to go from here. This is setup as it is now, feel free to experiment. I do not know even what to ask, except "What is wrong?!?!"
Well, maybe these questions:
1) Is this a DNS issue?
2) Is it really necessary to have DNS entries for virtual hosts, or can I safely delete them (I would be happy if those sites are available from internet only, and for that my DNS records at my registrar should be sufficient, right?)
3) Why is my https connection not working for susilafamily.com?
4) Why ForceSSL is not working on susilafamily.com (i.e. http is not switched to https)?
Any help is appreciated!
Cheers,
B.
PS: I was able to manually configure server before (web, mail, ftp, samba) and all was working. I switched to Zentyal for the ease of administration and also due to LDAP and domain abilities. But so far it seems it takes me more time to troubleshoot than to enjoy the fruits
So I am slowly getting disappointed by Zentyal, although it is probably also my lack of knowledge.