How to solve problems with the rights?

Hello. I Use Linux Ubuntu 14.04
Downloaded apache with all modules and settings.
All that can be set for convenience - set up.

Now, however, a problem occurs when installing any engine.
Throw the files in the root folder "/var/www".
Prior to this giving rights to be able to somehow communicate with this directory:
sudo chmod 775 /var/www
sudo chmod-R 775 /var/www


In the installation instructions of the engine ( docs.instantcms.ru/manual/install ), please put their rights to folders, which I do. However, the site does not appear at all:
You don't have permission to access / on this server.


Tired of messing around with the rights. Tell me how to configure Apache correctly?
Or what to do in this situation?

Thanks in advance.
July 12th 19 at 17:03
3 answers
July 12th 19 at 17:05

sudo chmod 775 /var/www
sudo chmod-R 775 /var/www


For such rights it is necessary to beat the hand and to tear all that off. Why do you have everyone in the group write access to the directory? Why do you have all the files run?
chmod 750 /srv/www
chmod-R 640 /srv/www/

PS the Directory containing the data output by the web server for over 13 years should not be in /var, it's a relic of the past, for such purposes, there are /srv, read the FHS.
Should not, but in a deb-based distro it's still there - Bridgette.Stokes commented on July 12th 19 at 17:08
Such rights of access will not receive any developer from the group devel devel or Apache with its www-data or apache - terence85 commented on July 12th 19 at 17:11
: a hangover you Apache will get if the directory have www-data? Well, turn on you developer in www-data and not the law let's the entire yard. - Billy_Davis commented on July 12th 19 at 17:14
:

ls-la /srv/
total 16
drwxr-xr-x 4 root root 4096 Apr 1 15:01 .
drwxr-xr-x 22 root root 4096 Apr 21 13:18 ..
drwxr-xr-x 3 www-data www-data 4096 Mar 27 01:24 data
drwxr-xr-x 8 www-data www-data 4096 Mar 27 22:02 web

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

Wow! You don't say! - Billy_Davis commented on July 12th 19 at 17:17
July 12th 19 at 17:07
View which user is running apache (in httpd User.conf), usually it is apache
Change the owner of directories
chown-R apache:apache /var/www

After that chmod will work as it should
root 6998 2011 0 14:53 ? 00:00:00 /usr/sbin/apache2-k start
www-data 7002 6998 0 14:53 ? 00:00:00 /usr/sbin/apache2-k start
www-data 7003 6998 0 14:53 ? 00:00:00 /usr/sbin/apache2-k start
www-data 7004 6998 0 14:53 ? 00:00:00 /usr/sbin/apache2-k start
www-data 7005 6998 0 14:53 ? 00:00:00 /usr/sbin/apache2-k start
www-data 7006 6998 0 14:53 ? 00:00:00 /usr/sbin/apache2-k start
www-data 7013 6998 0 14:53 ? 00:00:00 /usr/sbin/apache2-k start
wagwan 12186 12199 0 17:51 pts/4 00:00:00 grep --color=auto apache - Bridgette.Stokes commented on July 12th 19 at 17:10
so the user www-data - terence85 commented on July 12th 19 at 17:13
July 12th 19 at 17:09
Apache, MySQL stopped when you gave write permissions?
No - Bridgette.Stokes commented on July 12th 19 at 17:12
stop and try to assign rights again - terence85 commented on July 12th 19 at 17:15
If I set its rights:
sudo chmod 775 /var/www
sudo chmod-R 775 /var/www
Then, only the main page, but due to the peculiarities of the engine, should stand up for their rights on the folders. And when installing these rights have nothing to run - Billy_Davis commented on July 12th 19 at 17:18
That InstsntCMS. To work with the catalogue is made possible without difficulty to assign to it universal rights 777
Source www.mintlinux.ru/forum/thread948.html - Billy_Davis commented on July 12th 19 at 17:21
Do not need to restart.
Permissions 777 this is also not the solution.
My comment below. - Blanca88 commented on July 12th 19 at 17:24
: 777 is not "universal rights", and "who wants to come in and do what he wants." It's just a shitbox. The who has advised to put such rights have to take your pseudopods. - celestino.Flatley commented on July 12th 19 at 17:27
: I'm not an expert, thank you for your comment. - Blanca88 commented on July 12th 19 at 17:30
: don't thank me, I hope more will do so and you will have more of such holes with rights. - brooke_OKon50 commented on July 12th 19 at 17:33

Find more questions by tags ApacheLinuxUbuntu