Apache 2.4.1配置

Apache 2.4.1配置,apache,Apache,我面临着一个独特的问题。我已经安装了Apache 2.4.1,下面是我的配置: ServerRoot "prakash_prasad/bin" AddHandler cgi-script .py ScriptAlias /~prakash_prasad/ "/x/home/prakash_prasad/public_html/" ScriptAlias /test/ "/x/test/prakash_prasad/public_html/" DocumentRoot "/mybox/prakas

我面临着一个独特的问题。我已经安装了Apache 2.4.1,下面是我的配置:

ServerRoot "prakash_prasad/bin"
AddHandler cgi-script .py
ScriptAlias /~prakash_prasad/ "/x/home/prakash_prasad/public_html/"
ScriptAlias /test/ "/x/test/prakash_prasad/public_html/"
DocumentRoot "/mybox/prakash_prasad/bin/htdocs"
<Directory "/x/test/*/public_html/">
    Options +ExecCGI
    Options ExecCGI
    Order allow,deny
    Allow from all
    Options All
    SetHandler cgi-script
    AddHandler cgi-script .py
    AllowOverride None
    Require all granted
    AddHandler cgi-script .py
    SetHandler cgi-script
    AllowOverride None
    Require all granted
    Options ExecCGI
    Order allow,deny
    Allow from all
    Options All
    SetHandler cgi-script
    AddHandler cgi-script .py
    AllowOverride None
    Require all granted
</Directory>

<Directory "/x/home/prakash_prasad/public_html/*">
    Options +ExecCGI
    Options ExecCGI
    Order allow,deny
    Allow from all
    Options All
    SetHandler cgi-script
    AddHandler cgi-script .py
    AllowOverride None
    Require all granted
    AddHandler cgi-script .py
    SetHandler cgi-script
    AllowOverride None
    Require all granted
</Directory>
请让我知道我需要更正什么配置

::更新::

我缩小了范围,但不确定问题可能是:

当我发表评论时,cgid模块为我解决了这个问题:

# LoadModule cgid_module modules/mod_cgid.so
我的HTML页面很好,但不是我的Python脚本

当我取消注释时

LoadModule cgid_module modules/mod_cgid.so
我的脚本工作正常,但HTML文件给出了错误


知道问题是什么吗?

请尝试删除配置中的重复指令,因为这些指令可能会导致问题,例如第一个目录:

<Directory "/x/test/*/public_html/">
    Options +ExecCGI
    Options ExecCGI
    Order allow,deny
    Allow from all
    Options All
    SetHandler cgi-script
    AddHandler cgi-script .py
    AllowOverride None
    Require all granted
</Directory>

选项+执行CGI
选项执行CGI
命令允许,拒绝
通融
选项全部
SetHandler cgi脚本
AddHandler cgi脚本.py
不允许超限
要求所有授权
带有“Options+ExecCGI”指令的Web服务器将把公共html下的所有文件视为可执行文件。因此,您必须将您的opython文件放在一个单独的目录中

ScriptAlias/pyfiles//home/x/public\u html/pyfiles/


然后把你的htmls
/home/x/public\u html/

我累了,但是我发现了一个问题,我缩小到了一个点,但不确定问题可能是:当我注释cgid模块#LoadModule cgid(加载模块cgid)模块/mod(模块/mod)cgid时,我的html页面很好,但我的Python脚本不好,我取消注释了LoadModule cgid(模块)模块(模块)模块脚本工作正常,但HTML文件给出错误。你知道会是什么问题吗?
<Directory "/x/test/*/public_html/">
    Options +ExecCGI
    Options ExecCGI
    Order allow,deny
    Allow from all
    Options All
    SetHandler cgi-script
    AddHandler cgi-script .py
    AllowOverride None
    Require all granted
</Directory>