Page 1 of 1

Name Based Vhosts / Virtual Hosts not processing after Insta

Posted: Thu May 17, 2007 11:12 pm
by abbzer0
Hello - I installed and configured Scalix on CentOS 5 (based on RHEL5) and am very pleased with it. My SMTP_AUTH for relaying mail through my ISP is working great, and fetchmail is grabbing a few users pop3 mail and delivering it to their local mailboxes via a crontab cmd. However, my problem is this. After installation my two defined name-based virtual hosts are not processing in apache. I have searched through all the previous threads here, and the best piece of information I could find is from this thread: viewtopic.php?t=3862&highlight=virtual+hosts . I have searched for apache vhost configuration w/ the Tomcat connector on google, but I'm not coming up with much. Currently another name-based vhost is not setup, so I'm just trying to get the www.fqdn.com working right now. The http requests are going to /var/www/html/ as opposed to /var/www/html/www.fqdn.com/ where the site resides. Here is the httpd -S

VirtualHost configuration:
192.168.0.9:80 centos.clintyoung.com (/etc/opt/scalix-tomcat/connector/ajp/instance-centos.conf:1)
192.168.0.9:443 centos.clintyoung.com (/etc/opt/scalix-tomcat/connector/ajp/instance-centos.conf:4)
wildcard NameVirtualHosts and _default_ servers:
_default_:443 centos.clintyoung.com (/etc/httpd/conf.d/ssl.conf:81)
*:80 is a NameVirtualHost
default server www.clintyoung.com (/etc/opt/scalix-tomcat/connector/ajp/instance-centos.conf:15)
port 80 namevhost www.clintyoung.com (/etc/opt/scalix-tomcat/connector/ajp/instance-centos.conf:15)
Syntax OK



If somebody could please help me I would greatly appreciate it. The name-based Vhosts were previously defined in my httpd.conf file at the end, and all worked perfectly, that is, until I installed scalix and the tomcat connector (am I correct in thinking that this is the culprit of my immediate troubles?). Thanks for your anticipated assistance.

On a side note, I think the Scalix product is great! I couldn't be happier (well, unless my vhosts start working again.. :roll: )

Posted: Tue May 22, 2007 9:54 pm
by abbzer0
Thoughts? Anybody? :roll: :roll:

Posted: Wed May 30, 2007 3:57 pm
by m2pilot
I have this same issue. It seems that the tomcat connector is doing *something* which prevents apache name based virtual host commands from processing. Even more bizarre is that apache apparently thinks everything is hunky dorey - httpd -S correctly shows the name based virtual hosts as existing. As near as I can debug, by the time the name based lines see an incoming request, the hostname has been stripped away - thus the default server always answers the request.

Florian, can you chime in here please?

Mark

Posted: Sat Jun 02, 2007 1:37 am
by abbzer0
Well, at least I know I'm not alone here. I have the same thing where Apache things it is all good. Open to any ideas here. Thanks! :D

Posted: Sat Jun 02, 2007 7:06 pm
by tcarradine
Hey guys, I was having the same problem this morning but I've found a work around.

1) Make sure you've got NameVirtualHost *:80 in httpd.conf

2) make a backup copy of /etc/opt/scalix-tomcat/connector/ajp/instance-yourinstance.conf

3) edit the instance-yourinstance.conf:

On the first line you'll see a VirtualHost configuration- you'll need to change this from:

Code: Select all

<VirtualHost your.hostname.com>

to:

Code: Select all

<VirtualHost *:80>


Then add the rest of the virtual host data for the Scalix server, (this will be the server you use to access /webmail and /sac). Here's an example:

change from:

Code: Select all

<VirtualHost mail.myhost.com>
    Include /etc/opt/scalix-tomcat/connector/ajp/app-ml.*.conf
</VirtualHost>


to:

Code: Select all

<VirtualHost *:80>
  ServerName myhost.com
  DocumentRoot /var/www/vhosts/myhost.com/html
  DirectoryIndex index.html index.htm index.php index.shtml
  ServerAlias *.myhost.com 
  Include /etc/opt/scalix-tomcat/connector/ajp/app-ml.*.conf
</VirtualHost>


You can then add the rest of your virtual hosts using the same format below. If you need to have access to Scalix web clients just add the Include to your other virtual hosts. Test with httpd -S from the command line to make sure you've got your syntax right and you should be good to go.

Note: This is a hack- and I'm no expert. I haven't found this disrupts my Scalix service in any way- but perhaps we could have a dev confirm that this isn't going to break anything?

Hope this helps,

Tim