Apache VirtualHost 403 - While trying to install Wordpress

General support questions
Post Reply
kundzio89
Posts: 5
Joined: 2017/04/15 08:17:00

Apache VirtualHost 403 - While trying to install Wordpress

Post by kundzio89 » 2017/06/18 20:31:09

Hey,
I am trying to run/install Wordpress on my local machine / personal computer.
1. I have installed LAMP
(...) followed this instruction https://devops.profitbricks.com/tutoria ... -centos-7/ until reached wp-config.php
Because I want to change one thing i.e. change project root from /var/www/html/ to /run/media/[username]/DATA/dev/projects/wp-project-name
So googled and found out I need to add VirtualHosts config to my httpd.conf file
Do not want to mess up so moved my config to separate file

Code: Select all

# !!!(My Config)!!!
# Virtual Hosts
Include my-config/vh.conf
Which is:

Code: Select all

<VirtualHost test.dev:80>
        DocumentRoot /run/media/[username]/DATA/dev/projects/wp-project-name
        ServerName www.test.dev
        ServerAlias test.dev
        <Directory /run/media/[username]/DATA/dev/projects/wp-project-name>
                AllowOverride All
                Require all granted
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>
Then updated my /etc/hosts

Code: Select all

127.0.0.1	test.dev
::1            test.dev
And I am getting error:

Code: Select all

Forbidden

You don't have permission to access / on this server.
What should I do next?

mghe
Posts: 766
Joined: 2015/11/24 12:04:43
Location: Katowice, Poland

Re: Apache VirtualHost 403 - While trying to install Wordpress

Post by mghe » 2017/06/20 08:13:02

kundzio89 wrote: What should I do next?
Temporary set selinux to permissive mode by command: # setenforce 0

Check again and read about selinux https://access.redhat.com/documentation ... ors_Guide/

kundzio89
Posts: 5
Joined: 2017/04/15 08:17:00

Re: Apache VirtualHost 403 - While trying to install Wordpress

Post by kundzio89 » 2017/06/20 21:26:57

thanks but I have tried it. It does not work in my case, still 403.
Every case of this problem that is available somewhere in the Internet has been already checked.

mghe
Posts: 766
Joined: 2015/11/24 12:04:43
Location: Katowice, Poland

Re: Apache VirtualHost 403 - While trying to install Wordpress

Post by mghe » 2017/06/21 05:36:08

It look like problem to access file, could you show: ls -da /run/media/[username]/DATA/dev/projects/wp-project-name

Change to correct owner of data by command: chown apache:apache /run/media/[username]/DATA/dev/projects/wp-project-name -R , owner apache should have access to files.

kundzio89
Posts: 5
Joined: 2017/04/15 08:17:00

Re: Apache VirtualHost 403 - While trying to install Wordpress

Post by kundzio89 » 2017/06/21 07:06:42

Tried it too. Still 403, screenshot attached.
Screenshot from 2017-06-21 08-58-35.png
Screenshot from 2017-06-21 08-58-35.png (136.16 KiB) Viewed 1241 times

mghe
Posts: 766
Joined: 2015/11/24 12:04:43
Location: Katowice, Poland

Re: Apache VirtualHost 403 - While trying to install Wordpress

Post by mghe » 2017/06/21 16:06:12

If you try Wordpress add:

Directory section
Options +FollowSymLinks

and

<IfModule dir_module>
DirectoryIndex index.php
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

kundzio89
Posts: 5
Joined: 2017/04/15 08:17:00

Re: Apache VirtualHost 403 - While trying to install Wordpress

Post by kundzio89 » 2017/06/21 21:44:28

Does not work too.
Thank you for your time, but give it the rest.

Post Reply