Apache 2.4

时间:2019-06-24 01:00:33

标签: apache2.4 server-side-includes

将Apache从2.2升级到2.4,现在我的服务器端无法正常工作。索引页为空白,查看源显示服务器端包含。

我已经按照apache的说明从2.2升级到2.4,其中包括将任何选项更改为包括+或-的内容。我已启用LogLevel调试,并且没有记录与此问题无关的任何内容。包含和cgid模块正在加载。配置检查没有问题。没有需要担心的.htaccess文件。我具有配置的每个虚拟主机站点都显示空白页面,或者要我下载ssi指向的脚本。我正在docker环境中运行所有这些操作。

该站点正在运行cgi-bin,所有脚本均在perl中完成。该服务器正在运行多个站点,已附加一个虚拟主机。

这里是已加载的模块。

apachectl -M | sort
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 apreq_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_svn_module (shared)
 authz_user_module (shared)
 cgid_module (shared)
 core_module (static)
 dav_module (shared)
 dav_svn_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 headers_module (shared)
 http_module (static)
 include_module (shared)
 log_config_module (static)
 logio_module (static)
 mime_module (shared)
 mpm_event_module (shared)
 negotiation_module (shared)
 perl_module (shared)
 proxy_http_module (shared)
 proxy_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 so_module (static)
 socache_shmcb_module (shared)
 ssl_module (shared)
 status_module (shared)
 unixd_module (static)
 version_module (static)
 watchdog_module (static)
Loaded Modules:

apache2ctl -t 语法确定

apache2.conf启用的功能。

ServerRoot "/etc/apache2"
PidFile ${APACHE_PID_FILE}
Timeout 60
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
<IfModule mpm_worker_module>
    StartServers         60
    ServerLimit          60
    ThreadLimit          64
    MaxSpareThreads      500
    ThreadsPerChild      64
    MaxConnectionsPerChild   0
    MaxClients           3840
</IfModule>
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
AccessFileName .htaccess
<Files ~ "^\.ht">
  Require all denied
