I'm under the understanding that it is a good practice to have apache2
installed for RoR, and so I've used macports on OSX to install that,
and then I stopped the existing server and restarted the apache2
instance using /opt/local/apache/bin/apachectl. So far, so good. I
get the welcome screen when I point at localhost. But of course I
don't want to break other things on the machine, so I need to get
apache2 to handle the existing PHP pages on the machine.
At that point I am blocked. I did a "port install php5", and it
worked without error, but I don't see how to tell apache2 to know
about this. I tried
AddType application/x-httpd-php .php
AddHandler php5 .php
and restarted apachectl (without warning), but when I navigate to an
existing page, I just see the PHP code, not the result.
Can anyone offer a pointer to get me going? I realize that I'm saying
an ugly word ("php") here, but I think it's acceptable for me to ask
this here, since others may also want to have both RoR and PHP pages
deployed on a single machine.
I'm under the understanding that it is a good practice to have apache2
installed for RoR, and so I've used macports on OSX to install that,
and then I stopped the existing server and restarted the apache2
instance using /opt/local/apache/bin/apachectl. So far, so good. I
get the welcome screen when I point at localhost. But of course I
don't want to break other things on the machine, so I need to get
apache2 to handle the existing PHP pages on the machine.
At that point I am blocked. I did a "port install php5", and it
worked without error, but I don't see how to tell apache2 to know
about this. I tried
AddType application/x-httpd-php .php
AddHandler php5 .php
and restarted apachectl (without warning), but when I navigate to an
existing page, I just see the PHP code, not the result.
Can anyone offer a pointer to get me going? I realize that I'm saying
an ugly word ("php") here, but I think it's acceptable for me to ask
this here, since others may also want to have both RoR and PHP pages
deployed on a single machine.
I suggest you take this somewhere else, there are plenty of mailing
lists dedicated to apache configuration. Even a php list would be more
appropriate.
And I do assume you're talking about deployment here, where it makes
sense to use apache 2.2 with mod_proxy_balancer in front of your
mongrel clusters.
If it's your development box, you should forget all about apache and
just use webrick or mongrel stand-alone.
Thanks, Peter. This was excellent advice. I messed around for a
*long* time trying to get the port version working. I am not sure my
experience will be of any use to others, because a lot of my problem
was in having an incorrect PATH variable, etc. Still, I can report
that using this official MYSQL version *does* work. And the panel
item for starting it is quite nice -- better than figuring out where
the daemon is, better than issuing launchctl commands, etc.
Oh, one other thing to report -- all my existing databases got
trashed. No big deal; I have cronscripts items to do nightly
backups. (Again, I don't know if this is relevant to others reading
this ... perhaps I did something wrong.)