[FreeBSD] Can't get Apache2 running

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
Alright, the ports/kernel upgrade went fine, so I could finally install some apps. I began with MySQL4.0. Installation went fine, restarted, deamon started up and runs like hell ;). Next was Apache2, installation went (apperantly) fine, but I can't start httpd. I did /usr/local/sbin/httpd -k start, but nothing happens. When trying a -k restart, it says httpd isn't started and it tries to start httpd again, but no effect. What can went wrong? There can't be an error in the httpd.conf file, because the only error it gave, was that he couldn't find this module:
Code:
#LoadModule ext_filter_module libexec/apache2/mod_ext_filter.so
But I commented that out already with a nice #. Oh and I added two lines:
Code:
AddType application/x-httpd-php .php
AddType application/x-httpd-source .phps
for use with PHP (of course that is installed)
Oh and I set the Listen and Servername to 192.168.0.4:80 (it's IP). Is that good?
 
what does apachectl start do for ya?

I use Listen 80, but that should work

You don't want that as your servername, use

Servername www.glaanieboy.dyndns.org
ServerAlias glaanieboy.dyndns.org *.glaanieboy.dyndns.org

^ assuming dyndns name.
 
firstly the last time I checked you have to do something manually to get php4 to work with apache2, so if you "make deinstall clean distclean" for apache2 and mod_php4 then get ready to start it again
in /usr/ports/www/mod_php4 type "make install -DWITH_APACHE2"
fill in the options you want in the menu you are presented with once php4 has been downloaded.

Once it has finished compiling apache2 and php4 (it will do the apache2 as part of the mod_php4 compile and install as it is a dependency)
I believe the command you have to enter to get the php4 libs properly seen and into apache2 you have to do
/usr/local/share/apache2/build/libtool --finish /usr/ports/www/mod_php4/work/php-4.3.5/libs

it gets the libs from the php port work dir which is why we didnt do "make install clean -DWITH_APACHE2"

next just edit the httpd.conf file in /usr/local/etc/apache2/ to add the .php and .phps types and also add index.php to the directory index

you dont really need to restart the machine to get apache running just type
apachectl start
or
/usr/local/etc/rc.d/apache2.sh start

hope this works and helps
 
ok, enable wildcard in dyndns if you want to enalbe the www. or any prefix

Is httpd running? It should throw you an error if there is something wrong with the httpd.conf file. Are you trying to start as root? What happens if you try and go to http://localhost or http://192.168.0.4 in a browser
 
Geffy, IIRC using mod_php4 does not require any extra make arguments, but the lang/php4 port does.
 
j79zlr said:
what does apachectl start do for ya?

I use Listen 80, but that should work

You don't want that as your servername, use

Servername www.glaanieboy.dyndns.org
ServerAlias glaanieboy.dyndns.org *.glaanieboy.dyndns.org

^ assuming dyndns name.

Well, for the moment my router is still redirecting port 80 requests to my workstation (soon to be ex-server), so I put it's IP instead. But nevertheless I tried your solution, and it gave an error at the ServerAlias, saying I could only use that for Virtual Hosts, which I don't have.

But I am thinking you didn't quite understood what I was saying. Apparently my httpd.conf is fine, but the httpd deamon isn't starting up at all. When I issue the command apachectl start or httpd -k start, I look at the ps xa list and I don't see it running. Nor do I see it listening to ports with netstat. So something else is very wrong here.
 
While typing the post, I didn't see your other posts guys, sorry. I am gonna try it like Geffy said and I'll report back when I have more info.
 
j79zlr said:
Geffy, IIRC using mod_php4 does not require any extra make arguments, but the lang/php4 port does.
If you give make arguments to mod_php4 they get past to lang/php4, if you define WITH_APACHE2 then it makes mod_php4 depend on apache2 and not apache13
 
Alright Geffy, I tried your guide, but still nothing. It just won't run. And yes I am logged in as root (actually logged in as a normal user and su'ed to root).
 
Glannie, PHP will have nothing to do with apache not running actually. You should try and troubleshoot apache first, although pretty difficult without any errors.
 
Check out your error log and see if apache is producing any errors when trying to start it perhaps.
 
Damn! Why didn't I think of that :rolleyes: Stupid me. It turned out mod_unique_id was giving the problems. I disabled it and everything works fine now :)
 
I have looked up what mod_unique_id does, I found this on http://www.apachefreaks.com/apache2/mod/mod_unique_id.html:
This module provides a magic token for each request which is guaranteed to be unique across "all" requests under very specific conditions. The unique identifier is even unique across multiple machines in a properly configured cluster of machines. The environment variable UNIQUE_ID is set to the identifier for each request. Unique identifiers are useful for various reasons which are beyond the scope of this document.

:confused: Can someone translate this to English?
 
hrmm
*wonders if thats the module that generates session ids
 
put
<?php echo phpinfo(); ?>
into a php file and look at the output, there should be a session ID field somewhere in that page, if there isnt one then you might have a problem
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back