Apache hosting problems

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

    <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:

# 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 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

4 Replies

Since it's failing to restart you'll want to check the error log (I don't remember the exact path for Apache.)

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

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:

 <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:

# /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

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!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct