Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to point someaddress.lan to default apache page and www.someaddress.lan to /var/www/wordpress/? Should I modify this file /etc/apache2/sites-available/default/etc/apache2/sites-available/default or place some symlinks in default apache dir? What is the right way?

share|improve this question
up vote 1 down vote accepted

The right way is to use separate virtualhosts for each one of them. The exact method would depend on your distribution - debian uses a slightly different workflow.

Ubuntu has a nice guide here but i'll simplify it a little based off here

You need to create two files in /etc/apache2/sites-available

The names can be arbitrary but someaddress.lan and www.someaddress.lan would work

To do this, nano someaddress.lan

paste in the following

<VirtualHost *>
  ServerName someaddress.lan
  DocumentRoot /var/www

for the other file nano www.someaddress.lan

<VirtualHost *>
  ServerName www.someaddress.lan
  DocumentRoot /var/www/wordpress

run a2ensite someaddress.lan and a2ensite www.someaddress.lan

and restart apache you should be good

share|improve this answer
I use ubuntu dist – RCola Apr 8 '12 at 15:04
@RCola: Ubuntu is based on Debian, and thus inherits more or less all its workflows. EDIT: I skip the rest of my Debian/Ubuntu centric comment since the answer was simultaneously updated with the same info :-) . – Daniel Andersson Apr 8 '12 at 15:16
Yes. If he was running RHEL it would require symlinking i believe. – Journeyman Geek Apr 8 '12 at 15:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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