You are not logged in.
Hey there,
I recently moved my system to systemd, and now I can't start apache. Installed apache, php, php-apache, and mysql for a regular LAMP setup, I ran before. Then copied my configuration file for apache, which worked for years now, on several webservers, and then, when I try to start it with systemctl start httpd, systemd tells me the job failed for httpd.service. then I check systemctl status httpd and I see the following:
httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: failed (Result: resources) since Fri 2013-03-15 12:40:36 CET; 13s ago
Process: 21992 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Mar 15 12:40:34 Silentium systemd[1]: Starting Apache Web Server...
Mar 15 12:40:35 Silentium systemd[1]: PID file /run/httpd/httpd.pid not readable (yet?) after start.
Mar 15 12:40:36 Silentium systemd[1]: httpd.service never wrote its PID file. Failing.
Mar 15 12:40:36 Silentium systemd[1]: Failed to start Apache Web Server.
Mar 15 12:40:36 Silentium systemd[1]: Unit httpd.service entered failed state
tried chowning the /run/httpd directory to http user and http group - of course, apache is ran by http who is a member of http -, no effect, tried setting it to chmod 777, no effect. When I check the error log for httpd it says:
[Fri Mar 15 12:45:26 2013] [error] (2)No such file or directory: Couldn't bind unix domain socket /var/run/httpd/cgisock.22028
[Fri Mar 15 12:45:26 2013] [error] (2)No such file or directory: could not create /var/run/httpd/httpd.pid
[Fri Mar 15 12:45:26 2013] [error] httpd: could not log pid to file /var/run/httpd/httpd.pid
how can I fix this?
thanks,
estol
Last edited by estol (2013-03-18 14:15:33)
Offline
Workaround would be to create the pid file and then have it owned by the http user/group. Create the file, make sure http can access it restart the service. Should fix it.
touch /var/run/httpd/httpd.pid
Offline
Created the pid file, owned by http:http, tried to start httpd, no effect, same error messages in logs. Set 777 chmod on the pid file, same error message.
[edit]
The strangest thing is, that not only systemctl start httpd does this, but issuing httpd on the shell as well. Might not be systemd?
Last edited by estol (2013-03-15 15:55:50)
Offline
Considering the fact that I didn't have /run/httpd at all, this should help.
# systemctl stop httpd
# rm -r /run/httpd
# mkdir /run/httpd
# systemctl start httpd
Offline
Considering the fact that I didn't have /run/httpd at all, this should help.
# systemctl stop httpd # rm -r /run/httpd # mkdir /run/httpd # systemctl start httpd
Tried removing /run/httpd and then recreating the directory, No effect, same error message in the log, apache not starting.
Offline
Is your /var/run symlinked to /run ?
Offline
Is your /var/run symlinked to /run ?
No it wasn't.
Moved everything from /var/run to /run, then created /var/run as a symbolic link to /run, now httpd starts fine.
Thanks!
Last edited by estol (2013-03-18 14:15:03)
Offline
65kid wrote:Is your /var/run symlinked to /run ?
No it wasn't.
Moved everything from /var/run to /run, then created /var/run as a symbolic link to /run, now httpd starts fine.Thanks!
note that /var/lock must also link to /run/lock, in case you missed this as well. See the news from 9 months ago: https://www.archlinux.org/news/filesyst … equired-1/
Last edited by 65kid (2013-03-18 14:17:17)
Offline
estol wrote:65kid wrote:Is your /var/run symlinked to /run ?
No it wasn't.
Moved everything from /var/run to /run, then created /var/run as a symbolic link to /run, now httpd starts fine.Thanks!
note that /var/lock must also link to /run/lock, in case you missed this as well. See the news from 9 months ago: https://www.archlinux.org/news/filesyst … equired-1/
/var/lock is already a symbolic. Strange though, since the system was recently installed from the 12.01 installation media, because of the sysvinit deprecation.
Offline