Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Apache hosting problems
PostPosted: Sun Jan 31, 2010 1:10 am 
Offline
Senior Newbie

Joined: Sun Jan 31, 2010 12:59 am
Posts: 9
I'm really sorry to post but Im having a terrible time trying to get site hosting working on my linode. I have followed the apache guides both in the library and the wiki, along with the ubuntu site (im using 9.10 image on my linode.)

I have pointed a site, khanglory.com to ns1-4.linode.com. (I do not have an umbrella domain I want to use for my linode, so Im just sticking with my lixxx.members.linode.com.) Apache is installed and working, if i go to http://mylinodeip, It works!

1) I add khanglory.com to as a master under the DNS Manager in Linode Manager. http://img32.imageshack.us/img32/8387/screenshotgn.png

2) I will have my sites under the created directory /var/www/vhosts/. I add a folder /var/www/vhosts/khanglory.com
I add a folder /var/www/vhosts/khanglory.com/public_html
I add a folder /var/www/vhosts/khanglory.com/logs
I make a Hello World index.html file in public_html
I chmod -R 755 /var/www/vhosts/khanglory.com

3) I create /etc/apache2/sites-available/khanglory.com
Code:
    <VirtualHost *:80>

      # Admin email, Server Name (domain name) and any aliases
      ServerAdmin kublai@khanglory.com
      ServerName  khanglory.com
      ServerAlias www.khanglory.com

      # Index file and Document Root (where the public files are located)
      DirectoryIndex index.html
      DocumentRoot /var/www/vhosts/khanglory.com/public_html/

      # Custom log file locations
      LogLevel warn
      ErrorLog  /var/www/vhosts/khanglory.com/log/error.log
      CustomLog /var/www/vhosts/khanglory.com/log/access.log combined

    </VirtualHost>


4) I verify the following at the bottom of my /etc/apache2/apache2.conf:
Code:
# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

NameVirtualHost *:80


5) I then run the commands
a2ensite khanglory.com
/etc/init.d/apache2 reload
(/etc/init.d/apache2 restart)

reload's ok, restart [fail] ..
# /etc/init.d/apache2 restart
* Restarting web server apache2
Code:
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Sun Jan 31 00:20:58 2010] [warn] NameVirtualHost 72.14.189.84:0 has no VirtualHosts
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Sun Jan 31 00:20:58 2010] [warn] NameVirtualHost 72.14.189.84:0 has no VirtualHosts



Please let me know if you have any tips, I very much appreciate your time.

Bung


Last edited by Bung on Sun Jan 31, 2010 2:21 am, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Sun Jan 31, 2010 1:44 am 
Offline

Joined: Sun Jan 31, 2010 1:30 am
Posts: 1
Since it's failing to restart you'll want to check the error log (I don't remember the exact path for Apache.)


Top
   
 Post subject:
PostPosted: Sun Jan 31, 2010 3:19 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
In recent versions of Debian and Ubuntu, there's a separate file /etc/apache2/ports.conf which contains the line "NameVirtualHost *:80" and which is loaded at startup. So you don't need to have that line again.

The "fully qualified domain name" message is generated because you don't have anything in /etc/hostname (if in doubt, just copy your default rDNS record into it, e.g. li00-000.members.linode.com)

On the other hand, neither of these should really cause Apache to fail. The problem probably lies elsewhere, so check the last few lines of /var/log/apache2/error.log


Top
   
 Post subject:
PostPosted: Sun Jan 31, 2010 3:59 am 
Offline
Senior Newbie

Joined: Sun Jan 31, 2010 12:59 am
Posts: 9
Thank you,

I had in fact not created the necessary logs folder. Once I did, I was greated with a Forbidden Access! message. This required adding the following to my /etc/apache2/sites-available/khanglory.com file:

Code:
<Directory /var/www/vhosts/khanglory.com/public_html>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>


Ive removed the one line from /etc/apache2/apache2.conf, and added my xxx.member.linode to /etc/hostname, but I still get:

Code:
# /etc/init.d/apache2 restart
 * Restarting web server apache2                                                                                                                                                 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Sun Jan 31 01:56:23 2010] [warn] NameVirtualHost 72.14.189.84:0 has no VirtualHosts
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Sun Jan 31 01:56:24 2010] [warn] NameVirtualHost 72.14.189.84:0 has no VirtualHosts


Top
   
 Post subject:
PostPosted: Sun Jan 31, 2010 4:08 am 
Offline
Senior Newbie

Joined: Sun Jan 31, 2010 12:59 am
Posts: 9
Ok, fixed the "fully qualified error" by adding the following to /etc/hosts

my.li.no.de.ip. lixxx.members.linode.com myservername

And removing the NameVirtualHost line from /etc/apache2/sites-available/khanglory.com makes the other error disappear, w00t!


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