I'm on Ubuntu 12.10 with LAMP setup. I copied a subdirectory which has project files (php, html, css) from xampp/htdocs on my Windows PC into /var/www/ of my ubuntu. However, when I access those files from browser (I can see the directory listing), I get 403 Forbidden on all files within that directory. So I create new dummy php files within that directory just to see if I can access, and it works. Any idea what might be the problem?
To access the root begin your path with "/". If you want to go up one directory from where you are currently, e.g. from /x/a/ to /x/ you could use "../". If you want to go back up two directories (e.g. from /x/a/ to /) you could use "../../" (rather than ".../" which you mentioned).
may be a ownership problem.
try do
chmod -R 775 /var/www/folder
and/or
chown -R domain:www-data /var/www/folder
- where domain is the user of that particular virtualhost or www-data
for directory listing you may want to modify in /etc/apache2/sites-available/default
+Indexes
see http://www.cyberciti.biz/faq/enabling-apache-file-directory-indexing/
This is how I solved the issue:
sudo su
chmod a+rwx /var/www/html/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With