gpt4 book ai didi

linux - 为什么我在浏览器中出现禁止错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:35:34 24 4
gpt4 key购买 nike

我是 apache 的新用户,正在尝试学习并设置了一个仅用于学习和测试的域。但是,在我开始之前,我得到了 Forbidden You do not have permission to access this document.。经过研究我知道这个错误与 http.conf.htaccess 文件有关。

我的目录中没有.htaccess 文件,我已经发布了我的http.conf 文件。如果有人可以帮助我解决这个问题,我将不胜感激。非常感谢

仅供引用,我已将敏感数据替换为前导零。

PHP: v5.4 fastcgiAPACHE:Apache/2.2.15 (Unix)

这是 ls -la 的结果

total 468
dr-xr-x--- 5 root root 4096 Aug 10 2014 .
dr-xr-xr-x 26 root root 4096 Apr 3 12:19 ..
-rw------- 1 root root 1325 Jul 11 2011 anaconda-ks.cfg
drwxr-xr-x 2 root root 4096 Jan 23 03:49 .autoinstaller
-rw------- 1 root root 9454 Apr 3 12:18 .bash_history
-rw-r--r-- 1 root root 18 May 20 2009 .bash_logout
-rw-r--r-- 1 root root 176 May 20 2009 .bash_profile
-rw-r--r-- 1 root root 176 Sep 23 2004 .bashrc
-rw-r--r-- 1 root root 29 Aug 5 2014 created
-rw-r--r-- 1 root root 100 Sep 23 2004 .cshrc
-rw-r--r-- 1 root root 8730 Jul 11 2011 install.log
-rw-r--r-- 1 root root 3094 Jul 11 2011 install.log.syslog
-rw-r--r-- 1 root root 130324 Jan 8 2013 kmod-e1000e-2.1.4-1.el6.elrepo.x86_64.rpm
-rw-r--r-- 1 root root 135820 Sep 23 2013 kmod-e1000e-2.5.4-1.el6.elrepo.x86_64.rpm
-rw-r--r-- 1 root root 116252 Sep 23 2013 kmod-igb-5.0.5-1.el6.elrepo.x86_64.rpm
drwxr-xr-x 59 root root 4096 Apr 3 03:25 parallels
drwx------ 2 root root 4096 Aug 10 2014 .spamassassin
-rw-r--r-- 1 root root 129 Dec 3 2004 .tcshrc


#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
#IF YOU REQUIRE TO APPLY CUSTOM MODIFICATIONS, PERFORM THEM IN THE FOLLOWING FILES:
#/var/www/vhosts/system/domain.co.uk/conf/vhost.conf

<VirtualHost 00.00.00.00.:0000 >
ServerName "domain.co.uk:80"
ServerAlias "www.domain.co.uk"
ServerAlias "ipv4.domain.co.uk"
ServerAdmin "pa@domain.com"
UseCanonicalName Off

DocumentRoot "/var/www/vhosts/domain.co.uk/httpdocs"
CustomLog /var/www/vhosts/system/domain.co.uk/logs/access_log plesklog
ErrorLog "/var/www/vhosts/system/domain.co.uk/logs/error_log"

<IfModule mod_suexec.c>
SuexecUserGroup "peterc" "psacln"
</IfModule>

<IfModule mod_userdir.c>
UserDir "/var/www/vhosts/domain.co.uk/web_users"
</IfModule>

<IfModule mod_sysenv.c>
SetSysEnv PP_VHOST_ID "7d9a2c29-8013-470b-a6eb-36549a513f6b"
</IfModule>

ScriptAlias "/cgi-bin/" "/var/www/vhosts/domain.co.uk/httpdocs/cgi-bin/"

Alias "/plesk-stat" "/var/www/vhosts/system/domain.co.uk/statistics"
<Location /plesk-stat/>
Options +Indexes
</Location>
<Location /plesk-stat/logs/>
Require valid-user
</Location>
Alias /webstat /var/www/vhosts/system/domain.co.uk/statistics/webstat
Alias /webstat-ssl /var/www/vhosts/system/domain.co.uk/statistics/webstat-ssl
Alias /ftpstat /var/www/vhosts/system/domain.co.uk/statistics/ftpstat
Alias /anon_ftpstat /var/www/vhosts/system/domain.co.uk/statistics/anon_ftpstat
Alias /awstats-icon /var/www/html/awstats/icon

<IfModule mod_ssl.c>
SSLEngine off
</IfModule>

SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/system/domain.co.uk/etc/php.ini
SetEnv PP_CUSTOM_PHP_CGI_INDEX fastcgi

<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/system/domain.co.uk/etc/php.ini
FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX fastcgi
FcgidMaxRequestLen 134217728
</IfModule>

<Directory /var/www/vhosts/domain.co.uk/httpdocs>

<IfModule mod_perl.c>
<Files ~ (\.pl$)>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options +ExecCGI
allow from all
PerlSendHeader On
</Files>
</IfModule>
<IfModule mod_python.c>
<Files ~ (\.py$)>
SetHandler python-program
PythonHandler mod_python.cgihandler
</Files>
</IfModule>
<IfModule mod_fcgid.c>
<Files ~ (\.fcgi$)>
SetHandler fcgid-script
Options +ExecCGI
</Files>
</IfModule>
<IfModule mod_fcgid.c>
<Files ~ (\.php$)>
SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .php
Options +ExecCGI
</Files>
</IfModule>

Options -Includes +ExecCGI

</Directory>

<Directory "/var/www/vhosts/system/domain.co.uk/statistics">
AuthType Basic
AuthName "Domain statistics"
AuthUserFile "/var/www/vhosts/system/domain.co.uk/pd/d..httpdocs@plesk-stat"
require valid-user
</Directory>

Alias /error_docs /var/www/vhosts/domain.co.uk/error_docs
ErrorDocument 400 /error_docs/bad_request.html
ErrorDocument 401 /error_docs/unauthorized.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /error_docs/not_found.html
ErrorDocument 500 /error_docs/internal_server_error.html
ErrorDocument 405 /error_docs/method_not_allowed.html
ErrorDocument 406 /error_docs/not_acceptable.html
ErrorDocument 407 /error_docs/proxy_authentication_required.html
ErrorDocument 412 /error_docs/precondition_failed.html
ErrorDocument 414 /error_docs/request_uri_too_long.html
ErrorDocument 415 /error_docs/unsupported_media_type.html
ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
ErrorDocument 503 /error_docs/maintenance.html

<IfModule mod_security2.c>
</IfModule>

</VirtualHost>

最佳答案

回应评论:

$ sudo chown -R apache:root /path/to/website
$ sudo find /path/to/website -type f -exec chmod 644 {} \;
$ sudo find /path/to/website -type d -exec chmod 755 {} \;

这将在您的网站根目录中递归地更改(更改所有者)到 apache:root(您可以更改为您的服务器用户)。然后它找到所有文件(-type f)并执行 chmod 644 并找到目录(-type d)并执行 chmod 755 - 希望这有帮助:)

关于linux - 为什么我在浏览器中出现禁止错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49629018/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com