CentOS 6.4 64bit, minimal install, in VirtualBox.
Added groupinstall "Development Tools" to install VBox Guest Additions.
Installed Webmin, Apache, MySQL, PHP.
Trying to get a program called "Multicraft" to run. It is downloaded in a .tar.gz file and has an installer that you run. It installed properly but I must visit http://192.168.1.140/multicraft/install.php to finish install. The folder is located at /var/www/html/multicraft. I keep getting a 403:Forbidden every time I try to access the folder itself or the install.php or index.php file within the folder from a browser. I can reach the main http://192.168.1.140 and it shows the "Apache HTTP Server Test Page"
Apache is run under the apache user and apache group
-I have done a "chown -R apache:apache *" within the /var/www directory to make sure all permissions are correct.
-The installer asks which user to run multicraft in and I made a "minecraft" user and added them to the "apache" group.
-I have added the following into my /etc/httpd/conf/httpd.conf file:
#user-added directory
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
-There are also .htaccess files located within the directory that were installed with the program. Here is a list of all .htaccess files on the system:
/root/multicraft/panel/.htaccess
/root/multicraft/panel/protected/.htaccess
/root/multicraft/panel/protected/yii/.htaccess
/root/multicraft/panel/protected/yii/cli/views/webapp/protected/.htaccess
/root/multicraft/panel/protected/yii/cli/views/webapp/themes/classic/views/.htaccess
/root/multicraft/panel/themes/mobile/views/.htaccess
/root/multicraft/panel/themes/simple/views/.htaccess
/var/www/html/multicraft/.htaccess
/var/www/html/multicraft/protected/.htaccess
/var/www/html/multicraft/protected/yii/.htaccess
/var/www/html/multicraft/protected/yii/cli/views/webapp/protected/.htaccess
/var/www/html/multicraft/protected/yii/cli/views/webapp/themes/classic/views/.htaccess
/var/www/html/multicraft/themes/mobile/views/.htaccess
/var/www/html/multicraft/themes/simple/views/.htaccess
-Here is the "/var/www/html/multicraft/.htaccess" file:
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .? - [S=2]
# redirect to installer if the request ends with install.php
RewriteRule /install\.php$ install.php [L]
# otherwise forward it to index.php
RewriteRule . index.php
I still get this 403:Forbidden on the directory of "/var/www/html/multicraft" access by "192.168.1.140/multicraft" in the browser. I have also tried the "192.168.1.140/multicraft/install.php" and "192.168.1.140/multicraft/index.php" and gotten the same error.
I cannot figure out what I have done wrong. Any ideas on a step I may have missed. Or a configuration I may have screwed up. Thanks in advance for any help.
[SOLVED] Apache 403:Forbidden on sub-directory
Re: Apache 403:Forbidden on sub-directory
Try
[code]
restorecon -r /var/www/html
[/code]
[code]
restorecon -r /var/www/html
[/code]
Re: Apache 403:Forbidden on sub-directory
[quote]
TrevorH wrote:
Try
[code]
restorecon -r /var/www/html
[/code][/quote]
You sir, are my hero.
Days of smashing my head against a wall with no avail. You solved my problem with one line of code.
Thank you again.
:-D
TrevorH wrote:
Try
[code]
restorecon -r /var/www/html
[/code][/quote]
You sir, are my hero.
Days of smashing my head against a wall with no avail. You solved my problem with one line of code.
Thank you again.
:-D
Re: [SOLVED] Apache 403:Forbidden on sub-directory
The issue is caused when you mv something from one place to another. It preserves the selinux context of the original when you move it, so if you untar something in /home or /tmp it gets given an selinux context that matches its location. Now you mv that to /var/www/html and it takes the context saying it belongs in /tmp or /home with it and httpd is not allowed by policy to access those files.
If you cp the files instead of mv them, the selinux context gets assigned according to the location you're copying to, not where it's coming from. Running restorecon puts the context back to its default and fixes it too.
If you cp the files instead of mv them, the selinux context gets assigned according to the location you're copying to, not where it's coming from. Running restorecon puts the context back to its default and fixes it too.
-
- Posts: 1
- Joined: 2014/11/18 09:35:12
Re: [SOLVED] Apache 403:Forbidden on sub-directory
Thanks from the future. Just created an account so i could post my thanks to TrevorH as I too was beating my head against a wall a year later
Re: [SOLVED] Apache 403:Forbidden on sub-directory
OMG!! That was the solution for me too... thank you so much!!
Re: [SOLVED] Apache 403:Forbidden on sub-directory
Thanks a lot that worked for me too after, saw this post after struggling for almost a day.