Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: apache vhost 'www'
PostPosted: Tue Apr 06, 2010 4:25 pm 
Offline
Newbie

Joined: Tue Apr 06, 2010 4:16 pm
Posts: 3
Hello everyone!

I was setting up my apache server following the Setting up a LAMP Server on Debian 5.0 (Lenny) but I'm having a problem with my virtualhost. When I type my url with 'www' it works OK, but when I type it without 'www' the default vhost kicks in..

Code:
<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? :\


Top
   
 Post subject:
PostPosted: Tue Apr 06, 2010 5:34 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 06, 2009 9:02 pm
Posts: 54
Website: http://mark.watero.us/
Location: Las Vegas
Try reversing the two.

Code:
ServerName domain.com
ServerAlias www.domain.com


Top
   
 Post subject:
PostPosted: Tue Apr 06, 2010 7:32 pm 
Offline
Newbie

Joined: Tue Apr 06, 2010 4:16 pm
Posts: 3
mwaterous wrote:
Try reversing the two.

Code:
ServerName domain.com
ServerAlias www.domain.com


I've tried that but the problem persist.. :\


Top
   
 Post subject:
PostPosted: Tue Apr 06, 2010 10:22 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 06, 2009 9:02 pm
Posts: 54
Website: http://mark.watero.us/
Location: Las Vegas
What does your default vhost configuration look like?


Top
   
 Post subject:
PostPosted: Wed Apr 07, 2010 4:50 am 
Offline
Senior Member

Joined: Wed Oct 20, 2004 8:55 am
Posts: 120
Did you restart / reload Apache?


Top
   
 Post subject:
PostPosted: Wed Apr 07, 2010 7:32 am 
Offline
Newbie

Joined: Tue Apr 06, 2010 4:16 pm
Posts: 3
mwaterous wrote:
What does your default vhost configuration look like?


Code:
<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 wrote:
Did you restart / reload Apache?


yes, I reloaded and restarted the apache but still the same..


Top
   
 Post subject: I have the same problem.
PostPosted: Thu Sep 16, 2010 11:17 am 
Offline

Joined: Wed Sep 15, 2010 5:56 pm
Posts: 1
AOL: 44-05+Parsons+Blvd.
Except in reverse. For me, domainname.com does not work but www.domainname.com works. Can someone please shed some light on this? I used the LAMP setup guide as well.


Top
   
PostPosted: Fri Sep 17, 2010 1:17 pm 
Offline
Senior Member

Joined: Sun Oct 30, 2005 7:52 pm
Posts: 97
chimichangaman wrote:
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 and www.domainname.com pointing to the ip address of the webserver?

--
Travis


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group