Apache (httpd) Loads, but Fails at Boot

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

Apache (httpd) Loads, but Fails at Boot

Postby steadybright » Thu Aug 29, 2013 4:27 am

Greetings!

I recently purchased a Pogoplug V2 for the purpose of maintaining a web server at my home.

Following the excellent instructions at archlinuxARM, I've successfully installed LAMP, Samba, and VSFTPD--and, somehow, it all works!

Although, I have one annoying issue that I can't sort out:

Apache (httpd) will not automatically start when the Pogoplug boots. It is set to load at boot, but for some reason it fails. Then, at the command prompt, I can start Apache by typing:

$this->bbcode_second_pass_code('', 'systemctl start httpd')

and then Apache starts without a problem and stays up. PHP and MariaDB all work, too (they DO start automatically at boot).


I'm brand new to Linux, and I've learned a few things over the last few days, but I can not work out this problem. I've even resorted to creating an rc.conf file to see if I could get Apache to load at boot, but to no avail.

I'd be happy to send whatever log files you need to review, but please be specific, since I'm still learning where a lot of these files are located.

Thank you for your help!

steady
steadybright
 
Posts: 53
Joined: Thu Aug 29, 2013 4:08 am

Re: Apache (httpd) Loads, but Fails at Boot

Postby moonman » Thu Aug 29, 2013 4:57 am

See what "systemctl status httpd" says right after boot. Also check "journalctl -n"
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: Apache (httpd) Loads, but Fails at Boot

Postby steadybright » Thu Aug 29, 2013 5:12 am

Hi Moonman,

Thanks for your reply!

However, I'm in bigger trouble now. In an attempt to get fw_setenv working again, I followed the directions at the end of the archlinuxarm install page for the Pogoplug V2 ("run the install_uboot_mtd0.sh script from within ArchlinuxARM"), and now the poor box won't even boot. That's one problem I'd not encountered during this whole process.

I hope all the hours of configuration aren't wasted, but I now I need to find out how to SSH into the box to get it going again!

Good stuff.

Thanks for your quick reply. I'll post the results of the commands you suggested when I get this back up again!

steady
People are illogical, unreasonable, and self-centered. Love them anyway.
steadybright
 
Posts: 53
Joined: Thu Aug 29, 2013 4:08 am

Re: Apache (httpd) Loads, but Fails at Boot

Postby steadybright » Mon Sep 02, 2013 2:03 pm

.
I started from scratch and have the Pogoplug V2 up and running LAMP, samba, and WordPress again.

I'm having the same problem with httpd loading and failing. As was the case originally, I can start httpd manually, and it runs without a problem. The following are the results from running the suggested commands:

