[Hampshire] apache2 configuration

Top Page

Reply to this message
Author: Peter Alefounder
Date:  
To: hampshire@mailman.lug.org.uk
New-Topics: Re: [Hampshire] samsung laptop bug
Subject: [Hampshire] apache2 configuration
 
I am looking for advice on apache2 configuration. What I would
like to do is set up two virtual hosts, specifying a particular
DocumentRoot for each and having Perl CGI for one of them. So
far, I have not got even one virtual host working.
 
If I have:
NameVirtualHost *:80
<VirtualHost 127.0.1.1:80>
  ServerName example.com
  DocumentRoot /home/pra/dir/files
</VirtualHost>
 
in /etc/apache2/example, after apache2 restart, I get the messages
 
[...] Restarting web server: apache2apache2: Could not reliably
determine the server's fully qualified domain name, using 127.0.1.1
for ServerName
[warn] NameVirtualHost *:80 has no VirtualHosts
[warn] NameVirtualHost *:80 has no VirtualHosts
 ... waiting apache2: Could not reliably determine the server's
fully qualified domain name, using 127.0.1.1 for ServerName
[warn] NameVirtualHost *:80 has no VirtualHosts
[warn] NameVirtualHost *:80 has no VirtualHosts
. ok
 
and asking the web browser for 127.0.1.1 will cause
/home/pra/dir/files/index.html to be displayed. Links to
example.com are not recognised (server not found, or unknown
host if I type example.com into the location bar).
 
If I change /etc/apache2/example to:
NameVirtualHost *:80
<VirtualHost *:80>
  ServerName example.com
  DocumentRoot /home/pra/dir/files
</VirtualHost>
 
the same messages appear after restarting apache2 and the
web browser produces the default web page for the server.
 
Thus, it is clear that ServerName is not being recognised although
if I specify it exactly, I can link 127.0.1.1 to DocumentRoot.
 
What am I doing wrong?
 
Peter Alefounder.


--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------