我不是 Apache 方面的大专家,但我面临着一个特定的问题。我有 2 台服务器,其中第一台运行 Debian 7.9 和 Apache/2.2.22,另一台服务器运行 Debian Apache/2.4.10。在两台服务器中都安装了相同的 Apache 配置和相同的 dsc-statistics-presenter。会议下方
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted
# Order allow,deny
# allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
# Order allow,deny
# Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:8080>
ServerAdmin webmaster@localhost
DocumentRoot /opt/observium/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /opt/observium/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
# Order allow,deny
# allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerSignature On
</VirtualHost>
现在,在服务器上使用 Apache/2.2.22 我可以看到 grpahs(通过链接 localhost/cgi-bin/dsc-statistics/dsc-grapher)。在服务器上使用 Apache/2.4.10 ,如果我使用该链接,我可以看到文件的内容
#!/usr/bin/perl -w
use strict;
use warnings;
use CGI;
use DSC::grapher;
my $grapher = DSC::grapher->new;
$grapher->cgi(new CGI);
$grapher->run();
不确定是 Apache 问题还是某些 PERL 库问题。有什么线索吗?
答案1
在终端中输入此内容
sudo apt-get install libapache2-mod-perl2
,
然后:sudo a2enmod cgi
并重新启动apache。
答案2
通过更改配置修复;)
foreach my $u (qw(years weeks days hours minutes))