# Apache22 will not auto start



## dpalme (Nov 23, 2008)

I have added the 
	
	



```
apache22_enable="YES"
```
 to the /etc/rc.conf file and the apache22 is in /usr/local/etc/ 

I am not sure what else I need to do in order to get it to auto start.

Suggestions?


----------



## ale (Nov 23, 2008)

Can you start it manually ?
Can you find something useful in /var/log/httpd-error.log?


----------



## myst (Nov 24, 2008)

dpalme said:
			
		

> I have added the apache22_enable="YES" to the /etc/rc.conf file and the apache22 is in /usr/local/etc/
> 
> I am not sure what else I need to do in order to get it to auto start.
> 
> Suggestions?


Check the apache start script in /usr/local/etc/rc.d/


----------



## RudiK (Nov 24, 2008)

a nice way to check that you have the correct line in your rc.conf is to run `/usr/local/etc/rc.d/apache22 rcvar` This should show 
	
	



```
apache22_enable="YES"
```
 if not then you have made a mistake in your rc.conf file.


----------



## DutchDaemon (Nov 24, 2008)

Also run [cmd=]apachectl configtest[/cmd] to see if your config is preventing your Apache from starting up.


----------



## dpalme (Nov 24, 2008)

Thanks everyone I think we got it working....for some reason when I built the apache22 port it did not create the data directory....duh, so to be sure that was all, I did a deisntall and rebuilt the port.....everything seems to be working now.


----------



## ghostcorps (Feb 22, 2011)

Hi Guys

 I have a similar issue, when I reboot or run rcvar on any other function I get the message that Apache22 was not found, which is to be expected since there is no apache22 script in /etc/rc.d, eventhough it is a vanilla install from ports. And yet, it starts and runs without any issues as far as I can tell.

 I also have a jailed webserver on top of this machine that does the exact same thing.

 I find it is a bit odd that I have three functioning apache22 flags set (below)... how can this be? and can I fix it?


```
apache22_enable="YES"
apache22 ssl_enable="YES"
apache22_http_accept_enable="YES"
```


Thanks


----------



## DutchDaemon (Feb 22, 2011)

FreeBSD ports don't install _anything_ under /etc, since that belongs to the base system. Ports install everything under /usr/local, and you should find the start scripts installed by ports in /usr/local/etc/rc.d/. This is a very important and thoroughly basic FreeBSD law: base system and add-on software are separated (a very small number of exceptions exist, namely ports that overrule elements of the base system, like Sendmail or BIND from ports, and some ports that like to play in /var).

Note that FreeBSD also has service(8), so you can run [cmd=]service apache22 rcvar[/cmd] instead of [cmd=]/usr/local/etc/rc.d/apache22 rcvar[/cmd]

service(8) covers both /etc/rc.d and /usr/local/etc/rc.d, so it will run everything under both with the usual flags (start, stop, restart, rcvar, status).

BTW: note that it's apache22*_*ssl_enable


----------



## ghostcorps (Feb 23, 2011)

Thanks for the tips 

I am barely self-taught and tend to nut things out as I think of things I want to do. I haven't really had any reason before to look into rc scripts before but it explains another issue I have been having though.

I don't know how the underscore went missing, but that was definitely the cause of the error in dmesg, I forgot to mention it, but I was getting the apache22 not found error at startup also. Oddly enough mod_ssl has been working.


----------