</Files>
DefaultType none
HostnameLookups Off
ErrorLog /var/log/apache2/error.log
LogLevel debug
IncludeOptional /etc/apache2/mods-enabled/*.load
IncludeOptional /etc/apache2/mods-enabled/*.conf
Include /etc/apache2/ports.conf
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
IncludeOptional /etc/apache2/conf-enabled/*.conf
IncludeOptional /etc/apache2/sites-enabled/*.conf

启用了mods的目录

lrwxrwxrwx 1 root root 36 Jun 11 23:56 access_compat.load -> ../mods-available/access_compat.load
lrwxrwxrwx 1 root root 30 Jun 16 23:59 actions.conf -> ../mods-available/actions.conf
lrwxrwxrwx 1 root root 30 Jun 16 23:59 actions.load -> ../mods-available/actions.load
lrwxrwxrwx 1 root root 28 Jun 11 23:56 alias.conf -> ../mods-available/alias.conf
lrwxrwxrwx 1 root root 28 Jun 11 23:56 alias.load -> ../mods-available/alias.load
lrwxrwxrwx 1 root root 29 Jun 11 23:56 apreq2.load -> ../mods-available/apreq2.load
lrwxrwxrwx 1 root root 33 Jun 11 23:56 auth_basic.load -> ../mods-available/auth_basic.load
lrwxrwxrwx 1 root root 33 Jun 11 23:56 authn_core.load -> ../mods-available/authn_core.load
lrwxrwxrwx 1 root root 33 Jun 11 23:56 authn_file.load -> ../mods-available/authn_file.load
lrwxrwxrwx 1 root root 33 Jun 11 23:56 authz_core.load -> ../mods-available/authz_core.load
lrwxrwxrwx 1 root root 33 Jun 11 23:56 authz_host.load -> ../mods-available/authz_host.load
lrwxrwxrwx 1 root root 32 Jun 11 23:56 authz_svn.load -> ../mods-available/authz_svn.load
lrwxrwxrwx 1 root root 33 Jun 11 23:56 authz_user.load -> ../mods-available/authz_user.load
lrwxrwxrwx 1 root root 27 Jun 16 23:59 cgid.conf -> ../mods-available/cgid.conf
lrwxrwxrwx 1 root root 27 Jun 16 23:59 cgid.load -> ../mods-available/cgid.load
lrwxrwxrwx 1 root root 26 Jun 11 23:56 dav.load -> ../mods-available/dav.load
lrwxrwxrwx 1 root root 30 Jun 11 23:56 dav_svn.conf -> ../mods-available/dav_svn.conf
lrwxrwxrwx 1 root root 30 Jun 11 23:56 dav_svn.load -> ../mods-available/dav_svn.load
lrwxrwxrwx 1 root root 30 Jun 11 23:56 deflate.conf -> ../mods-available/deflate.conf
lrwxrwxrwx 1 root root 30 Jun 11 23:56 deflate.load -> ../mods-available/deflate.load
lrwxrwxrwx 1 root root 26 Jun 11 23:56 dir.conf -> ../mods-available/dir.conf
lrwxrwxrwx 1 root root 26 Jun 11 23:56 dir.load -> ../mods-available/dir.load
lrwxrwxrwx 1 root root 26 Jun 11 23:56 env.load -> ../mods-available/env.load
lrwxrwxrwx 1 root root 29 Jun 11 23:56 filter.load -> ../mods-available/filter.load
lrwxrwxrwx 1 root root 30 Jun 16 23:59 headers.load -> ../mods-available/headers.load
lrwxrwxrwx 1 root root 30 Jun 16 23:59 include.load -> ../mods-available/include.load
lrwxrwxrwx 1 root root 27 Jun 11 23:56 mime.conf -> ../mods-available/mime.conf
lrwxrwxrwx 1 root root 27 Jun 11 23:56 mime.load -> ../mods-available/mime.load
lrwxrwxrwx 1 root root 32 Jun 11 23:56 mpm_event.conf -> ../mods-available/mpm_event.conf
lrwxrwxrwx 1 root root 32 Jun 11 23:56 mpm_event.load -> ../mods-available/mpm_event.load
lrwxrwxrwx 1 root root 34 Jun 11 23:56 negotiation.conf -> ../mods-available/negotiation.conf
lrwxrwxrwx 1 root root 34 Jun 11 23:56 negotiation.load -> ../mods-available/negotiation.load
lrwxrwxrwx 1 root root 27 Jun 23 22:04 perl.load -> ../mods-available/perl.load
lrwxrwxrwx 1 root root 28 Jun 16 23:59 proxy.conf -> ../mods-available/proxy.conf
lrwxrwxrwx 1 root root 28 Jun 16 23:59 proxy.load -> ../mods-available/proxy.load
lrwxrwxrwx 1 root root 33 Jun 16 23:59 proxy_http.load -> ../mods-available/proxy_http.load
lrwxrwxrwx 1 root root 33 Jun 11 23:56 reqtimeout.conf -> ../mods-available/reqtimeout.conf
lrwxrwxrwx 1 root root 33 Jun 11 23:56 reqtimeout.load -> ../mods-available/reqtimeout.load
lrwxrwxrwx 1 root root 30 Jun 16 23:59 rewrite.load -> ../mods-available/rewrite.load
lrwxrwxrwx 1 root root 31 Jun 11 23:56 setenvif.conf -> ../mods-available/setenvif.conf
lrwxrwxrwx 1 root root 31 Jun 11 23:56 setenvif.load -> ../mods-available/setenvif.load
lrwxrwxrwx 1 root root 36 Jun 16 23:59 socache_shmcb.load -> ../mods-available/socache_shmcb.load
lrwxrwxrwx 1 root root 26 Jun 16 23:59 ssl.conf -> ../mods-available/ssl.conf
lrwxrwxrwx 1 root root 26 Jun 16 23:59 ssl.load -> ../mods-available/ssl.load
lrwxrwxrwx 1 root root 29 Jun 11 23:56 status.conf -> ../mods-available/status.conf
lrwxrwxrwx 1 root root 29 Jun 11 23:56 status.load -> ../mods-available/status.load

这是我的登录服务的网站虚拟主机文件之一。

<VirtualHost *:8080>
        ServerAdmin webmaster@localhost
        DocumentRoot /export/static/sec
        ServerName localhost.secure.domain.com
        ErrorLog "|/usr/bin/rotatelogs /var/log/apache2/sec_error_log 86400"
        CustomLog "|/usr/bin/rotatelogs /var/log/apache2/sec_access_log 86400" combined
        ErrorDocument 404 /cgi-bin/404.pl
        <IfModule mod_rewrite.c>
                RewriteEngine On
                LogLevel debug
                RewriteMap server rnd:/etc/apache2/map.txt
                RewriteRule /login.html /cgi-bin/login.pl
                RewriteRule /user.html /cgi-bin/login.pl
                RewriteRule /logout.html /cgi-bin/login.pl
                RewriteRule /upgrade.html /cgi-bin/openid.pl
                RewriteRule /signup.html /cgi-bin/signup.pl
                RewriteRule /process.html /cgi-bin/process.pl
                RewriteRule /auth-verify/(.*)$ /cgi-bin/auth-verify.pl/$1
                RewriteRule /auth-lost/(.*)$ /cgi-bin/auth-lost.pl/$1
                RewriteRule /auth-prevent/(.*)$ /cgi-bin/auth-prevent.pl/$1
                RewriteRule /auth-change/(.*)$ /cgi-bin/auth-change.pl/$1
                RewriteRule ^/cgi-bin/(.*)$ proxy:http://server4:8080/cgi-bin/$1
                RewriteRule /api/premium proxy:http://server4:8080%{REQUEST_URI}
        </IfModule>
        <Directory "/export/static/sec">
                AllowOverride None
                Options +Includes +ExecCGI +MultiViews +SymLinksIfOwnerMatch
                Require all granted
                AddHandler cgi-script .cgi .pl
        </Directory>

</VirtualHost>

这是httpd.conf

Alias /shared/ "/export/static/common/shared/"
<Directory /export/static>
  Options +Indexes +Includes +ExecCGI +FollowSymLinks -MultiViews
  AllowOverride None
  Require all granted
  AddType text/html .shtml
  AddOutputFilter INCLUDES .xml
  AddOutputFilter INCLUDES .shtml
  AddOutputFilter INCLUDES .html
  AddOutputFilter INCLUDES .htm
</Directory>

我确定我在尝试升级设置的地方弄乱了配置。也许有人可以指出我在这里做错了。

0 个答案:

没有答案