gpt4 book ai didi

apache - 如何调试apache虚拟主机配置?

转载 作者:行者123 更新时间:2023-12-03 04:29:43 24 4
gpt4 key购买 nike

我的 apache 虚拟主机配置再次出现问题。 (使用默认配置而不是我的特定配置)。

问题不在于配置错误,而在于如何解决它。

有人有好的建议可以快速解决此类问题吗?

更多信息。

默认的conf文件是这个:

NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
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
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

不适用的虚拟主机配置是这个:

<VirtualHost *:*>

ProxyPreserveHost On
ProxyPass / http://ip.ip.ip.ip:8088/
ProxyPassReverse / http://ip.ip.ip.ip:8088/
ServerName wiki.mydomain.com

</VirtualHost>

最佳答案

语法检查

检查配置文件是否有语法错误:

# Red Hat-based (Fedora, CentOS), Arch-based and OSX
httpd -t

# Debian-based (Ubuntu)
apache2ctl -t

# MacOS
apachectl -t

列出虚拟主机

列出所有虚拟主机及其位置:

# Red Hat-based (Fedora, CentOS), Arch-based and OSX
httpd -S

# Debian-based (Ubuntu)
apache2ctl -S

# MacOS
apachectl -S

关于apache - 如何调试apache虚拟主机配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5474477/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com