debian 9 配置cgi

debian 9
apt update
apt install apache2
ln -s /etc/apache2/mods-available/cgid.conf /etc/apache2/mods-enabled/cgid.conf
ln -s /etc/apache2/mods-available/cgid.load /etc/apache2/mods-enabled/cgid.load
修改/etc/apache2/conf-available/serve-cgi-bin.conf
<IfDefine ENABLE_USR_LIB_CGI_BIN>
                ScriptAlias /cgi-bin/ /var/www/html/cgi-bin/
                <Directory "/var/www/html/cgi-bin">
                        AllowOverride None
                        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                        Require all granted
                        AddHandler cgi-script .cgi .py .sh
                </Directory>
</IfDefine>
添加/etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
ServerName t.xxx.com
DocumentRoot /var/www/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /var/www/html/cgi-bin/
<Directory "/var/www/html/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
Include /etc/apache2/conf-available/serve-cgi-bin.conf
</VirtualHost>
https://www.jianshu.com/p/10e371c4e78a
apt update
apt install apache2
sudo a2enmod cgi
perl -MCPAN -e shell
install CGI
install LWP::UserAgent
修改/var/www/html/cgi-bin/Modules/CGI.pm 496行
defined(@QUERY_PARAM)改为(@QUERY_PARAM)
service apache2 restart

发表评论

电子邮件地址不会被公开。 必填项已用*标注