因此,這讓我感到困惑。我想在/etc/httpd.conf和/etc/httpd.conf.pre-update之間進行區分,並修正默認的LoadModules和包括升級應用的內容,但是我有很多vhosts不能很好地播放。所有的人都精在升級之前和沿的線條失敗:埃爾卡皮坦升級和Apache VHost問題
http://localhost (DocumentRoot /www works fine)
http://test (DocumentRoot /www/test serves "It works!" from the standard DocumentRoot and nothing shows in /var/log/apache2/access_log)
http://test/index.php (works)
http://localhost/test (works)
httpd.conf中提取
DocumentRoot "/www"
<Directory "/www">
Options FollowSymLinks Multiviews
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
的httpd-vhosts.conf提取
<VirtualHost *:80>
DocumentRoot "/www/test"
ServerName test
</VirtualHost>
的servername是在設定/ etc/hosts並且ping正確,並且在顯式指定文件時工作,所以這看起來不錯。也嘗試與test.local(和測試ServerAlias)沒有任何區別。
的DirectoryIndex已經被設置爲其中沒有什麼區別,並作爲http://localhost/test「正常供應的index.php,這看起來應該是「的index.php index.html的」。
當http://test被訪問,它從/Library/WebServer/Documents/index.html.en返回標準的「It works!」文件,該目錄僅從/etc/apache2/original/httpd.conf和/ etc/apache2/extra/httpd-ssl引用的.conf。
的httpd -V顯示正確的conf在使用
Server version: Apache/2.4.16 (Unix)
Server built: Aug 22 2015 16:51:57
Server's Module Magic Number: 20120211:47
Server loaded: APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_FLOCK_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/usr"
-D SUEXEC_BIN="/usr/bin/suexec"
-D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"
的httpd -S顯示的網站加載正確
VirtualHost configuration:
*:80 is a NameVirtualHost
default server localhost (/private/etc/apache2/extra/httpd-vhosts.conf:24)
port 80 namevhost localhost (/private/etc/apache2/extra/httpd-vhosts.conf:24)
port 80 namevhost phpmyadmin (/private/etc/apache2/extra/httpd-vhosts.conf:29)
port 80 namevhost site1.local (/private/etc/apache2/extra/httpd-vhosts.conf:34)
port 80 namevhost ideas.local (/private/etc/apache2/extra/httpd-vhosts.conf:39)
port 80 namevhost site2.local (/private/etc/apache2/extra/httpd-vhosts.conf:44)
port 80 namevhost site3.local (/private/etc/apache2/extra/httpd-vhosts.conf:49)
port 80 namevhost site4 (/private/etc/apache2/extra/httpd-vhosts.conf:54)
port 80 namevhost site5 (/private/etc/apache2/extra/httpd-vhosts.conf:59)
port 80 namevhost site6 (/private/etc/apache2/extra/httpd-vhosts.conf:64)
port 80 namevhost site7 (/private/etc/apache2/extra/httpd-vhosts.conf:69)
port 80 namevhost site8 (/private/etc/apache2/extra/httpd-vhosts.conf:74)
port 80 namevhost test (/private/etc/apache2/extra/httpd-vhosts.conf:79)
ServerRoot: "/usr"
Main DocumentRoot: "/www"
Main ErrorLog: "/private/var/log/apache2/error_log"
Mutex default: dir="/private/var/run/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex proxy: using_defaults
PidFile: "/private/var/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="_www" id=70 not_used
Group: name="_www" id=70 not_used
的*。本地網站加載正確的,雖然他們的DocumentRoots像:
/www/site1/public
我一直在看它這麼久,我我錯過了一些非常明顯的不是我。請把我從痛苦中解救出來。
謝謝。
我面對類似的東西以及。我的主機根本不工作。 –
stackoverflow.com/questions/42398591/apache-virtual-hosts-suddenly-broken-mac-os-x-el-capitan –