Apache on Ubuntu Problem

c10n3d_0r6

Senior Member
Joined
Nov 1, 2005
Messages
627
Reaction score
12
Hi

I've installed Apache on my Ubuntu system to start learning so web develpment on it. I used to have xampp installed in Win 7. The web pages load fine if they are in the root directory (var/www/folder) by typing http://localhost/folder in Firefox, however anything in subsequent folders don't work.

I have my css files in a sub-folder (var/www/folder/css), but they won't load. When I type the address for it I get a 403 Forbidden error. The pages however work when typing file:///var/www/folder/css/ into the browser. Just not when using localhost. Is there anyway to fix this? I don't want to have to have all my files lying in my root directory, especially as it worked on Windows.

Regards
 
Check permissions and ownership? Chmod 777 and chown -R make sure that apache has permission to see those folders.
 
I'd say it's an apache config issue. Make sure your directory has sufficient overrides and access set in httpd.conf or apache.conf.
Perhaps it's a follow symlinks directive or allowoverride issue.

That said, it's a better idea to set your sites up in separate dirs of /var/www and set up separate vhosts per site, as well as a separate entry in /etc/hosts per site. Don't forget to reload httpd after making config changes. Pm me if you need help. There's lots of guides online though.

Edit: wizards right. You're accessing the files as the apache user in one instance and as the local account in the other. Normally chmod -R 644 or 755 should suffice. You should only need 777 if you need write permissions.
 
I have noticed a similar error when folder permissions weren't sufficient, as it was a localhost server, I was lazy and just set the relevant folders to 777. Obviously this is not the route to go on a live/production server.

B
 
Thanks I got it working. Its just for my local lamp server on my home PC.
 
Top
Sign up to the MyBroadband newsletter
X