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?

1 Answer 1


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.

  • 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, 2012 at 4:32
  • After some trying, did i succeed. Thanks man ;-)
    – Mathlight
    Sep 19, 2012 at 11:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .