ispconfig PHP 无法在 apache2 虚拟主机上解析

ispconfig PHP 无法在 apache2 虚拟主机上解析

ispconfig我在 (L)Ubuntu 15.04 上安装 3 时遇到问题。我可以完全安装ispconfig,但查看虚拟主机时无法访问网站apache2。我可以打开ispconfighttps://localip:9090/但是 PHP 没有被解析/处理!

我的主机配置文件:/etc/apache2/sites-available/ispconfig.conf看起来像这样:

################################################
# ISPConfig Logfile configuration for vlogger
################################################

LogFormat "%v %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig

<Directory /var/www/clients>
    AllowOverride None
        Require all denied
    </Directory>

# Do not allow access to the root file system of the server for security reasons
<Directory />
    Options -Indexes
    AllowOverride None
        Require all denied
    </Directory>

<Directory /var/www/conf>
    AllowOverride None
        Require all denied
    </Directory>

# Except of the following directories that contain website scripts
<Directory /usr/share/phpmyadmin>
                Require all granted
        </Directory>

<Directory /usr/share/phpMyAdmin>
                Require all granted
        </Directory>

<Directory /srv/www/htdocs>
                Require all granted
        </Directory>

<Directory /usr/share/squirrelmail>
                Require all granted
        </Directory>

# Allow access to mailman on OpenSuSE
<Directory /usr/lib/mailman/cgi-bin>
                Require all granted
        </Directory>

<Directory /usr/lib/mailman/icons>
                Require all granted
        </Directory>

<Directory /var/lib/mailman/archives/>
        Options +FollowSymLinks
                Require all granted
        </Directory>

# allow path to awstats and alias for awstats icons
<Directory /usr/share/awstats>
                Require all granted
        </Directory>


NameVirtualHost *:80
NameVirtualHost *:443

第二个/etc/apache2/sites-available/ispconfig.vhost看起来像:

######################################################
# This virtual host contains the configuration
# for the ISPConfig controlpanel
######################################################

 Listen 9090
NameVirtualHost *:9090

<VirtualHost _default_:9090>
  ServerAdmin webmaster@localhost

  <FilesMatch "\.ph(p3?|tml)$">
    SetHandler None
  </FilesMatch>

  <IfModule mod_fcgid.c>
    DocumentRoot /var/www/ispconfig/
    SuexecUserGroup ispconfig ispconfig
    <Directory /var/www/ispconfig/>
      Options -Indexes +FollowSymLinks +MultiViews +ExecCGI
      AllowOverride AuthConfig Indexes Limit Options FileInfo
      <FilesMatch "\.php$">
          SetHandler fcgid-script
      </FilesMatch>
      FCGIWrapper /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter .php
          Require all granted
          </Directory>
    IPCCommTimeout  7200
    MaxRequestLen 15728640
  </IfModule>

  <IfModule mpm_itk_module>
    DocumentRoot /usr/local/ispconfig/interface/web/
    AssignUserId ispconfig ispconfig
    AddType application/x-httpd-php .php
    <Directory /usr/local/ispconfig/interface/web>
      # php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp"
      Options +FollowSymLinks
      AllowOverride None
          Require all granted
          php_value magic_quotes_gpc        0
    </Directory>
  </IfModule>

  # ErrorLog /var/log/apache2/error.log
  # CustomLog /var/log/apache2/access.log combined
  ServerSignature Off

  <IfModule mod_security2.c>
    SecRuleEngine Off
  </IfModule>

  # SSL Configuration
  SSLEngine On
  SSLProtocol All -SSLv2 -SSLv3
  SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
  SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
DocumentRoot /var/www/ispconfig
  #SSLCACertificateFile /usr/local/ispconfig/interface/ssl/ispserver.bundle

</VirtualHost>

<Directory /var/www/php-cgi-scripts>
    AllowOverride None
        Require all denied
    </Directory>

<Directory /var/www/php-fcgi-scripts>
    AllowOverride None
        Require all denied
    </Directory>

PHP 可以在其他虚拟主机上运行!问题是什么?

答案1

在您的ispconfig.vhost文件中,查看此块:

<FilesMatch "\.ph(p3?|tml)$">
  SetHandler None
</FilesMatch>

它告诉不要将任何处理程序与 php 文件关联。过了一会儿,你又得到了另一个块:

<IfModule mod_fcgid.c>
...
  <FilesMatch "\.php$">
      SetHandler fcgid-script
  </FilesMatch>
...
</IfModule>

这个块告诉我们如果模块mod_fcgid已加载然后让我们fcgid-script处理php文件。

这意味着如果你没有启用FastCGI模块,这里就没有任何东西可以管理php文件。

也许您还没有安装libapache_mod_fcgid,或者它没有启用(参见a2enmod fcgid:)

相关内容