[root@alarm ~]# systemctl status httpd
$this->bbcode_second_pass_code('', 'httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: failed (Result: exit-code) since Wed 1969-12-31 17:00:18 MST; 43 years 8 months ago
Process: 146 ExecStart=/usr/bin/apachectl start (code=exited, status=1/FAILURE)

Dec 31 17:00:10 alarm systemd[1]: Starting Apache Web Server...
Dec 31 17:00:17 alarm apachectl[146]: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::225:31ff:fe04:8b22 for ServerName
Dec 31 17:00:17 alarm apachectl[146]: (99)Cannot assign requested address: make_sock: could not bind to address 192.168.1.115:80
Dec 31 17:00:17 alarm apachectl[146]: no listening sockets available, shutting down
Dec 31 17:00:17 alarm apachectl[146]: Unable to open logs
Dec 31 17:00:18 alarm systemd[1]: httpd.service: control process exited, code=exited status=1
Dec 31 17:00:18 alarm systemd[1]: Failed to start Apache Web Server.
Dec 31 17:00:18 alarm systemd[1]: Unit httpd.service entered failed state.')

[root@alarm ~]# journalctl -n
$this->bbcode_second_pass_code('', '-- Logs begin at Wed 1969-12-31 17:00:04 MST, end at Mon 2013-09-02 07:27:33 MDT. --
Aug 31 16:11:01 alarm kernel: watchdog watchdog0: watchdog did not stop!
Aug 31 16:11:01 alarm systemd-journal[92]: Journal stopped
-- Reboot --
Aug 31 16:34:02 alarm systemd[1]: Time has been changed
Aug 31 16:34:02 alarm ifplugd[178]: client: 31 Aug 16:34:02 ntpdate[386]: step time server 12.10.191.251 offset 1377988413.257478 sec
Aug 31 16:34:02 alarm ifplugd[178]: client: Started network profile 'eth0'
Aug 31 16:34:02 alarm ifplugd[178]: Program executed successfully.
Aug 31 16:35:07 alarm sshd[390]: Accepted password for root from 192.168.1.100 port 5375 ssh2
Aug 31 16:35:07 alarm sshd[390]: pam_unix(sshd:session): session opened for user root by (uid=0)
Aug 31 16:35:07 alarm systemd-logind[139]: New session c1 of user root.
Aug 31 16:35:07 alarm sshd[390]: subsystem request for sftp by user root')

I noticed the date references in both outputs contain 1969-12-31. The journalctl output also has "Aug 31", which isn't the current date either (I ran these commands on 2013-9-2 at almost 1400 GMT).

Running $this->bbcode_second_pass_code('', 'timedatectl status') immediately after the two commands above yielded the correct date, time, timezone, etc.

Perhaps the date stuff is a red herring. I would sure like to know why httpd fails to load at boot.

Thanks for your time.

Sincerely,

steady
People are illogical, unreasonable, and self-centered. Love them anyway.
steadybright
 
Posts: 53
Joined: Thu Aug 29, 2013 4:08 am

Re: Apache (httpd) Loads, but Fails at Boot

Postby steadybright » Thu Sep 05, 2013 6:52 pm

After completing a fresh install (on a separate Pogoplug V2), I have arrived at the same place: same problem with httpd as before.

(Synopsis: The httpd service tries to load at boot, and fails pretty quickly. However, I can launch httpd (systemctl start httpd) via SSH and it runs fine.)

I'm not as concerned anymore about what's causing the problem. I've found numerous other people online that have had this problem (or one similar) that were able to resolve the problem with re-installing Apache, or fixing the file system or symlinks, etc., but none of their solutions remedied my problem.

I'd be satisfied with a work around. My hunch is that the httpd service is loading before the system is ready for it to load. I reviewed the httpd.service file and see that it's set to load after:

network.target
remote-fs.target
nss-lookup.target

Apparently, the list is not long enough. ;) What else could/should I add to the list to force the httpd service to wait longer after boot before loading? Maybe it fixes the problem... I'm of ideas.

If I'm asking the wrong question, please point me in the right direction.

Thanks,

steady
People are illogical, unreasonable, and self-centered. Love them anyway.
steadybright
 
Posts: 53
Joined: Thu Aug 29, 2013 4:08 am

[SOLVED] Apache (httpd) Loads, but Fails at Boot

Postby steadybright » Thu Sep 05, 2013 8:53 pm

Not a sophisticated solution, but it works:

Running
$this->bbcode_second_pass_code('', 'systemctl list-units --type=target')
Yielded the following results:
$this->bbcode_second_pass_code('', 'UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
cryptsetup.target loaded active active Encrypted Volumes
getty.target loaded active active Login Prompts
graphical.target loaded active active Graphical Interface
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
paths.target loaded active active Paths
remote-fs.target loaded active active Remote File Systems
sockets.target loaded active active Sockets
swap.target loaded active active Swap
sysinit.target loaded active active System Initialization
timers.target loaded active active Timers')
I added each of the listed targets to the "After" statement in the [Unit] section of the /usr/lib/systemd/system/httpd.service file as follows:
$this->bbcode_second_pass_code('', '[Unit]
Description=Apache Web Server
After=basic.target cryptsetup.target getty.target graphical.target local-fs-pre.target local-fs.target multi-user.target paths.target remote-fs.target sockets.target swap.target sysinit.target timers.target

[Service]
Type=forking
PIDFile=/run/httpd/httpd.pid
ExecStart=/usr/bin/apachectl start
ExecStop=/usr/bin/apachectl graceful-stop
ExecReload=/usr/bin/apachectl graceful
PrivateTmp=true
LimitNOFILE=infinity

[Install]
WantedBy=multi-user.target')
I then ran the following:
$this->bbcode_second_pass_code('', 'systemctl daemon-reload
systemctl restart httpd
reboot')
(Rebooting was required to validate the test; I'm not sure if the systemctl commands were necessary, given the reboot.)

I've only noticed one side-effect so far: the Apache Server Status page reports "Restart Time: Wednesday, 31-Dec-1969 17:00:31 EST". I can live with that. If I notice something was broken as a result of the "fix," I'll update the thread.

steady
People are illogical, unreasonable, and self-centered. Love them anyway.
steadybright
 
Posts: 53
Joined: Thu Aug 29, 2013 4:08 am


Return to ARMv5

Who is online

Users browsing this forum: No registered users and 17 guests