Mobile app version of vmapp.org
Login or Join
Connie744

: Multiple virtual host in apache 2.22 on debian 7 … very strange and inexplicable behavior … someone can try to help me? I'm facing a configuration issue that's really diving me nuts ...

@Connie744

Posted in: #Apache2 #Debian #Virtualhost

I'm facing a configuration issue that's really diving me nuts ...

Basically I'm working as a sysadmin for a customer who use a single server to host many different site, to be more specific:

Server is:

PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
NAME="Debian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"

Linux **xyz** 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u6 x86_64 GNU/Linux

Server version: Apache/2.2.22 (Debian)
Server built: Aug 18 2015 09:50:52


Now, on top of this I've configured several different web sites at third level, say for example abc.xyz.it, def.xyz.it, ghi.xyz.it, and so on. Everything is working as expected until last week I've been asked to configure one of the virtual host to answer to different external query on slightly different URL redirecting them on the same DocumentRoot. It seems quite trivial, in fact I've managed to allow qqq.xyz.it (original virtual host), plus qqqk.xyz.it and qqqk.xyz.it putting the expected configuration in the original /etc/apache2/sites-available/qqq file; then a2dissite qqq, service apache2 reload, a2ensite qqq, and again service apache2 reload ...

As I said everything was working with no problem.

But after a couple of days the customer asked me to add also qqq.xyz.it ...

My first thought was that it's simply trivial, so I edited the qqq file adding a section also for this instance ... well, despite several trials I was completely unable to make it run ... it seems to me there is nothing different from what I've done for the other virtual hosts, but no success at all.

I paste below the actual content of qqq file:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName qqq.xyz.it
DocumentRoot /var/www2/qqq
<Directory /var/www2/qqq>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
#AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/dri-error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel error

CustomLog ${APACHE_LOG_DIR}/dri-access.log combined
</VirtualHost>


<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName qqq.xyz.it DocumentRoot /var/www2/qqq
<Directory /var/www2/qqq>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
#AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/dri-error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel error

CustomLog ${APACHE_LOG_DIR}/dri-access.log combined
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName qqqk.xyz.it
DocumentRoot /var/www2/qqq
<Directory /var/www2/qqq>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
#AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/dri-error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel error

CustomLog ${APACHE_LOG_DIR}/dri-access.log combined
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName qqqk.xyz.it DocumentRoot /var/www2/qqq
<Directory /var/www2/qqq>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
#AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/dri-error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel error

CustomLog ${APACHE_LOG_DIR}/dri-access.log combined
</VirtualHost>


Does anyone have a guess? I've tried several changes in the order of the four section into the file, I've tried to use ServerAlias which doesn't work in any place into the file ... I've run out of ideas, maybe it's a simple stupid thing but as far as I've been trying so long maybe I cannot see it ....

P.S.: Just to make it clear, the following image shows what I get as a response:

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Connie744

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme