I am a total newbie and has seen lots of tutorials on the net but still can't solve my problems.

I installed LAMP+PHPMyAdmin the following way: sudo apt-get install lamp-server^ phpmyadmin

Here are my issues: 1) I need to change my document root. I need to set it to /data/WWW. I tried the "ln" function, it creates a shortcut but when I access http://localhost it gives me 403 error. I believe there is some permissions issue but have no idea how to solve it. Please help! 2) Trying to access phpmyadmin via http://localhost/phpmyadmin does not work. How do I access it? Do I have to create some link to it?

Any help is very appreciated!


you can change the default document root in


Apache is mostly configure files. by changing settings in the .conf, you can achieve almost anything.

open a terminal and type:

sudo nano /etc/apache2/sites-available/default*

your file should start like:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />

change Document root to wherever you want, and press Crtl+X to save and exit.

then reload apache with:

sudo /etc/init.d/apache2 restart
| improve this answer | |

I following article I write about moving your document root to your home directory. The same procedure applies when moving it anywhere else:


The only thing you should watch out for is to make sure new document root is writable by www-data user from www-data group.

| improve this answer | |
  • The chown and chmod commands worked like a charm! How can I access the phpmyadmin now? – barakuda28 Oct 17 '12 at 18:45

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.