Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I installed lamp on ubuntu. Apache2 and Mysql are working fine.

The folder apache2 is in /etc and contains:

apache2.conf  envvars     magic           mods-enabled  sites-available
conf.d        httpd.conf  mods-available  ports.conf    sites-enabled

The httpd.conf file is empty. As far as windows is concerned apache had a "www" folder where we used to store our php files. What should I do in this case ? The tutorials given on the internet could not help! :| Please help!

share|improve this question
What tutorials you followed? How you installed apache? Is it using package manager like apt-get or software center or some other process – Anwar Shah Aug 9 '12 at 16:40

2 Answers 2

up vote 2 down vote accepted

The equivalent folder in Ubuntu should be /var/www, unless you changed it yourself. This directory is (by default) defined in /etc/apache2/sites-enabled/000-default, in the line that begins with the word DocumentRoot.

share|improve this answer
You'll probably need to change permissions for that folder. sudo chmod 777 /var/www/ – tyjkenn Aug 16 '12 at 1:07
777 is rarely the solution to any problem. – Marios Zindilis Aug 29 '12 at 17:14
set permission to 777 is not recommended solution, everyone will be able to access your folder, of course that's related with security reason. – metamorph May 15 '14 at 10:45
I have my php files in the folder you specify @MariosZindilis but when I access 'localhost' I think my browser is looking for index.html, not index.php (which is what I have). How do I get the php file to run? Also, I have a child theme i would like to run and that is in a separate folder. – GoProCameraByGoPro Mar 11 at 21:40
It seems that since 2012, when this answer was first posted, Ubuntu has changed the location of files for the default website on Apache, and it is now /var/www/html. That directory includes a sample index.html in a fresh installation. – Marios Zindilis Mar 12 at 1:12

If you are running your file just for the localhost then change the chmod to 777 for /var/www/html save every php file in html folder which is found in the path mentioned above. The new apache loads the file from the server only if it is present in the HtMl folder. i hope it will work. (Though 777 chmod is not recommended of course because of the security issues)

share|improve this answer

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.