我正在使用Fedora版本23(二十三)和Apache / 2.4.23(Fedora)
我注意到apache 2.4在启动时默认为-DFOREGROUND:
/usr/sbin/httpd -DFOREGROUND
我不想-DFOREGROUND,对于我之前使用过的apache 2.2,它有
/usr/sbin/httpd -k start
这就是我想要的。所以我修改了httpd.service:
# ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND # default in apache 2.4
ExecStart=/usr/sbin/httpd $OPTIONS -k start # this is what I want and in the previous machine that has apache 2.2
但是在更改之后,在“systemctl daemon-reload”和“service httpd start”之后,httpd状态显示为inactive(dead):
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Mon 2017-03-06 10:18:37 CST; 1min 20s ago
Main PID: 4464 (code=exited, status=0/SUCCESS)
Status: "Total requests: 89051; Idle/Busy workers 75/25;Requests/sec: 0.279; Bytes served/sec: 4.1KB/sec"
Mar 02 17:48:19 GAFServer systemd[1]: Starting The Apache HTTP Server...
Mar 02 17:48:19 GAFServer httpd[4464]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::fe4d:d4ff:fef1:e121. Set the 'ServerName' directive globally to suppress this message
Mar 02 17:48:19 GAFServer systemd[1]: Started The Apache HTTP Server.
Mar 06 03:32:01 GAFServer httpd[23093]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::fe4d:d4ff:fef1:e121. Set the 'ServerName' directive globally to suppress this message
Mar 06 03:32:01 GAFServer systemd[1]: Reloaded The Apache HTTP Server.
Mar 06 10:18:35 GAFServer systemd[1]: Stopping The Apache HTTP Server...
Mar 06 10:18:37 GAFServer systemd[1]: Stopped The Apache HTTP Server.
我很困惑,apache文件对于什么是DFOREGROUND以及我有什么其他选项这么少,我怎么能停止使用这个DFOREGROUND?