I new to Ubuntu and setting up Apache. I just want to set this up for local development. I have found a plethora of information but some of it is contradictory or confusing. I started with a fresh install and now that I've messed with it, Apache is throwing errors when I try to start it.

Can someone give me a simple, step-by-step approach to setting up Virtual hosts on Ubuntu from scratch? Which files do I need to edit? Which commands do I need to run?


Update #1: Specifically, the error that I'm getting is this:

* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using for ServerName
[Fri Oct 09 11:32:38 2009] [error] VirtualHost sitename:0 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results

Then it says [ Ok ], so does that mean that mean the errors don't really matter? I can open up my browser, type the name of the virtual host, and the right site pops up. But I also get the same thing when I type in localhost.

Update #2: I think I fixed the "mixing ports" error. One tutorial told me to add a line to my apache2.conf file and I don't think I needed to. So I removed it, and the error went away. I'm still getting the error about not being able to determine the fully qualified domain name. What does this error mean? It seems to be working okay. But when I type localhost it still shows the other site. Do I need to create a virtual host for localhost?


Put your block in a file in /etc/apache2/sites-available, with a name related to which site it contains. I'll assume "sitename".

Then issue:

a2ensite sitename
/etc/init.d/apache2 reload

See http://www.apache.org for http server documentation if you need more detailed help with your block.


Don't worry too much about the "could not verify FQDN error", it's not really important for most applications. Basically, it means that there wasn't a reverse DNS lookup that resolved to your server's IP address (which is obviously fine if one of the adaptors is an internal address, as in your logs).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.