我在一台旧的OpenBSD机器上安装了一个Web服务器,每次尝试启动Apache时都会出现错误。 在使用HTTPS添加我的虚拟主机后,服务器拒绝启动。
could not resolve host "10.0.1.120:50720" port "https" --- no address associated with name usr/sbin/apachectl start: httpd could not be started
我的虚拟主机configuration如下( /var/www/conf/vhosts/[file].conf )
Listen 10.0.1.120:50720 https <VirtualHost *:80> ServerName [url] DocumentRoot /var/www/[url]/public_html </VirtualHost> <VirtualHost 10.0.1.120:50720> ServerName [url] DocumentRoot /var/www/[url]/public_html ErrorLog /var/www/[url]/error_log TransferLog /var/www/[url]/access_log SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM SSLCertificateFile /var/www/[url]/ssl.crt SSLCertificateKeyFile /var/www/[url]/ssl.key SSLCertificateChainFile /var/www/[url]/[ca.pem] SSLCACertificateFile /var/www/[url]/ca.pem SSLCACertificateFile /var/www/[url]/ca.pem <Directory "/var/www/[url]/public_html"> AllowOverride All </Directory> </VirtualHost>
我正在使用dynamicIP地址的防火墙后面运行。
我有一个logging指向我的dynamicIP地址。
在防火墙中,端口80和50720(以及其他端口)指向通过DHCP中的MAC地址静态分配的本地IP地址(10.0.1.50720)
我使用了通配符IP地址( Listen *:50720 https ),并得到相同的错误
有没有人遇到过这个? 我没有发现这个错误消息在谷歌( apache "could not resolve host" "no address with name"等)
如果能提供帮助,我很乐意提供更多细节。
[url]是[subdomain].[subdomain].[domain].us 。 我有一个logging指向我的dynamic公共IP地址。 /etc/hosts文件,在设置虚拟主机(包括使用SSL的虚拟主机)之前,我没有必要在任何服务器上这样做。 由于您运行1.3,第一个build议是升级它。
第二个是1.3的文档仍然可用,虽然没有完全公开,因为这是一个非常过时的版本,其中有安全漏洞。 但是文档在httpd.apache.org 。
第三个 – 这里的问题是1.3不允许你像2.4那样在Listen行上声明一个模块。 所以这行应该是这样的:
Listen 10.0.1.120:50720
我也注意到,在你的configuration上面,你有一个*:80上的VirtalHost。 你需要为每个运行VH的端口设置一个Listen指令,但是也许你已经做了,而且我已经错过了。 你可能在你的configuration文件中也有一些其他的指令不能用于1.3,这就是为什么它没有启动。
最后,关于如何在OpenBSD上升级软件包的信息可以在OpenBSD FAQ中find 。