Answer the question
In order to leave comments, you need to log in
Why is Apache2 giving Forbidden 403?
It costs ubuntu 13.10, installed apache, installed mod_macro to quickly add hosts.
Here is the macro code:
<Macro VHost $host $path>
<VirtualHost *:80>
DocumentRoot "$path"
ServerAdmin [email protected]
ServerName $host
ServerAlias www.$host
DirectoryIndex index.php index.html index.htm index.shtml
<Directory "$path">
Options FollowSymLinks
Options all
AllowOverride All
allow from all
</Directory>
</VirtualHost>
</Macro>
Use VHost blog.loc /home/www-data/www/blog
Forbidden
You don't have permission to access / on this server.
Apache/2.4.6 (Ubuntu) Server at blog.loc Port 80
sudo chmod -R 777 /home/www-data/www/blog
sudo chmod -R 777 /home
Use VHost blog.loc /home/www-data/www/blog
Use VHost blog.loc /var/www/blog
Answer the question
In order to leave comments, you need to log in
First, check the error.log, and then try to log in under the user from which apache is running
and try to go to the desired folder under it.cd /home/www-data/www/blog
Require all granted
<VirtualHost *:80>
ServerName site
...
<Directory /home/www/site/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
Require all granted
</Directory>
...
</VirtualHost>
ctrl+alt+t
sudo gedit /etc/apache2/apache2.conf
+ add
<Directory /home/your_user/folder_public_html>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
+ sudo service apache2 restart
Мне помогло)
2020.g
Maybe someone else will come in handy
Go to /etc/apache2
Open apache2.conf
line 170 and replace line 174 with this
Directory /var/www/>
AllowOverride All
Restart Apache service apache2 restart or service httpd restart
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question