Apache2 Virtualhost practice config issue
Posted
by
sisko
on Server Fault
See other posts from Server Fault
or by sisko
Published on 2013-10-23T05:39:38Z
Indexed on
2013/10/23
21:55 UTC
Read the original article
Hit count: 387
apache2
|virtualhost
I am practicing virtualhost configuration. In my /var/www directory I have created 3 directories called test1, test2 and test3 each of which has a simple index.php script in it. I:E test1/index.php etc.
In /etc/apache2/sites-available/test1 I have the following configuration:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName test1
DocumentRoot /var/www/test1
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/test1/>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
All the other sites have a similar virtualHost definition.
I have enabled the site(the symlink appears in sites-enabled) and I have restarted apache.
However, when I visit localhost/test1
, I get a 404 Error.
My error log show the following message:
[Wed Oct 23 06:22:52 2013] [error] [client 127.0.0.1] File does not exist: /var/www/test1/test1
I don't know why I get the double test1/test1 in the error logs.
I'm trying to find the right virtualHost setup which will allow all 3 test websites to be served from their URLs I:E test1/index.php, test2/index.php and test3/index.php.
Can anyone help me out, please?
© Server Fault or respective owner