我不是 Apache 专家,所以我希望有人可以向我解释为什么在启用强制 SSL 连接时,我无法访问 Dokuwiki 应用程序/子文件夹。
启用 FORCE SSL
https://locahost/dokuwiki/doku.php returns 404 NOT FOUND
https://locahost returns 200 OK
未启用强制 SSL
http://localhost/dokuwiki/doku.php 200 OK
http://localhost/ 200 OK
更多/etc/config/apache/extra/apache-ssl.conf
LoadModule ssl_module modules/mod_ssl.so
SSLRandomSeed startup file:/dev/urandom 512
Listen 8081
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:/usr/local/apache/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
SSLMutex "file:/usr/local/apache/logs/ssl_mutex"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
SSLRequire %{SSL_CIPHER} !~ m/^(EXP|NULL)/
</Directory>
<VirtualHost _default_:8081>
DocumentRoot "/share/Web"
ErrorLog /dev/null
TransferLog /dev/null
SSLEngine on
SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!SSLv2:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile "/etc/stunnel/stunnel.pem"
#SSLCertificateKeyFile "/etc/config/apache/server.key"
#SSLCertificateChainFile "/etc/config/apache/server-ca.crt"
#SSLCACertificatePath "/etc/config/apache/ssl.crt"
#SSLCACertificateFile "/etc/config/apache/ssl.crt/ca-bundle.crt"
#SSLCARevocationPath "/etc/config/apache/ssl.crl"
#SSLCARevocationFile "/etc/config/apache/ssl.crl/ca-bundle.crl"
#SSLVerifyClient require
#SSLVerifyDepth 10
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/usr/local/apache/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</VirtualHost>
更多/etc/config/apache/apache.conf
#ServerType standalone
ServerRoot "/usr/local/apache"
LockFile /var/lock/apache.lock
PidFile /var/lock/apache.pid
#ScoreBoardFile /usr/local/apache/logs/apache.scoreboard
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 2
MaxSpareServers 5
StartServers 2
MaxClients 10
MaxRequestsPerChild 30
LoadModule php5_module modules/libphp5.so
Listen 80
User httpdusr
Group administrators
ServerAdmin admin@NAS
#ServerName NAS
TraceEnable off
ServerTokens Prod
DocumentRoot "/share/Web"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "/share/Web">
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php
</IfModule>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
UseCanonicalName on
HostnameLookups Off
<Directory "/usr/local/apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
DefaultType text/plain
ErrorLog /dev/null
#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel crit
<IfModule log_config_module>
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
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
</IfModule>
ServerSignature On
#
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#
<IfModule alias_module>
Alias /v3_menu/ "/home/httpd/v3_menu/"
<Directory "/home/httpd/v3_menu">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</IfModule>
<IfModule autoindex_module>
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
</IfModule>
#
# Document types.
#
<IfModule mime_module>
TypesConfig /etc/config/apache/mime.types
AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .ee
AddLanguage fr .fr
AddLanguage de .de
AddLanguage el .el
AddLanguage he .he
AddCharset ISO-8859-8 .iso8859-8
AddLanguage it .it
AddLanguage ja .ja
AddCharset ISO-2022-JP .jis
AddLanguage kr .kr
AddCharset ISO-2022-KR .iso-kr
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddCharset ISO-8859-2 .iso-pl
AddLanguage pt .pt
AddLanguage pt-br .pt-br
AddLanguage ltz .lu
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .sv
AddLanguage cs .cz .cs
AddLanguage ru .ru
AddLanguage zh-TW .zh-tw
AddCharset Big5 .Big5 .big5
AddCharset WINDOWS-1251 .cp-1251
AddCharset CP866 .cp866
AddCharset ISO-8859-5 .iso-ru
AddCharset KOI8-R .koi8-r
AddCharset UCS-2 .ucs2
AddCharset UCS-4 .ucs4
AddCharset UTF-8 .utf8
<IfModule negotiation_module>
LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
</IfModule>
AddType application/x-tar .tgz
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
AddHandler cgi-script .cgi
AddType text/html .shtml
AddHandler server-parsed .shtml
AddHandler send-as-is asis
AddHandler imap-file map
AddHandler type-map var
</IfModule>
<IfModule mime_magic_module>
MIMEMagicFile /etc/config/apache/magic
</IfModule>
<IfModule setenvif_module>
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
LoadModule deflate_module modules/mod_deflate.so
<IfModule mod_deflate.c>
DeflateCompressionLevel 2
AddOutputFilterByType DEFLATE text/html text/plain text/xml
AddOutputFilter DEFLATE js css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.[0678] no-gzip
BrowserMatch \bMSIE\s7 !no-gzip !gzip-only-text/html
</IfModule>
Include /etc/config/apache/extra/apache-ssl.conf
Include /etc/config/apache/extra/httpd-vhosts-user.conf
Include /etc/config/apache/extra/httpd-ssl-vhosts-user.conf
Include /etc/config/apache/extra/apache-msv2.conf
Include /etc/config/apache/extra/apache-musicstation.conf
Include /etc/config/apache/extra/apache-photo.conf
包括 /etc/config/apache/extra/apache-video.conf
答案1
将 DocumentRoot“/share/Web”指令移至 /etc/config/apache/extra/apache-ssl.conf 文件中的部分上方。