-4

I was given a server to create a test site for our services, this is the first time I been trying to do this so I did a lot of research, finally I found this page which gave great directions, but even after trying all this I can't load my simple index.php page, all I get is a timeout error page

I tried to run a debug but all I get is the following warning

httpd -X
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
(13)Permission denied: AH00058: Error retrieving pid file /run/httpd/httpd.pid
AH00059: Remove it before continuing if it is corrupted.

From all I read this is a warning. I change the permissions to the files in the /var/www folder so users can read and execute. Is there another way to run debug and find out why my sample page http://www.example.com/index.php does not load.

I am certain the problem is with my set up with the server, and I am desperate enough to post.


Here is an update on my httpd version

[@localhost html]$ httpd -v
Server version: Apache/2.4.6 (Red Hat Enterprise Linux)
Server built:   Sep 17 2015 09:06:30

[@localhost /]$ sudo systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2016-03-10 08:47:25 EST; 18min ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 5049 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 5047 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=0/SUCCESS)
 Main PID: 5047 (code=exited, status=0/SUCCESS)

Mar 10 08:47:25 www.example.com systemd[1]: Starting The Apache HTTP Server...
Mar 10 08:47:25 www.example.com httpd[5047]: httpd (pid 4920) already running
Mar 10 08:47:25 www.example.com kill[5049]: kill: cannot find process ""
Mar 10 08:47:25 www.example.com systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 10 08:47:25 www.example.com systemd[1]: Failed to start The Apache HTTP Server.
Mar 10 08:47:25 www.example.com systemd[1]: Unit httpd.service entered failed state.
Mar 10 08:47:25 www.example.com systemd[1]: httpd.service failed.
Mar 10 08:48:27 www.example.com systemd[1]: Stopped The Apache HTTP Server.

And this is the log file

[Thu Mar 10 08:34:05.040127 2016] [mpm_prefork:notice] [pid 4021] AH00169: caught SIGTERM, shutting down
[Thu Mar 10 08:34:08.720785 2016] [core:notice] [pid 4864] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Mar 10 08:34:08.721566 2016] [suexec:notice] [pid 4864] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Mar 10 08:34:08.742757 2016] [auth_digest:notice] [pid 4864] AH01757: generating secret for digest authentication ...
[Thu Mar 10 08:34:08.743567 2016] [lbmethod_heartbeat:notice] [pid 4864] AH02282: No slotmem from mod_heartmonitor
[Thu Mar 10 08:34:08.762688 2016] [mpm_prefork:notice] [pid 4864] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.4.16 configured -- resuming normal operations
[Thu Mar 10 08:34:08.762712 2016] [core:notice] [pid 4864] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Mar 10 08:42:02.335809 2016] [mpm_prefork:notice] [pid 4864] AH00170: caught SIGWINCH, shutting down gracefully
[Thu Mar 10 08:43:21.804591 2016] [core:notice] [pid 4919] SELinux policy enabled; httpd running as context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[Thu Mar 10 08:43:21.805328 2016] [suexec:notice] [pid 4919] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Mar 10 08:43:21.827883 2016] [auth_digest:notice] [pid 4920] AH01757: generating secret for digest authentication ...
[Thu Mar 10 08:43:21.828964 2016] [lbmethod_heartbeat:notice] [pid 4920] AH02282: No slotmem from mod_heartmonitor
[Thu Mar 10 08:43:21.849008 2016] [mpm_prefork:notice] [pid 4920] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.4.16 configured -- resuming normal operations
[Thu Mar 10 08:43:21.849036 2016] [core:notice] [pid 4920] AH00094: Command line: 'httpd'
Tavo
  • 1
  • 4
  • 1
    Exactly what are you running, and how did you install and set it up? Just linking to a tutorial doesn't tell us what you _actually_ did, nor what your environment is. – Michael Hampton Mar 09 '16 at 21:31
  • You need to run httpd with root privileges. – user9517 Mar 09 '16 at 21:32
  • `$ sudo apachectl start` and restart. http://stackoverflow.com/questions/27862664/13permission-denied-error-retrieving-pid-file-run-httpd-pid – pbu Mar 09 '16 at 21:34
  • Is there a file /run/httpd/httpd.pid? If so, it could be as simple as the Apache service already running. Stop the service and you may be able to run your debugging command. – DarkMoon Mar 09 '16 at 23:17
  • @MichaelHampton -- What do you mean when you ask what are you running? Iain -- I do run httpd with privileges using sudo. – Tavo Mar 10 '16 at 13:28

1 Answers1

0

After further research I figured out that my set up was correct, it was the firewall. Thanks for all the help!. For further information please check this page

https://linuxconfig.org/how-to-stop-start-and-disable-enable-firewall-on-redhat-7-linux-system

Tavo
  • 1
  • 4