[Solved]Apache HTTP Web server refuses to start

Issues related to configuring your network
Post Reply
kix
Posts: 23
Joined: 2018/06/10 22:56:42

[Solved]Apache HTTP Web server refuses to start

Post by kix » 2018/09/02 00:23:00

Executing, systemctl start httpd, yielded:

Code: Select all

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
I executed, systemctl status httpd:

Code: Select all

The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2018-09-01 16:46:14 EDT; 2h 35min ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 1353 (code=exited, status=1/FAILURE)

Sep 01 16:46:14 mypc.server.home systemd[1]: Starting The Apache HTTP Server...
Sep 01 16:46:14 mypc.server.home systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Sep 01 16:46:14 mypc.server.home kill[1494]: kill: cannot find process ""
Sep 01 16:46:14 mypc.server.home systemd[1]: httpd.service: control process exited, code=exited status=1
Sep 01 16:46:14 mypc.server.home systemd[1]: Failed to start The Apache HTTP Server.
Sep 01 16:46:14 mypc.server.home systemd[1]: Unit httpd.service entered failed state.
Sep 01 16:46:14 mypc.server.home systemd[1]: httpd.service failed.
Results of: journalctl -xe

Code: Select all

-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit user-0.slice has begun shutting down.
Sep 01 19:38:57 mypc.server.home polkitd[885]: Registered Authentication Agent for unix-process:9132:1037793 (system bus name :1.252 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedeskto
Sep 01 19:38:57 mypc.server.home systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has begun starting up.
Sep 01 19:38:57 mypc.server.home systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Sep 01 19:38:57 mypc.server.home kill[9145]: kill: cannot find process ""
Sep 01 19:38:57 mypc.server.home systemd[1]: httpd.service: control process exited, code=exited status=1
Sep 01 19:38:57 mypc.server.home systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Sep 01 19:38:57 mypc.server.home systemd[1]: Unit httpd.service entered failed state.
Sep 01 19:38:57 mypc.server.home systemd[1]: httpd.service failed.
Sep 01 19:38:57 mypc.server.home polkitd[885]: Unregistered Authentication Agent for unix-process:9132:1037793 (system bus name :1.252, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_U
Sep 01 19:40:01 mypc.server.home systemd[1]: Created slice User Slice of root.
-- Subject: Unit user-0.slice has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit user-0.slice has finished starting up.
--
-- The start-up result is done.
Sep 01 19:40:01 mypc.server.home systemd[1]: Starting User Slice of root.
-- Subject: Unit user-0.slice has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit user-0.slice has begun starting up.
Sep 01 19:40:01 mypc.server.home systemd[1]: Started Session 30 of user root.
-- Subject: Unit session-30.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-30.scope has finished starting up.
--
-- The start-up result is done.
Sep 01 19:40:01 mypc.server.home systemd[1]: Starting Session 30 of user root.
-- Subject: Unit session-30.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-30.scope has begun starting up.
Sep 01 19:40:01 mypc.server.home CROND[9166]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Sep 01 19:40:01 mypc.server.home systemd[1]: Removed slice User Slice of root.
-- Subject: Unit user-0.slice has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit user-0.slice has finished shutting down.
Sep 01 19:40:01 mypc.server.home systemd[1]: Stopping User Slice of root.
-- Subject: Unit user-0.slice has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit user-0.slice has begun shutting down.
In the case of, journalctl -xe, the following seem to be noteworthy:

Code: Select all

Sep 01 19:38:57 mypc.server.home kill[9145]: kill: cannot find process ""

Unregistered Authentication Agent for unix-process:9132:1037793 (system bus name :1.252, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_U
Eventually I'd like to access 127.0.0.1 on a web browser, and access the "custom"/local RPM through there.

This is the result of, iptables -L

Code: Select all

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:bootps
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere
INPUT_direct  all  --  anywhere             anywhere
INPUT_ZONES_SOURCE  all  --  anywhere             anywhere
INPUT_ZONES  all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere             ctstate INVALID
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             192.168.122.0/24     ctstate RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere
FORWARD_direct  all  --  anywhere             anywhere
FORWARD_IN_ZONES_SOURCE  all  --  anywhere             anywhere
FORWARD_IN_ZONES  all  --  anywhere             anywhere
FORWARD_OUT_ZONES_SOURCE  all  --  anywhere             anywhere
FORWARD_OUT_ZONES  all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere             ctstate INVALID
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootpc
OUTPUT_direct  all  --  anywhere             anywhere

Chain FORWARD_IN_ZONES (1 references)
target     prot opt source               destination
FWDI_public  all  --  anywhere             anywhere            [goto]
FWDI_public  all  --  anywhere             anywhere            [goto]

Chain FORWARD_IN_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain FORWARD_OUT_ZONES (1 references)
target     prot opt source               destination
FWDO_public  all  --  anywhere             anywhere            [goto]
FWDO_public  all  --  anywhere             anywhere            [goto]

Chain FORWARD_OUT_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain FORWARD_direct (1 references)
target     prot opt source               destination

Chain FWDI_public (2 references)
target     prot opt source               destination
FWDI_public_log  all  --  anywhere             anywhere
FWDI_public_deny  all  --  anywhere             anywhere
FWDI_public_allow  all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere

Chain FWDI_public_allow (1 references)
target     prot opt source               destination

Chain FWDI_public_deny (1 references)
target     prot opt source               destination

Chain FWDI_public_log (1 references)
target     prot opt source               destination

Chain FWDO_public (2 references)
target     prot opt source               destination
FWDO_public_log  all  --  anywhere             anywhere
FWDO_public_deny  all  --  anywhere             anywhere
FWDO_public_allow  all  --  anywhere             anywhere

Chain FWDO_public_allow (1 references)
target     prot opt source               destination

Chain FWDO_public_deny (1 references)
target     prot opt source               destination

Chain FWDO_public_log (1 references)
target     prot opt source               destination

Chain INPUT_ZONES (1 references)
target     prot opt source               destination
IN_public  all  --  anywhere             anywhere            [goto]
IN_public  all  --  anywhere             anywhere            [goto]

Chain INPUT_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain INPUT_direct (1 references)
target     prot opt source               destination

Chain IN_public (2 references)
target     prot opt source               destination
IN_public_log  all  --  anywhere             anywhere
IN_public_deny  all  --  anywhere             anywhere
IN_public_allow  all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere

Chain IN_public_allow (1 references)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh ctstate NEW
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ms-wbt-server ctstate NEW
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ldap ctstate NEW
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ldaps ctstate NEW
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:9830 ctstate NEW

Chain IN_public_deny (1 references)
target     prot opt source               destination

Chain IN_public_log (1 references)
target     prot opt source               destination

Chain OUTPUT_direct (1 references)
target     prot opt source               destination

Last edited by kix on 2018/09/05 00:42:24, edited 1 time in total.
Centos 7 w/Gnome | Lenovo Thinkpad X201 ─ i7@2.6GHz, 4GB DDR3, 270 MB/s SSD

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Apache HTTP Web server refuses to start

Post by avij » 2018/09/02 06:06:16

Try apachectl configtest

kix
Posts: 23
Joined: 2018/06/10 22:56:42

Re: Apache HTTP Web server refuses to start

Post by kix » 2018/09/03 21:59:35

avij wrote:
2018/09/02 06:06:16
Try apachectl configtest
Thank you for responding. Syntax ok was displayed.

I ran systemctl start httpd again, got through authentication and the refusal came up

Code: Select all

[kix@kixserver ~]$ systemctl start httpd
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Multiple identities can be used for authentication:
 1.  kix
 2.  usr01
 3.  lori
Choose identity to authenticate as (1-3): 1
Password:
==== AUTHENTICATION COMPLETE ===
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[kix@kixserver ~]$
Result of: ps aux|grep httpd

Code: Select all

root      8866  0.0  0.0 112704   968 pts/0    S+   18:45   0:00 grep --color=auto httpd

Result of netstat -npl | grep 80

Code: Select all

unix  2      [ ACC ]     STREAM     LISTENING     20980    1/systemd            /run/dbus/system_bus_socket
Log/httpd displays:

Code: Select all

" ============================================================================
" Netrw Directory Listing                                        (netrw v149)
"   /var/log/httpd
"   Sorted by      name
"   Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec
" ============================================================================
../
./
access_log
error_log
.swp
Centos 7 w/Gnome | Lenovo Thinkpad X201 ─ i7@2.6GHz, 4GB DDR3, 270 MB/s SSD

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: Apache HTTP Web server refuses to start

Post by pjsr2 » 2018/09/04 19:46:13

[kix@kixserver ~]$ systemctl start httpd
Looks like you are not starting the service with root privileges. Use:

Code: Select all

sudo systemctl start httpd

kix
Posts: 23
Joined: 2018/06/10 22:56:42

Re: Apache HTTP Web server refuses to start

Post by kix » 2018/09/04 23:14:55

Thank you for the helpful response.

I followed the directions here:
How To Set Up Apache Virtual Hosts on CentOS 7

and Here
How To Set Up Apache Virtual Hosts on Arch Linux

Realizing the latter wasn't about Centos, I transitioned on the 1st link.

Before performing these steps I uninstalled Centos and did a full system update.

I successfully executed the following, systemctl start httpd

From there I executed, apachectl configtest, and got errors stating the following, directories, did not exist
i.e.: /var/www/html/example.com/public_html/, and, /var/www/html/example.com/logs/

Code: Select all

AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf.d/vhost.conf:1
AH00112: Warning: DocumentRoot [/var/www/html/example.com/public_html/] does not exist
(2)No such file or directory: AH02291: Cannot access directory '/var/www/html/example.com/logs/' for error log of vhost defined at /etc/httpd/conf.d/vhost.conf:3
AH00014: Configuration check failed
I went ahead performed, mkdir -p, on the two paths.

apachectl configtest, then displays

Code: Select all

AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf.d/vhost.conf:1
Syntax OK
I decide to go to www.example.com on my browser, and unfortunately it doesn't bring up the local html configuration, but that of the WAN or public version.

But I am able to visit 127.0.0.1 and see the Apache success test page.

Also keep in mind it's taken me days to get this far, and I recall possibly disabling the firewall completely.
Centos 7 w/Gnome | Lenovo Thinkpad X201 ─ i7@2.6GHz, 4GB DDR3, 270 MB/s SSD

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Apache HTTP Web server refuses to start

Post by TrevorH » 2018/09/04 23:27:40

You're not actually using example.com for your site? It exists and belongs to someone else.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

kix
Posts: 23
Joined: 2018/06/10 22:56:42

Re: Apache HTTP Web server refuses to start

Post by kix » 2018/09/04 23:44:01

Is there a website that recommends what attributes I should replace each statements with? The guide I linked to say nothing about where I specify my hostname/FQDN and such.

This is what I have in: /etc/httpd/sites-available/example.com.conf

Code: Select all

<VirtualHost *:80>

    ServerName www.example.com
    ServerAlias example.com
    DocumentRoot /var/www/example.com/public_html
    ErrorLog /var/www/example.com/error.log
    CustomLog /var/www/example.com/requests.log combined
</VirtualHost>
The command, hostname, display, mypc.server.home

I've even gone into the /etc/hosts file and placed example.com to my ip address, commenting out the other statement, an LDAP, using the pc's local IP address.

Code: Select all

192.168.1.174 www.example.com
Entering 192.168.1.174 directs me to the Testing 123 Apaches test success page.

Edit: After disconnecting from the internet, trying the solution here (link) without success, I decided to install chromium, and example.com virtual host is now working.
Centos 7 w/Gnome | Lenovo Thinkpad X201 ─ i7@2.6GHz, 4GB DDR3, 270 MB/s SSD

Post Reply