Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 为什么我在浏览器中出现禁止的错误_Linux_Apache - Fatal编程技术网

Linux 为什么我在浏览器中出现禁止的错误

Linux 为什么我在浏览器中出现禁止的错误,linux,apache,Linux,Apache,我是apache的新用户,尝试学习并设置了一个域,用于学习和测试。但是,在我开始之前,我已经被禁止使用您没有访问此文档的权限。。经过研究,我知道这个错误与http.conf或.htaccess文件有关 我没有目录中的.htaccess文件,并且已经发布了我的http.conf文件。如果有人能帮助我克服这个问题,我将不胜感激。非常感谢 仅供参考,我已将敏感数据替换为前导零 PHP:v5.4fastcgi APACHE:APACHE/2.2.15(Unix) 下面是结果:ls-la total 46

我是apache的新用户,尝试学习并设置了一个域,用于学习和测试。但是,在我开始之前,我已经被禁止使用
您没有访问此文档的权限。
。经过研究,我知道这个错误与
http.conf
.htaccess
文件有关

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

仅供参考,我已将敏感数据替换为前导零

PHP:v5.4fastcgi APACHE: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>
总计468
dr-xr-x---5根根根4096根2014年8月10日。
dr-xr-xr-x 26根根目录4096年4月3日12:19。。
-rw-----1根根根1325根根2011年7月11日anaconda-ks.cfg
drwxr-xr-x 2根根目录4096 Jan 23 03:49.自动安装程序
-rw-----1根根根9454 Apr 3 12:18.巴什胡历史
-rw-r--r--1根根目录2009年5月20日18日。bash_注销
-rw-r--r--1根根根176 2009年5月20日。bash_配置文件
-rw-r--r--1根根根176 2004年9月23日bashrc
-rw-r--r--1根根根2014年8月5日创建
-rw-r--r--1根根根100根,2004年9月23日,cshrc
-rw-r--r--1根根目录8730 2011年7月11日install.log
-rw-r--r--1根根目录3094 2011年7月11日install.log.syslog
-rw-r--r--1根根根130324根2013年1月8日kmod-e1000e-2.1.4-1.el6.elrepo.x86_64.rpm
-rw-r--r--1根根根135820 2013年9月23日kmod-e1000e-2.5.4-1.el6.elrepo.x86_64.rpm
-rw-r--r--1根根根116252 2013年9月23日kmod-igb-5.0.5-1.el6.elrepo.x86_64.rpm
drwxr-xr-x 59根根根4096 Apr 3 03:25平行线
drwx------2根根根4096根2014年8月10日Spamasassin
-rw-r--r--1根根根129 2004年12月3日,tcshrc
#注意!
#
#不要修改此文件,因为它是自动生成的,
#因此,下次生成文件时,所有更改都将丢失。
#如果需要应用自定义修改,请在以下文件中执行这些修改:
#/var/www/vhosts/system/domain.co.uk/conf/vhosts.conf
ServerName“domain.co.uk:80”
ServerAlias“www.domain.co.uk”
ServerAlias“ipv4.domain.co.uk”
服务器管理员“pa@domain.com"
UseCononicalName关闭
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”
SuexecUserGroup“peterc”“psacln”
UserDir“/var/www/vhosts/domain.co.uk/web_users”
设置Sysenv PP_VHOST_ID“7D9A2C229-8013-470b-a6eb-36549a513f6b”
ScriptAlias“/cgi-bin/”/var/www/vhosts/domain.co.uk/httpdocs/cgi-bin/“
别名“/plesk stat”“/var/www/vhosts/system/domain.co.uk/statistics”
选项+索引
需要有效用户
别名/webstat/var/www/vhosts/system/domain.co.uk/statistics/webstat
别名/webstat-ssl/var/www/vhosts/system/domain.co.uk/statistics/webstat-ssl
别名/ftpstat/var/www/vhosts/system/domain.co.uk/statistics/ftpstat
别名/anon_ftpstat/var/www/vhosts/system/domain.co.uk/statistics/anon_ftpstat
别名/awstats图标/var/www/html/awstats/icon
斯伦金
SetEnv PP_CUSTOM_PHP_INI/var/www/vhosts/system/domain.co.uk/etc/PHP.INI
SetEnv PP_自定义_PHP_CGI_索引fastcgi
fcgidenv PP_CUSTOM_PHP_INI/var/www/vhosts/system/domain.co.uk/etc/PHP.INI
fcgidInitialeEnv PP_自定义_PHP_CGI_索引fastcgi
FcgidMaxRequestLen 134217728
SetHandler perl脚本
PerlHandler ModPerl::注册表
选项+执行CGI
通融
PerlSendHeader打开
SetHandler python程序
PythonHandler mod_python.cgihandler
SetHandler fcgid脚本
选项+执行CGI
SetHandler fcgid脚本
FCGIWrapper/var/www/cgi-bin/cgi\u-wrapper/cgi\u-wrapper.php
选项+执行CGI
选项-包括+ExecCGI
AuthType Basic
AuthName“域统计”
AuthUserFile“/var/www/vhosts/system/domain.co.uk/pd/d。。httpdocs@plesk-统计数据“
需要有效用户
别名/error\u docs/var/www/vhosts/domain.co.uk/error\u docs
ErrorDocument 400/error\u docs/bad\u request.html
ErrorDocument 401/error\u docs/unauthorized.html
ErrorDocument 403/error\u docs/probidden.html
ErrorDocument 404/error\u docs/not\u found.html
ErrorDocument 500/error\u docs/internal\u server\u error.html
ErrorDocument 405/error\u docs/method\u not\u allowed.html
ErrorDocument 406/error\u docs/not\u acceptable.html
ErrorDocument 407/error\u docs/proxy\u authentication\u required.html
ErrorDocument 412/error\u docs/premission\u failed.html
ErrorDocument 414/error\u docs/request\u uri\u too\u long.html
ErrorDocument 415/error_docs/unsupported_media_type.html
ErrorDocument 501/error\u docs/not\u implemented.html
ErrorDocument 502/error\u docs/bad\u gateway.html
ErrorDocument 503/error\u docs/maintenance.html

回应评论:

$ 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 {} \;

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

在项目根目录上运行
ls-la
,并使用输出编辑问题:)我还发现,如果没有
index.php
(或.html),可能会出现此错误文件是found@ThisGuyHasTwoThumbs有index.php和index.html i驱动器。Thanks@ThisGuyHasTwoThumbs我已经发布了结果。谢谢您不应该将root:root作为您的权限