derian00
derian00

Reputation: 1

PHPmyadmin and Wordpress directories access denied

Running wordpress locally on a centOS 7 server running the latest apache, PHPmyadmin and mariadb-server.

IP/wordpress and IP/phpmyadmin on systems within the local network yields "403 forbidden" "you dont have permission to access (directory) on this server."

How can I fix this to allow the website to be seen on the public internet?

Upvotes: 0

Views: 487

Answers (2)

gragonmau
gragonmau

Reputation: 21

Probably there is an issue with your directory privileges.

Use the follwing command to check it:

cd your_site_directory     
ls -l

You can have a look to have a better understanding on directory privileges here.

As mentioned here apache runs under "apache" user. Have a look at this post here to fix the issue. All files should belong at least to apache group. To do it you can use

cd your_site_directory
chgrp -R apache ./*

Upvotes: 0

A1RO
A1RO

Reputation: 11

Could be a lot of things.

In your main Apache configuration file (e.g. /etc/httpd/conf/httpd.conf on Arch Linux), confirm your DocumentRoot path. The files you want to serve must reside there, or in sub-directories from there (If not, you might want to use an Alias to specify another path). Since you call IP/wordpress and IP/phpmyadmin, then you probably have directories called wordpress and phpmyadmin under your DocumentRoot path.

You also want to check the Directory groups in your Apache configuration file. Under those, the main culprit would be the Require directive set to all denied or something else too much restrictive like ip your_ip.

Finally, PHP can restrict path access with the open_basedir directive. Look for it in your php configuration file (e.g. /etc/php/php.ini on Arch Linux). If the line is commented, you're fine. But if a path is specified, your wordpress and phpmyadmin files must reside there.

Depending on your setup, any directive mentioned above could be in another Apache configuration file (e.g. /etc/httpd/conf/extra/* on Arch Linux).

Take a look at Apache and PHP online documentation for information about those directives.

Upvotes: 1

Related Questions