R
R
Rishat Sultanov2017-01-22 14:07:25
linux
Rishat Sultanov, 2017-01-22 14:07:25

How to give Apache permissions to a folder?

Good afternoon, ladies and gentlemen.
I want to raise the project on laravel.
Created it in: /home/rishat/workspace/web/laravelprojects/test/laravel/ Registered
local domains in Apache.

<VirtualHost laravel.local:80>
    ServerName laravel.local
    ServerAlias laravel.local

    ServerAdmin [email protected]
    DocumentRoot /home/rishat/workspace/web/laravelprojects/test/laravel/public

    <Directory /home/rishat/workspace/web/laravelprojects/test/laravel/public>
        AllowOverride All
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

But when I try to go to this address, it knocks out.
Forbidden

You don't have permission to access / on this server.
Apache/2.4.18 (Ubuntu) Server at laravel.local Port 80

PS
[email protected]:~# sudo chmod -R 777 /home/rishat/workspace/web/laravelprojects
[email protected]:~# sudo service apache2 stop
[email protected]:~# sudo service apache2 start
[email protected]:~#

But the joke is that it works in folders where nothing can be edited without root. In my case, the project is located in a folder that does not require root. And in the end, Apache can't do anything there. But I can. Even if I give the rights through the console.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry, 2017-01-22
@rishatss

Good afternoon.
I think you have apache 2.4?
In the server config file, try adding the Require all granted directive

<Directory /home/rishat/workspace/web/laravelprojects/test/laravel/public>
        AllowOverride All
       Require all granted
    </Directory>

Yes, and return the access rights to the initial state.
In the project directory for folders - 755, for files 644

I
Ivan, 2017-01-22
@LiguidCool

chown
chmod
mc
Permissions - web-data (in my opinion it is called so in Ubuntu). In principle, from whom it is possible to launch via top / htop .

M
Maybe_V, 2017-01-22
@prokopov-vi

sudo chmod -R 777 /path/to/target/folder
Or instead 777, you can give the rights you want.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question