Ubuntu – Help with LAMP sever

11.04lamp

Firstly I followed the instructions on the following site to install the LAMP server:

http://www.multimediaboom.com/how-to-install-lamp-server-in-ubuntu-11-0410-1010-04/#comment-48391

step 3: go to http://localhost/phpmyadmin
This did not work. It came up with a 404 error at first then after running "sudo ln -s /usr/share/phpmyadmin /var/www" it came up with a 403 error and said "Forbidden: You don't have permission to access /phpmyadmin on this server".

Then the last step was to make a simple php file and test that php was working. I could not save the file into /var/www/

So to recap:

  1. How do I get around the 403 forbidden error for phpmyadmin?
  2. How do I save / copy / make files in /var/www/ when it is owned by root?

EDIT:

I have managed to save the test.php file into /var/www/ by launching gedit via the gksudo command. When I go to localhost/test.php however it downloads the test.php file instead of running it on the server.


Apache2 error log file contents:

[Tue Oct 04 15:30:27 2011] [notice] Apache/2.2.17 (Ubuntu) configured -- resuming normal operations
[Tue Oct 04 15:30:30 2011] [notice] Graceful restart requested, doing restart
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Tue Oct 04 15:30:30 2011] [notice] Apache/2.2.17 (Ubuntu) configured -- resuming normal operations
[Tue Oct 04 15:31:46 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 15:32:27 2011] [error] [client 127.0.0.1] File does not exist: /var/www/phpmyadmin
[Tue Oct 04 15:32:27 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 15:33:17 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 15:33:17 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:23 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:23 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:25 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:25 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:31 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:31 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:32 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:32 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:52 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 17:06:15 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 17:06:15 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[    Tue Oct 04 17:24:34 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 17:24:42 2011] [error] [client 127.0.0.1] File does not exist: /var/www/php
[Tue Oct 04 17:24:42 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 17:25:42 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 17:25:42 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 18:31:45 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 19:07:40 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico

Thanks.

Best Answer

Try editing apache2.conf or httpd.conf

sudo nano /etc/apache2/apache2.conf

Make sure you have there

include /etc/phpmyadmin/apache.conf
alias /phpmyadmin /usr/share/phpmyadmin

And that they are uncommented. I am not sure about the paths. 1st one will include phpmyadmin config file. 2nd will make phpmyadmin available on 127.0.0.1/phpmyadmin. I'd have to see those config files. Try different things restarting apache on each change:

sudo service apache2 restart
Related Question