apache and freeBSD

Spleeze

Limp Gawd
Joined
Oct 15, 2003
Messages
433
I've been having some problems getting apache up and running on freebsd 5.4

I've tried apache13 and apache2, both have the same effect

I install it via ports, and then the process refuses to start

running apachectl start just drops me back to a prompt with no error, then apachectl stop says there is no process running, ps -aux | grep httpd results in nothing (except grep)

this is running in vmware by the way, although i dont feel this should change anything, since every other *nix distro i've used in vmware install apache flawlessly

i also cannot find the error log for apache in freebsd, it's not where the man pages say it should be... so no luck there

anyone have any nice in depth guides to apache and bsd... or any really nice bsd sites in general?


in short: HELP!
 
I'm guessing you didn't heed the message presented at the end of the apache install process, also contained in the pkg-message file in the port dir.

Read the apache rc script in /usr/local/etc/rc.d to figure out what you need to add to /etc/rc.conf.

You might want to think about editing your httpd.conf before trying to start the server, too.

The error logs haven't been created cause apache never got started and didn't create them.
 
i did read the message, and i had added apache_enable="YES" to the rc.conf file

and i did edit httpd.conf to accurately represent my box

any other ideas...

edit: even after a reboot apache doesnt start, so i resorted to trying to manually start it, which resulted in what i posted earlier
 
Don't know, then...Check /var/log/messages to see if there's any error messages? Run the configtest stuff through apachectl?

I've never not had apache work properly from ports...But it seems like I'm just blessed with FreeBSD working well for me.
 
Besides, you're supposed to use "/usr/local/etc/rc.d/apache.sh start" to start it. Does that do anything, or does it just return without actually starting it?
Replace "apache" with "apache2" if that's what you use.
Use "rcvar" instead of "start" to see if likes your changes to rc.conf, and "status" to see if it thinks it's running.

The log you want is probably /var/log/httpd-error.log .
 
the service is configured to start properly, mysql works perfectly

it just doesnt start, when i manually try to start it with apache2.sh start all it says is

Starting apache2

same thing goes for 1.3 (which i was trying first and then figured i'd give 2 a try to see if it would work, no dice, same thing)

status tells me that it's not running, right after i 'start' it

and stop also tells me it's not running and to check the pid file, which doesnt exist, because i'm assuming it never started and was never written....

could this be a permission issue? mysql didnt start when i first ported it in, i needed to chown the mysql directory so the user mysql could write to the databases ( and at least mysql gave me an error so i knew something was up)

i think this is a simple httpd.conf issue now that i found that error log



Code:
[Mon Aug  1 21:27:59 2005] [alert] mod_unique_id: unable to gethostbyname("testbsd")
[Mon Aug  1 21:30:45 2005] [alert] mod_unique_id: unable to gethostbyname("testbsd")
[Mon Aug  1 21:33:57 2005] [alert] mod_unique_id: unable to gethostbyname("testbsd")
[Mon Aug  1 21:36:42 2005] [alert] mod_unique_id: unable to gethostbyname("testbsd")
[Mon Aug  1 21:46:37 2005] [alert] mod_unique_id: unable to gethostbyname("testbsd")
[Mon Aug  1 21:48:18 2005] [alert] mod_unique_id: unable to gethostbyname("testbsd")
[Mon Aug  1 21:48:22 2005] [alert] mod_unique_id: unable to gethostbyname("testbsd")
[Mon Aug  1 22:00:36 2005] [alert] mod_unique_id: unable to gethostbyname("testbsd")
[Mon Aug  1 22:00:44 2005] [alert] mod_unique_id: unable to gethostbyname("testbsd")
[Mon Aug 01 22:22:27 2005] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "testbsd"
Configuration Failed
[Mon Aug 01 22:22:43 2005] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "testbsd"
Configuration Failed
[Mon Aug 01 22:23:20 2005] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "testbsd"
Configuration Failed
[Mon Aug 01 22:23:21 2005] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "testbsd"
Configuration Failed
[Mon Aug 01 22:30:19 2005] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "testbsd"
Configuration Failed
[Tue Aug 02 17:53:24 2005] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "testbsd"
Configuration Failed
[Tue Aug 02 17:54:32 2005] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "testbsd"
Configuration Failed
[Tue Aug 02 17:54:37 2005] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "testbsd"
Configuration Failed
[Tue Aug 02 17:55:31 2005] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "testbsd"
Configuration Failed
[Tue Aug 02 17:55:42 2005] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "testbsd"
Configuration Failed

I know one of you guys will know what to do with this... rcvar and configtest both seem to like how everything is setup...
 
I'd suggest adding your hostname to /etc/hosts. Something like "127.0.0.1 testbsd" should help.
 
you sir, are a god :D

but seriously, thanks so much, that worked...

why was this the issue, and why wasnt this taken care of by bsd in the first place?
 
Hah. Any more I assume people already know how to make sure a machine knows what its name is, etc.
 
Spleeze said:
you sir, are a god :D

but seriously, thanks so much, that worked...

why was this the issue, and why wasnt this taken care of by bsd in the first place?
Cause it's geared for people that have a working grasp of the basics. Most FreeBSD folks have more than one machine, most are running DNS at home I'd bet, etc.
 
The issue is that apache tries to resolve the hostname you've set to a working IP.
The problem was that there wasn't registred a hostname->IP mapping for it.
As for why a line like that wasn't added to /etc/hosts in the first place, it might not always be a good thing. For instance, if your hostname is registred in your DNS server, it might be preferable to use that (which will resolve to your external IP) instead of mapping it to the loopback address. (Some services only listen to one IP, for instance, and thus won't work if you try to connect to the loopback address.)

I agree that it might be an idea to have a checkbox or something in the network setup in sysinstall, or at least mention it somewhere. It's easy to overlook until you know about it, and often neccesary.
 
Back
Top