PHP/Apache on 10.2.4

capneb

Registered
:confused: Just upgraded (?) to 1.2.4 and php module is disabled. Can't use php. Tried restarting apachectl and tried using 1.3.27. No luck. Any ideas?
 
I don't mean to state the obvious, but you'll probably need to modify your httpd.conf file to enable PHP. I don't recall it coming enabled by default (might be wrong there), and I suspect the new update probably replaces your httpd.conf file.
 
I altered the httpd.conf file long ago. I just checked it again and it still has php enabled. Any other ideas?
 
i noticed that the update to 10.2.4 saved my old /etc/httpd/httpd.conf as:

/etc/httpd/http.conf.applesaved

Reverting the 'new' apache config back to my old apache config with:

cp httpd.conf.applesaved httpd.conf

then restarting apache did the trick.

it makes no sense to me why apple did this unless they applied a patch to apache.

at least they didn't decide to upgrade to apache 2.0.x, that would have fubar'd a ton of things...
 
make sure

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

is in your httpd.conf file

also look at /etc/httpd/httpd.conf.applesaved
for your old settings
 
looking at the differences between the new httpd.conf that apple put in place with the 10.2.4 update and my old config, i only notice one major difference (aside from my old settings) and that was the addition of some mod_rendezvous_apple directives.

i wonder what mod_rendezvous_apple is for?
 
this may belong on another thread, but i have found it beneficial to do a:

sudo update_prebinding -root / -force

and then reboot

after updates like this one. it should probably be something done during 'Optimization', but it seems to get skipped.
 
Originally posted by holmBrew
i noticed that the update to 10.2.4 saved my old /etc/httpd/httpd.conf as:

/etc/httpd/http.conf.applesaved

Reverting the 'new' apache config back to my old apache config with:

cp httpd.conf.applesaved httpd.conf

then restarting apache did the trick.

it makes no sense to me why apple did this unless they applied a patch to apache.

They have updated Apache to use Redezvous that is why they have a new config file. This will enable to you, in Safari, go to Rendezvous and your webserver will be broadcasted there. Great for web developers to test stuff on a LAN. You need to add your PHP stuff to the config file and you are good to go.

AddType Application/x-httpd-php .php
AddType Application/x-httpd-php3 .php3

<B>If you restore your original file you will NOT get Rendezvous support, unless you add it manually.</B>
 
Yeah, see, the thing is... I checked all of those things...

httpd.conf (not applesaved) DID have php LoadModule, AddModule and AddType ALREADY INCLUDED in the "new" httpd.conf. The only thing I noticed from the "old" was the Rendezvous stuff. I restarted apache, but no luck.
 
Did you 'un-comment' the php specific directives? This was not done in the 'new' config file put in place by the update.

You will also have to add index.php to the DirectoryIndex directive so that apache looks for index.php.
 
I use my Pismo as a test Web server for Web sites I support. It works rather well. PHP works, server side includes sort of work. It just amazes clients that I can show up and demonstrate a fuctioning Web site to them on my PowerBook.

However, it would work even better if I could set it just like my ISP configures their own Web server so that each Web site has it's own httpdocs folder that is the root access for the specific site. That way commands like /images/pookie.jpg always work right.

Is there an easy way to do this?
 
Pyroboy, that's an involved question for another topic. =)

However, what you need is called Virtual Hosting and it requires you to edit your httpd.conf file. Look for the following in the httpd.conf file:

Code:
### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at &lt;URL:[url]http://www.apache.org/docs/vhosts/&gt;[/url]
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
#NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#&lt;VirtualHost *&gt;
#    #ServerAdmin [email]webmaster@example.com[/email]
#    DocumentRoot /www/docs/dummy-host.example.com
#    #ServerName [url]www.example.com[/url]
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#&lt;/VirtualHost&gt;

Instead of provide a how-to, I'll just you how my system is setup. The following lines appear in section after the above commented lines:

Code:
NameVirtualHost 68.34.216.45
NameVirtualHost 192.168.123.104

&lt;VirtualHost 68.34.216.45 192.168.123.104&gt;
    DocumentRoot /Library/WebServer/Documents/bradkelley
    ServerName [url]www.bradkelley.com[/url]
&lt;/VirtualHost&gt;

&lt;VirtualHost 68.34.216.45 192.168.123.104&gt;
    DocumentRoot /Library/WebServer/Documents/bradkelley
    ServerName bradkelley.com
&lt;/VirtualHost&gt;

&lt;VirtualHost 68.34.216.45 192.168.123.104&gt;
    DocumentRoot /Library/WebServer/Documents/desktopchameleon
    ServerName [url]www.desktopchameleon.com[/url]
&lt;/VirtualHost&gt;

&lt;VirtualHost 68.34.216.45 192.168.123.104&gt;
    DocumentRoot /Library/WebServer/Documents/desktopchameleon
    ServerName desktopchameleon.com
&lt;/VirtualHost&gt;

As you can see, there are two test accounts on this machine, bradkelley.com and desktopchameleon.com. Both have seperate home directories defined in the VirtualHost directive. Each also has the IP that it responds to: 68.34.216.45 outside the router, and 192.168.123.104 inside the router. You'll also notice that I explicitly defined not only the second level domain, but also the third level domain (bradkelley.com and www.bradkelley.com).

The Apache Bible has tons of helpful info on this sort of stuff. And the configuration is made simpler if you have WebMin installed also.

Hopefully this was helpful. =)

Brad
 
Thank you so much for the hint! It beats poking around breaking things like I usually do...

I have a good handle on everything from the httpdocs folder up. But going the other way, I sometimes run into problems. I mean really, how many times do you configure your Web server? Usually an admin does it for you or a hosting company.


I'll definitely pick up the book. That might be handy.
 
Back
Top