我有一个带有 linux/debian 的 apache2 服务器。Debian 4.9.110-3+deb9u1
我在同一目录中有一个index.cgi
和webadmin.cgi
。目录是/var/www/html/renacimientos.be/www/cgibin/
.
index.cgi
是一个用于测试的小 cgi。有用。当我尝试运行webadmin.cgi
时,它返回错误 403。
/etc/apache2/conf-available/renacimientos-cgi-bin.conf
LoadModule cgid_module modules/mod_cgid.so
<IfModule mod_alias.c>
<IfModule mod_cgi.c>
Define ENABLE_USR_LIB_CGI_BIN
</IfModule>
<IfModule mod_cgid.c>
Define ENABLE_USR_LIB_CGI_BIN
</IfModule>
<IfDefine ENABLE_USR_LIB_CGI_BIN>
ScriptAlias "/cgi-bin/" "/var/www/html/renacimientos.be/www/cgibin"
<Directory "/var/www/html/renacimientos.be/www/cgibin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AddHandler cgi-script .cgi .pl
Require all granted
<Files ~ (\.cgi$)>
SetHandler cgi-script
Options ExecCGI
</Files>
</Directory>
</IfDefine>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
/etc/apache2/apache2.conf
ServerName localhost
DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/usr/lib/cgi-bin/ cgibin/"
</IfModule>
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI
SetHandler cgi-script
Require all granted
</Directory>
LogLevel warn
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf