Answer the question
In order to leave comments, you need to log in
How to make apache2 execute files?
I decided to try to work on ubuntu. remembering the experience of Denver, and even a self-made server on apache2, how easy everything is and just having read on all sorts of forums "lamp is not a crutch in the form of Denver, everything is cooler here" I was ambushed. What we have:
Given:
Ubuntu 14.0.4 LTS
It has a LAMP server, there are two symlinks in the /var/www folder
dev1.com -> /home/fetur/lamp-server/dev1.com
dev.com -> /home/fetur/lamp-server/dev.com
sudo chown -R $USER:$USER /var/www/dev.com/public
sudo chown -R $USER:$USER /var/www/dev1.com/public
sudo chmod -R 755 /var/www
drwxrwxr-x 6 fetur fetur 4096 апр. 16 14:41 .
drwxrwxr-x 3 fetur fetur 4096 апр. 16 14:37 ..
drwx------ 2 fetur fetur 4096 июля 21 2015 css
drwx------ 2 fetur fetur 4096 июля 21 2015 fonts
drwx------ 2 fetur fetur 4096 июля 22 2015 img
-rw-rw-r-- 1 fetur fetur 21 апр. 16 14:38 index2.html
-rw------- 1 fetur fetur 7681 июля 22 2015 index.html
-rw-rw-r-- 1 fetur fetur 0 апр. 16 14:38 index.html~
drwx------ 2 fetur fetur 4096 июля 21 2015 js
Forbidden
You don't have permission to access /index.html on this server.
Apache/2.4.7 (Ubuntu) Server at dev.com Port 80
Forbidden
You don't have permission to access / this server.
Apache/2.4.7 (Ubuntu) Server at dev.com Port 80
Answer the question
In order to leave comments, you need to log in
Apache apparently does not run as the user fetur, but as its own user, in ubuntu it is www-data. The permissions -rw------- fetur fetur mean that the user fetur can rw-, the group fetur can ---(nothing), and all other users, including www-data, can ---(nothing).
The rights to the new files are determined by umask, I advise you to read about it. (And also the default acl of the parent folder, but you do not use acl).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question