# Apache doesn't start on boot, jailed



## Mormegil (Aug 29, 2009)

I have the apache 2.2 port installed in a Jail on FreeBSD 7.2.  When the jail is started or rebooted, apache fails to start.  apache22_enable="YES" is set in rc.conf, and apache starts alright if I run /usr/local/etc/rc.d/apache22 start manually after boot time.  I've enabled rc_debug and rc_info in rc.conf, the following output is displayed when I start the rc script by hand:


```
root@mail:run# /usr/local/etc/rc.d/apache22 start
/usr/local/etc/rc.d/apache22: DEBUG: checkyesno: apache22_http_accept_enable is set to NO.
/usr/local/etc/rc.d/apache22: DEBUG: checkyesno: apache22_enable is set to YES.
/usr/local/etc/rc.d/apache22: DEBUG: pid file (/var/run/httpd.pid): not readable.
/usr/local/etc/rc.d/apache22: DEBUG: run_rc_command: start_precmd: apache22_prestart 
Performing sanity check on apache22 configuration:
Syntax OK
/usr/local/etc/rc.d/apache22: DEBUG: checkyesno: apache22limits_enable is set to NO.
Starting apache22.
/usr/local/etc/rc.d/apache22: DEBUG: run_rc_command: doit: /usr/local/sbin/httpd  -DNOHTTPACCEPT
```

Any ideas?


----------



## Mormegil (Aug 29, 2009)

That edit button would come in really handy about now :r


----------



## graudeejs (Aug 29, 2009)

does your /etc/rc.conf has

```
jail_[color="Red"]JAILNAME[/color]_exec="/bin/sh /etc/rc"
```


----------



## Mormegil (Aug 29, 2009)

Yes

The jail starts with no problem, so do all the other services inside the jail; only Apache doesn't.


----------



## Mormegil (Aug 30, 2009)

For the time being, I've just installed a crontab entry to run the rc script at boot time.  I'm wondering mainly whether this is an issue with apache itself, or if it's something with the jail configuration.


----------



## vivek (Aug 30, 2009)

Can you see any error or warning messages in /var/log/httpd-error.log?

```
tail -f /var/log/httpd-error.log
```

How did you know it is not starting? What is the output of sockstat -4 -p80

```
sockstat -4 -p80
```


----------



## Mormegil (Aug 30, 2009)

Hmm, that actually did it.

I checked the httpd error logs initially, there was only a [warn] about SSLSessionCache not being configured.  I ignored it since it wasn't fatal and apache started without complaint when running the rc script by hand.  Going back and resolving the Session Cache issue causes apache to start normally at boot.


----------

