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

I'm using Xubuntu (Linux version 3.2.0-30-generic (buildd@aatxe), gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)).

I've installed Apache2, php5 and mysql.

On Windows, I used WAMP, and I edited Apache's httpd.conf and the windows host file, in order be able to go to http://cmslocalhost/ and see my local cms, that was in a folder of the WAMP server.

I want to do the same thing with my LAMP server. So I want to go to http://cmslocalhost/ and see the website files from /var/www/cms/ being loaded (index.php, ...).

How can I achieve this?

share|improve this question
up vote 1 down vote accepted

In order to redirect http://cmslocalhost/ to localhost you need to edit /etc/hosts file. Syntax is the same as you used in windows host file. You will need something like cmslocalhost

For Apache you need to do the same configuration as you did on Windows.

Site configuration (VirtualHost description) of your server resides under directory /etc/apache2/sites-enabled/. If you are using a new virtual host to direct the requests, you can edit the default site configuration and add a new virtual host.

If you are using rewrite rules, you can put them into the virtual host description in default site configuration file, or if you need to put them outside any virtual host, you can use /etc/apache2/httpd.conf for inserting your own configuration directives.

share|improve this answer
alright, let's get this right... I'm going to use rewrite rules (with htacces file)... where does i have to add the virtual host stuff that i add in Windows at the appache httpd.conf? – Mathlight Sep 19 '12 at 4:32
After some trying, did i succeed. Thanks man ;-) – Mathlight Sep 19 '12 at 11:17

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.