basic problem with Apache virtual host

I am trying to set up an Apache instance that will have only a single host, with domain wiki.headsupanalytics.com.

I have already set up an A record at GoDaddy to link the domain name with the IP address for my Linode instance.

I followed the procedures for building a LAMP stack listed in http://library.linode.com/lamp-guides/u … .04-lucid/">http://library.linode.com/lamp-guides/ubuntu-10.04-lucid/.

The current result is that I get the default Apache page when I hit http://wiki.headsupanalytics.com from my browser, but any attempt to get any other content results in a 404. For example, I put a file called joe.html in /srv/www/headsupanalytics.com/public_html. When I try to retrieve http://wiki.headsupanalytics.com/joe.html, I get a 404. The request is logged in the log file for the default host, not for my virtual host. It shows that Apache looked for joe.html in /var/www/, which I understand is the root directory of the default host.

Here is my current configuration:

/etc/apache2/sites-available/default:

(all other text untouched from the installation)

/etc/apache2/sites-available/wiki.headsupanalytics.com:

ServerAdmin admin@headsupanalytics.com

ServerName wiki.headsupanalytics.com

DocumentRoot /srv/www/headsupanalytics.com/public_html

ErrorLog /srv/www/headsupanalytics.com/logs/error.log

CustomLog /srv/www/headsupanalytics.com/logs/access.log combined

I invoked a2ensite wiki.headsupanalytics.com getting the message "Enabling site wiki.headsupanalytics.com." and restarted Apache with no errors reported at the command line.

Can you suggest how I might diagnose and fix this problem?

5 Replies

@marknewman:

I put a file called joe.html in /srv/www/headsupanalytics.com/public_html. When I try to retrieve http://wiki.headsupanalytics.com/joe.html, I get a 404.

Are you sure you have don't have 'www' instead of 'wiki' in your configuration? Because when I go to http://www.headsupanalytics.com/joe.html I get content.

Also, headsupanalytics.com redirects to www.headsupanalytics.com

Travis

Thanks for taking a look.

There is a separate hosted web site associated with www.headsupanalytics.com which is a placeholder for a general information site. There is another A record pointing there. If you look, you can see that the other server reports back that there is no joe.html at that site.

If you go to http://wiki.headsupanalytics.com, you will get the "It works" page returned to you. That is from Apache at the Linode instance.

@marknewman:

If you go to http://wiki.headsupanalytics.com, you will get the "It works" page returned to you. That is from Apache at the Linode instance.
Looks like you got it figured out, as the joe document is there now.

Travis

Actually, generous help from Stan in Support has allowed me to work around the problem by disabling the default host.

I am still looking for the underlying mistake, and will post the solution if and when I track it down.

Thanks,

Mark

Could you post this process? Thanks!

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