apache vhost 'www'
I was setting up my apache server following the Setting up a LAMP Server on Debian 5.0 (Lenny)
<virtualhost *:80="">ServerAdmin admin@domain.com
ServerName www.domain.com
ServerAlias domain.com
DocumentRoot /srv/www/www.domain.com/public_html/
ScriptAlias /cgi-bin/ /srv/www/www.domain.com/cgi-bin/
<location cgi-bin="">Options +ExecCGI</location>
ErrorLog /srv/www/www.domain.com/logs/error.log
CustomLog /srv/www/www.domain.com/logs/access.log combined</virtualhost>
Anyone knows why? :\
7 Replies
ServerName domain.com
ServerAlias www.domain.com
@mwaterous:
Try reversing the two.
ServerName domain.com ServerAlias www.domain.com
I've tried that but the problem persist.. :\
@mwaterous:
What does your default vhost configuration look like?
<virtualhost *:80="">ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<directory>Options FollowSymLinks
AllowOverride None</directory>
<directory var="" www="">Options Indexes FollowSymLinks MultiViews
AllowOverride None
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 /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<directory "="" usr="" share="" doc="">Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128</directory></virtualhost>
@kangaby:
Did you restart / reload Apache?
yes, I reloaded and restarted the apache but still the same..
@chimichangaman:
For me, domainname.com does not work but
www.domainname.com works. Can someone please shed some light on this?
Do you have A records for both domainname.com andwww.domainname.com pointing to the ip address of the webserver?
–
Travis