Perl

Apache 2.4.10 頁面未顯示

  • July 15, 2016

我不是 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 庫。有什麼線索嗎?

在終端中輸入這個 sudo apt-get install libapache2-mod-perl2

然後:sudo a2enmod cgi並重新啟動apache。

通過更改配置修復;)

foreach my $u (qw(years weeks days hours minutes))

引用自:https://unix.stackexchange.com/questions/243319