Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: how to setup subdomains
PostPosted: Tue Aug 05, 2008 4:25 am 
Offline
Senior Newbie

Joined: Wed May 07, 2008 12:06 pm
Posts: 7
Sorry but I couldn't find any help on other topics.

I am a newby owning a linode and would like to know how to setup subdomains.
Having my main domain, http://example.com, properly running I added an entry in the A records like subdomain (linode dns manager).
The idea is to get http://subdomain.example.com showing a different site than the one presented with http://example.com

I setted up a couple of virtual servers in apache2 pointing to the destination directories pending on the NameVirtualHost directive.

Now the issue is that I get the same contents (the subdomain ones) both directing the browser to the main and the subdomain sites...

what am I doing wrong?

thanks a lot in advance to anyone helping me!

_________________
Ugo


Top
   
 Post subject:
PostPosted: Tue Aug 05, 2008 12:00 pm 
Offline
Senior Member

Joined: Tue Apr 27, 2004 5:10 pm
Posts: 212
Did you restart apache after adding the vhosts?


Top
   
 Post subject:
PostPosted: Tue Aug 05, 2008 1:09 pm 
Offline
Senior Newbie

Joined: Wed May 07, 2008 12:06 pm
Posts: 7
yes Sir!

_________________
Ugo


Top
   
 Post subject:
PostPosted: Tue Aug 05, 2008 1:10 pm 
Offline
Senior Member

Joined: Tue Apr 27, 2004 5:10 pm
Posts: 212
dolphin wrote:
yes Sir!


Can you paste in your vhost config?


Top
   
 Post subject:
PostPosted: Tue Aug 05, 2008 1:17 pm 
Offline
Senior Newbie

Joined: Wed May 07, 2008 12:06 pm
Posts: 7
how do I get it?
:roll:

_________________
Ugo


Top
   
 Post subject:
PostPosted: Tue Aug 05, 2008 1:19 pm 
Offline
Senior Member

Joined: Tue Apr 27, 2004 5:10 pm
Posts: 212
dolphin wrote:
how do I get it?
:roll:
dolphin wrote:
I setted up a couple of virtual servers in apache2 pointing to the destination directories pending on the NameVirtualHost directive.


You said you already set up the vhosts. Just copy/paste that...


Top
   
 Post subject:
PostPosted: Tue Aug 05, 2008 1:28 pm 
Offline
Senior Newbie

Joined: Wed May 07, 2008 12:06 pm
Posts: 7
sorry,

default

Code:
NameVirtualHost *
<VirtualHost *>
        ServerAdmin webmaster@localhost
        ServerName grandolini.info
        ServerAlias www.grandolini.info

DocumentRoot /home/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /home/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 /home/www/log/apache2-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /home/www/log/apache2-access.log combined
        ServerSignature On

    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>


subdomain

Code:
NameVirtualHost progesoft.grandolini.info
<VirtualHost progesoft.grandolini.info>
        ServerAdmin ugo@progesoft.com
        ServerName progesoft.grandolini.info
        ServerAlias www.progesoft.grandolini.info

DocumentRoot /home/www/progeSOFT
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /home/www/progeSOFT/>
                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 /home/www/log/progeSOFT/apache2-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /home/www/log/progeSOFT/apache2-access.log combined
        ServerSignature On

    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>


thanks a lot!

_________________
Ugo


Top
   
 Post subject:
PostPosted: Tue Aug 05, 2008 1:41 pm 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ă…lesund, Norway
Skype: neonnero
Twitter: neonnero
dolphin wrote:
Code:
NameVirtualHost progesoft.grandolini.info
<VirtualHost progesoft.grandolini.info>

That just might be your problem, then. From what I understand from the Apache manual, NameVirtualHost needs to be an IP address or an IP adress with a port specification (either can be just a "*" to denote all possibilities).

Since you've already used "NameVirtualHost *" in the default file, you don't need to set it again. Just do it like this for your subdomain:

Code:
<VirtualHost *> 
        ServerAdmin ugo@progesoft.com
        ServerName progesoft.grandolini.info
        ServerAlias www.progesoft.grandolini.info

DocumentRoot /home/www/progeSOFT
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /home/www/progeSOFT/>
                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 /home/www/log/progeSOFT/apache2-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /home/www/log/progeSOFT/apache2-access.log combined
        ServerSignature On

    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>


Top
   
 Post subject:
PostPosted: Tue Aug 05, 2008 1:50 pm 
Offline
Senior Newbie

Joined: Wed May 07, 2008 12:06 pm
Posts: 7
YEEEE :D

it works!!
THANKS A LOT NEONNERO!

_________________
Ugo


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


Who is online

Users browsing this forum: No registered users and 1 guest


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