I want to change the default location of Apache folder which is (var/www/html).
I am using the Fedora as OS and apache 2 here. you can use following code with any linux box like centos or ubuntu. Here we solved the issue of directory.
When I inserted the following code in bottom of the httpd.conf file.
<VirtualHost *:80>
Options +FollowSymLinks
ServerAdmin siwan@yahoo.co.in
DocumentRoot /var/www/html/testfolder
ErrorLog logs/error_log_net
TransferLog logs/access_log_net
</VirtualHost>
When tried the http://localhost/ in browser, I got the default browser page.
Then I tried to look my apache error using following command:
#[root@localhost ]# tail -f /var/log/httpd/error_log
In apache error log I got following error.
[Wed Oct 07 15:59:50 2008] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/testfolder/
I changed the AllowOverride option but nothing is happens. Then I read the welcome page text
“To prevent this page from ever being used, follow the instructions in the file /etc/httpd/conf.d/welcome.conf.”
I opend the welcome.conf file.
I found following lines in welcome.conf file.
<LocationMatch “^/+$”>
Options -Indexes
ErrorDocument 403 /error/noindex.html
LocationMatch>
I changed that to as follows:
[viral-lock message=”Solution code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]
<LocationMatch “^/+$”>
Options Indexes
ErrorDocument 403 /error/noindex.html
</LocationMatch>
[/viral-lock]
That solve my problem. Some time your selinux will cause the issue so you need to deactivate the selinux.
Some time File permission will also cause the issue.
You can change the file permission using following command, go to that directory and run following command.
#chmod 777 *
You can use above commands on any linux box. Ubuntu, centos, redhat or on fedora box.. still solution will be same.
that is ok.
I’ve got this problem at the moment trying to install RoR on CentOS – causing us real problems.
Selinux issue wont get resolved by chmod.. you need to change the selinux access controls
refer: http://wiki.centos.org/TipsAndTricks/SelinuxBooleans
Cannot see the solution code even after liking on fb, G+ and sharing on linkedin.
did you clicked properly.
Code was visible after commenting.
This solution worked for me as well. After changing the welcome.conf, the wget localhost command returned data. Though still not able to access on browser
I see this problem too
i have this problem too
Curious about the solution
share it properly
not bad
code not visible
I have this problem too
I solve this problem myself.. there is issue of php installation. i installed it using source package which nagios not able to pick. when i installed php through yum everything works. i think there is some path issue of php.
You should never utilize 0777 permissions in the context of a web server.
Apache’s defaults are a umask of 022 which produces files with 0644 and directories with 0755 permissions, and all should be owned by the Apache user. (Changes according to platform)
Utilizing 0777 opens your web server to compromise and ultimately is not a security best practice.
shared everywhere.
Hi,
I have problem with displaying solution , and compartment But nothing …….helps !
and let me see the solution but my problem persists! 🙁
Which OS you are using?
i can’t see the code please !! i clicked on like and G+ and tweet !!!
did you clicked on where code is?
gud
i also cannot see code even after liking. this is a sad way to generate page clicks.
The solution code is hidden by a very dumbass tool that doesn’t show it any sharing you make.
This is disappointing
Liked on G+ and facebook. Not showing up.