更改 rc.conf 和 resov.conf 后无法启动 apache

更改 rc.conf 和 resov.conf 后无法启动 apache

我今天早上有一个工作配置,如下所示/etc/rc.conf

ifconfig_rl0="DHCP"
ifconfig_xl="inet 192.168.1.11 netmask 255.255.255."

defaultrouter="192.168.1.1"

我添加了以下几行:

firewall_enable="YES"
firewall_type="SIMPLE"
firewall_logging="YES"

sshd_enable="YES"
apache_enable="YES"
mysql_enable="YES"

我的 httpd.conf 包括:

NameVirtualHost 192.168.1.11
<VirtualHost 192.168.1.11>
...
</VirtualHost>

现在 apache 和 ssh 服务器都关闭了。将 rc.conf 改回上次工作的配置,仍然没有 ssh 或 apache

apachectl start
#--> /usr/local/sbin/apachectl start: httpd could not be started

apachectl status
#--> Looking up localhost
Making http connection to localhost
Alert!: Unable to connect to remote host.

答案1

抱歉,我问了这么多菜鸟问题。我不得不将以下内容添加到/etc/rc.conf

hostname="mydomain.com"
sshd_enable="YES"
apache_enable="YES"

造成混乱的主要原因是我在更改 conf 文件后没有重新启动。我重新启动了网络/etc/rc.d/netif restart,但某些变量仍然存在。(例如,即使我在删除hostname="mydomain.com主机名后重新启动了网络,主机名仍然存在)

相关内容