You do not have permission to access this server / on this server

I have a CentOS 6.1 server and I installed apache 2.2.15 on it. Now, when I try to access it from another computer (Windows 7) from IE (http: /// (= centos ip)), I get the message "You do not have permission to access / on this server." mistake. I even created a phpinfo.php file with the content "on" var / www / html ", and when I try to access it using" http: //*/phpinfo.php "in IE, I did not find an error. What do I do? my httpd.conf for directiry looks like this:

<Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> 
+7
apache centos6
source share
9 answers

Edit the httpd.conf file, which is located in /etc/httpd/conf/httpd.conf . Add the code below.

 <Directory "/"> #Options FollowSymLinks Options Indexes FollowSymLinks Includes ExecCGI AllowOverride None Allow from all </Directory> <Directory "/home/"> #Options FollowSymLinks Options Indexes FollowSymLinks Includes ExecCGI AllowOverride None Allow from all </Directory> 

After line No. 555 (in my case). Check the file permissions and restart the server.

 service httpd restart 

Now it will work. However, you are faced with the same problem, disable seLinux in /etc/selinux/config change SELINUX=disabled and restart the server as above and try.

Hope this helps

+16
source share

Check permissions on / var / www / html files and ALLOW directive in apache conf

Make sure all files are readable by the web server and the allow directive is as

  <Directory "/var/www/html"> Order allow,deny Allow from all </Directory> 

if you can see the files then consider directive sorting as more restrictive

+3
source share

The fist checks if apache is working. service httpd restart to restart

CentOS 6 ships with SELinux enabled, so either change the policy or disable it by editing the /etc/sysconfig/selinux SELINUX=disabled . Then restart

Then check locally (from centos) if apache is working.

+2
source share

Install SELinux in permissive mode using the following command:

 setenforce 0; 
+2
source share

Try the following: chmod + rx / home / *

+1
source share

Create an index.html or index.php file in the root directory (in your case /var/www/html , as indicated by @jabaldonedo)

0
source share

Right-click your www folder and click on Properties. Go to permissions and change everything to read and write, then click " Apply permission to attached files " and everything will be done! It may be too late, but it will definitely help the other person.

0
source share

Check apache user and group settings in httpd.conf. It should use apache by default for AMI / RedHat or www data in Debian.

 grep '^Group\|^User' /etc/httpd/conf/httpd.conf 

Then add the apache user to the group settings of the root directory of your site.

 sudo usermod -a -G <your-site-root-dir-group> apache 
0
source share

If you install SELinux in permissive mode ( setenforce 0 command) and it works (works for me), you can run restorecon ( sudo restorecon -Rv /var/www/html/ ), which will permanently set the correct context for the files in the Apache directory since setenforce is temporary, the context for Apache is httpd_sys_content_t , and you can check its execution with the ls -Z /var/www/html/ , which outputs something like:

-rwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 index.html

If the file does not have a suitable context, you will see something like this:

drwxr-xr-x. root root unconfined_u:object_r:user_home_t:s0 tests

Hope this helps you.

PD: excuse me my english

0
source share

All Articles