• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[FreeBSD] Can't get Apache2 running

#1
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?
 

j79zlr

Glaanies script monkey
Political User
#2
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.
 
#4
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
 

j79zlr

Glaanies script monkey
Political User
#5
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
 

j79zlr

Glaanies script monkey
Political User
#6
Geffy, IIRC using mod_php4 does not require any extra make arguments, but the lang/php4 port does.
 
#7
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.
 
#8
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.
 
#9
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
 
#10
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).
 

j79zlr

Glaanies script monkey
Political User
#11
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.
 
#17
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?
 
#20
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 posts

Latest profile posts

Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,015
Latest member
evaiwhitis