Hi All
I have apache2 running with several sub-domains pointing to the same apache web server.
For example, I have 2 sub-domains, say jcs.jaaconsult.com and website.jaaconsult.com.
I have created two virtual host files stored in /etc/apache2/sites-enabled, as follows:
For jcs.jaaconsult.com:
For website.jaaconsult.com:# Job Costing System host configuration file
<VirtualHost *>
ServerAdmin webmaster@jaaconsult.com
ServerName jcs.jaaconsult.com
ServerAlias jcs.jaaconsult.com
# Indexes + Directory Root
DirectoryIndex index.php
DocumentRoot /home/jcs/
# GCI Directory
ScriptAlias /cgi-bin/ /home/jcs/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>
# Log Files
ErrorLog /home/jcs/logs/error.log
CustomLog /home/jcs/logs/access.log combined
</VirtualHost>
When I (as root) enable the site jcs.jaaconsult.com# Website host configuration file
<VirtualHost *>
ServerAdmin webmaster@jaaconsult.com
ServerName website.jaaconsult.com
ServerAlias website.jaaconsult.com
# Indexes + Directory Root
DirectoryIndex index.php
DocumentRoot /home/website/
# GCI Directory
ScriptAlias /cgi-bin/ /home/website/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>
# Log Files
ErrorLog /home/website/logs/error.log
CustomLog /home/website/logs/access.log combined
</VirtualHost>the site works fine.a2ensite jcs.jaaconsult.com
When I (as root) enable the site website.jaaconsult.comapache stops working and I get the following error:a2ensite website.jaaconsult.com
When I (as root) disable the site website.jaaconsult.comFailed to Connect
The connection was refused when attempting to contact website.jaaconsult.com.
Though the site seems valid, the browser was unable to establish a connection.
* Could the site be temporarily unavailable? Try again later.
* Are you unable to browse other sites? Check the computer's network connection.
* Is your computer or network protected by a firewall or proxy? Incorrect settings can interfere with Web browsing.apache works again and the first site, jcs.jaaconsult.com works fine.a2dissite website.jaaconsult.com
If I have only website.jaaconsult.com enabled, then apache fails to work.
Obviously, I (as root) reload apacheevery time I enable or disable a virtual host./etc/init.d/apache2 relaod
In fact I have six sites (and six sub-domains) all pointing to the same web server, and two of the virtual hosts (when enabled) work, and the other 4 do not.
I have been trying to resolve this for days. Anyone got any ideas why this is happening and what I have to do to get this issue fixed?
Thanks in advance.
Bookmarks