Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Apr 27, 2011 8:04 am 
Offline
Senior Newbie

Joined: Wed Apr 27, 2011 7:54 am
Posts: 11
Can anyone have a gander at this? I'm trying to setup some websites and so far I have one domain added as a virtual host. Trouble is the domain is not pointing to the specific directory I created for it.

I've been following this tutorial...

http://library.linode.com/lamp-guides/u ... -maverick/

And I have set the virtual host as described and checked that they're are no typos and restarted my apache server, but it's still pointing to the default "It works!" page.

My domain is registered with an external registrar and I have the nameservers pointing at n1.linode.com all the way to n5.linode.com. I have also created a DNS zone for the domain in the Linode Domain Manager with the default settings populated by the DNS Manager.

Any thoughts on what I could be doing wrong? Many thanks.


Top
   
 Post subject:
PostPosted: Wed Apr 27, 2011 10:47 am 
Offline
Senior Member

Joined: Wed Mar 03, 2010 2:04 pm
Posts: 111
If the domain is resolving to your Linode then your DNS is working properly, so the issue is specific to your virtual host configuration. (assuming the "it works" page you are seeing is in fact your own.)

I suppose the first thing I would check (since you indicated you already restarted apache) is that virtual hosts are in fact enabled. In /etc/apache2/apache2.conf, at the bottom I have "include sites-enabled".

Interestingly enough, based on a post I saw here recently, all my virtual host directives start with:

<VirtualHost *:80>

...instead of including the full IP address as shown in the tutorial. The Apache2 docs say to use *:80 for name-based virtual hosts, but docs and tutorial both indicate that adding the IP is a good practice if you plan to add IP addresses later and want the vhost to only listen on that IP; I don't know if this could relate to your problem or not.

Ensure your virtual host is in /etc/apache2/sites-enabled (and not just sites-available)...sometimes people overlook that step (a2ensite...). And that your servername and serveralias directives reflect the correct names. If you make any changes reload your apache config or restart the server.

The docs page may help:

http://httpd.apache.org/docs/current/vh ... based.html

Also, to rule out a browser cache, clear your cache or try a different browser that hasn't been used to access the site before. Usually developers turn caching off but you'd hate for it to be something so simple.

Beyond that, a headcold prevents me from sitting at my desk any more today, so I hope you find success.


Top
   
 Post subject:
PostPosted: Wed Apr 27, 2011 11:55 am 
Offline
Senior Newbie

Joined: Wed Apr 27, 2011 7:54 am
Posts: 11
Quote:
I suppose the first thing I would check (since you indicated you already restarted apache) is that virtual hosts are in fact enabled. In /etc/apache2/apache2.conf, at the bottom I have "include sites-enabled".


You're a life saver. I looked at the file and it turns out this was missing, but when I compared it to a another install on my own linux machine I noticed it was there. I added it to the bottom and restarted apache and now it works.

Hope you're cold clears up soon mate.

Many thanks again.


Top
   
 Post subject:
PostPosted: Mon May 02, 2011 12:34 pm 
Offline
Senior Member

Joined: Sun Sep 20, 2009 3:23 pm
Posts: 52
Website: http://keithnet.dyndns.org/
WLM: keithint37@hotmail.com
Yahoo Messenger: keithint1234
AOL: keithint1234
Location: Prescott, Arizona
If it helps any, the Linode library articles suggest that
name *:80 directive format.
Also, they suggest the
Alias blah.com or whatever as an additional directive.
Hope that also can be of some use!

_________________
Regards, --Keith.
Primary Email:
keithint1234@gmail.com
Skype: skypedude1234
Twitter: @keithint1234
Facebook:
http://facebook.com/keith.hinton1


Top
   
PostPosted: Fri Jun 22, 2012 8:16 am 
Offline
Newbie

Joined: Thu Jun 21, 2012 7:56 pm
Posts: 4
Hi,
For the life of me and 3 coffees later I cant get this virtual host stuff working. I have everything done as per the tutorial and this thread. If I add a 2nd domain say example123.com what do I have to change in DNS manager in Linode. The virtual host is pointing to:

Code:
<VirtualHost *:80>
    ServerName example123.com
    DocumentRoot /srv/www/example123.com/public_html/
    ErrorLog /srv/www/example123.com/logs/error.log
    CustomLog /srv/www/example123.com/logs/access.log combined
</VirtualHost>


sites have been enabled, made available and apache reloaded. apache2.conf has the includes..but I get an unable to connect error in the browser (Firefox can't establish a connection to the server)when I go to http://example123.com/

After setting up Linode day 1 a file is created in srv/www called eg li123-456.members.linode.com...Initially after adding my new domains via DNS Manager and b4 the virtual host attempt both my domains pointed to files within this srv/www/li123-456.members.linode.com/public_html folder by default. My 2 domains also show eg example123.com as a subdomain in NS Records. Everything uses the same IP. By default it appears li123-456.members.linode.com shows up in the sites-available and sites-enabled folder. I added my 2 new domains in here too as per tutorial.
Any ideas? It must be something simple like a change in the dns manager
Thanks Guys


Top
   
PostPosted: Fri Jun 22, 2012 8:35 am 
Offline
Senior Member
User avatar

Joined: Sat Feb 25, 2012 4:44 pm
Posts: 71
Website: http://inhomeitsupport.com
Ralph wrote:
Hi,
For the life of me and 3 coffees later I cant get this virtual host stuff working. I have everything done as per the tutorial and this thread. If I add a 2nd domain say example123.com what do I have to change in DNS manager in Linode. The virtual host is pointing to:

Code:
<VirtualHost *:80>
    ServerName example123.com
    DocumentRoot /srv/www/example123.com/public_html/
    ErrorLog /srv/www/example123.com/logs/error.log
    CustomLog /srv/www/example123.com/logs/access.log combined
</VirtualHost>


sites have been enabled, made available and apache reloaded. apache2.conf has the includes..but I get an unable to connect error in the browser (Firefox can't establish a connection to the server)when I go to http://example123.com/

After setting up Linode day 1 a file is created in srv/www called eg li123-456.members.linode.com...Initially after adding my new domains via DNS Manager and b4 the virtual host attempt both my domains pointed to files within this srv/www/li123-456.members.linode.com/public_html folder by default. My 2 domains also show eg example123.com as a subdomain in NS Records. Everything uses the same IP. By default it appears li123-456.members.linode.com shows up in the sites-available and sites-enabled folder. I added my 2 new domains in here too as per tutorial.
Any ideas? It must be something simple like a change in the dns manager
Thanks Guys



Add this to your virtual host file
ServerAlias somedomain.com


Top
   
PostPosted: Mon Jun 25, 2012 6:52 pm 
Offline
Newbie

Joined: Mon Jun 18, 2012 1:08 pm
Posts: 3
Website: http://vpskb.com
Location: http://vpskb.com
Here's what I'm using:

Code:
<VirtualHost *:80>
  ServerName www.example.com
  ServerAlias example.com *.example.com
  DocumentRoot /srv/www/example.com/public_html
</VirtualHost>


Make sure the directory exists and restart Apache after each modification.


Top
   
PostPosted: Wed Jul 18, 2012 6:44 pm 
Offline
Newbie

Joined: Thu Jun 21, 2012 7:56 pm
Posts: 4
Thanks got it working when I did it over


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