The 403 Forbidden you don ' t has permission to access/on the this server.

Source: Internet
Author: User

Reference blog:

A, http://www.linuxidc.com/Linux/2016-09/134827.htm this explanation is very good

Configuring a new server yesterday: Think of yourself as an old hand. One step results always appear 403 Forbidden you do not have permission to access/on this server. Baidu all the solution found or not, there is no way to re-step to find the wrong:

1, from the HTTP installation to find: This is best when the installation is completed after the display of the information page
<?phpphpinfo ()?>

I found from this information page that some of the installation is not installed, for example: php55w-mysql.x86_64 php55w-pdo.x86_64

Rethink: Yum installs multiple when it's best to add-y to every step of the way.

2, Configuration http.conf

As soon as the information page shows that the installation is not a problem, the rest is the configuration problem!

When you edit the configuration file/etc/httpd/conf/httpd.confvim/etc/httpd/conf/httpd.conf servertokens OS # Server corresponding host header information, the Apache version and operating system name are displayed Se Rverroot "/etc/httpd" #指定服务器主配置文件和日志文件的位置 Timeout #在指定时间内没有收到或发出任何数据则断开连接, in seconds KeepAlive on #是否启用长连接 Maxke Epaliverequests #当启用长连接时, the maximum number of requests that can be connected at a time KeepAliveTimeout #启用长连接时, specify the max interval of two requests in a single connection, and the connection will be disconnected < Ifmodule prefork.c> #使用prefork工作模型 startservers 8 #刚开启时启动的守护进程数量 minspareservers 5 #设置最少空闲进程 When the idle process is less than the prescribed    Creates a new process maxspareservers #设置最多空闲进程, some serverlimit are removed when the idle process is more than the rule maxclients 256 #设置同一时间允许的最大客户端连接数 maxrequestsperchild 4000 #设置每个子进程能处理的最大连接数量 </IfModule> directoryindex index.html index.h  Tml.var #设置网站默认文档 Include conf.d/*.conf #将指定文件包含进来 User Apache #设置运行apache服务的用户 Group Apache #设置运行apache服务的组   ServerAdmin [email protected] #设置管理员的邮箱, when the Apache service has a problem, will send an email to notify the administrator DocumentRoot "/var/www/html" #设置存放网页的根目录位置 #设置特定目录的属性 <directory "/var/www/html" > Options followsymlinks #FllowSymLinks: Allows access to files that are not in this directory Indexes: The file list in the current directory is generated when the file specified in DirectoryIndex is not found in the directory MultiViews: If the path requested by the client may correspond to multiple types File, the server will automatically select a file that best matches the client's requirements, based on the specifics of the client request. For example, in the file folder of the server site, there are two files named Hello.jpg and hello.html, at which time the user enters Tttp://localhost/file/hello, if there is no Hello subdirectory under the file folder,     The server will then attempt to find a file with the form hello.* under the file folder and then return the hello.jpg or hello.html that best matches the request, depending on the user's request. AllowOverride None #不去读取 the contents of the. htaccess configuration file Order Allow,deny #先执行allow访问控制规则 , and then execute deny allow the from all #放行所有 </Directory> hostnamelookups off #设置服务器记录客户端的IP地址还是主机名, when off is logged IP , record host name Errorlog Logs/error_log on when on #设置错误日志保存位置

My configuration is to change the default site directory, generate logs daily, easy to delete periodically

<virtualhost *:80>     ServerAdmin [email protected]     Documentroot/home/webuser/webroot/maisui     ServerName 47.93.228.65     #ErrorLog logs/maisuijf.com-error_log     #CustomLog logs/maisuijf.com-access_log Common     errorlog "| /usr/sbin/rotatelogs/home/webuser/webroot/log/maisuijf.com_error_log.%y_%m_%d_error_log 86400 480 "     CustomLog "| /usr/sbin/rotatelogs/home/webuser/webroot/log/maisuijf.com_access_log.%y_%m_%d.log 86400 480 "combined     LogLevel info     Options all-indexes     directoryindex index.php index.html      <directory "/home/webuser/ Webroot/maisui ">           Options Indexes followsymlinks          allowoverride all           Order allow,deny           allow From all      </Directory>  </VirtualHost>

After discovering the settings, the home page can be accessed, but other sub-pages open incorrectly and should be URL not enabled correctly:

Modify the site root: allowoverride all enable rewriting

3. Summary

All the other networks say is only for reference!

For example:

Apache Server appears forbidden 403 error Prompt Solution Summary This is good, the inside of the set permissions is very good.

Apache after changing the DocumentRoot, or new virtual directory after the 403 Error solution summary (Linux) This is better, to learn to read the error log, it is very important, I just look at the error log modification.

The 403 Forbidden you don ' t has permission to access/on the this server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.