I am trying to setup virtual hosts on apache2 on Raspbian.
made a directory for www.example.com
wim@raspberrypi-lamp-server /var/www $ sudo mkdir www.example.com
wim@raspberrypi-lamp-server /var/www $ sudo mkdir www.example.com/htdocs
wim@raspberrypi-lamp-server /var/www $ sudo mkdir www.example.com/cgi
wim@raspberrypi-lamp-server /var/www $ sudo mkdir www.example.com/logs
create the virtual.conf file /etc/apache2/conf.d/virtual.conf
wim@raspberrypi-lamp-server /etc/apache2/conf.d $ sudo nano virtual.conf
#
# We're running multiple virtual hosts.
#
NameVirtualHost *
virtual host config file
#
# Example.com (/etc/apache2/sites-available/www.example.com)
#
<VirtualHost *>
ServerAdmin [email protected]
ServerName www.example.com
ServerAlias example.com
# Indexes + Directory Root.
DirectoryIndex index.html
DocumentRoot /var/www/www.example.com/htdocs/
# CGI Directory
ScriptAlias /cgi-bin/ /var/www/www.example.com/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>
# Logfiles
ErrorLog /var/www/www.example.com/logs/error.log
CustomLog /var/www/www.example.com/logs/access.log combined
</VirtualHost>
enable the site
wim@raspberrypi-lamp-server /etc/apache2/conf.d $ sudo a2ensite www.example.com
reloading apache gives me
wim@raspberrypi-lamp-server /etc/apache2/sites-available $ sudo /etc/init.d/apache2 reload
[....] Reloading web server config: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Wed Aug 13 12:44:40 2014] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Wed Aug 13 12:44:40 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
. ok
Now I can not see the index.html file in a webbrowser when I try to connect to the server. How can I resolve the [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results and the warning: [warn] NameVirtualHost *:80 has no VirtualHosts
does the apache process need more than write access to the config files ? looking at the permissions all the config files are owned by root.