View previous topic :: View next topic |
Author |
Message |
squealie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 06 Aug 2003 Posts: 45
|
Posted: Fri Oct 17, 2003 1:53 pm Post subject: Apache2+php.........one more time. |
|
|
Hi guys.
I am trying one last time to get this going before I abandon Gentoo for this project.
Working through the virt-mailhost how-to, and it leaves you on your own for the Apache php portion, I know it says to use Apache1, but 2 appearently works on the desktop how-to.
test.php = <? phpinfo() ?>
It doesn't render.
I HAVE:
APACHE2_OPTS= "-D PHP4 -D SSL"
In /etc/conf.d/apache2
What else can I check?
I have STFW and this forum and the above is the only advice I can find that seems relevant.
Please, I'm at my wits end here. ![Confused :?](images/smiles/icon_confused.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
squealie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 06 Aug 2003 Posts: 45
|
Posted: Fri Oct 17, 2003 2:42 pm Post subject: |
|
|
OK, I found another tidbit while Googling.
I hadn't set the Severname directive (which was the cause of this behavior for one person) but now I have, along with updating DNS records. Resolution OK, and I no longer get the 'could not determine servers FQDN message'.
It's still broke.
. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
squealie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 06 Aug 2003 Posts: 45
|
Posted: Fri Oct 17, 2003 3:00 pm Post subject: |
|
|
More Googling......
========================================
On Gentoo, it is important to run the ebuild config once you've emerged Apache2
and PHP. As the manual says:
# emerge apache php mod_php
# ebuild /var/db/pkg/dev-php/mod_php-4.2.2-r1/mod_php-4.2.2-r1.ebuild config
Your version numbers might differ. Do a "emerge -s mod_php" to get the present
version number.
Then, remember to edit /etc/conf.d/apache2 and add/modify this line to look like
this (the SSL part is optional ofcourse):
APACHE_OPTS="-D SSL -D PHP4"
=========================================
I reran the ebuild config (I forgt that I had remerged mod_php )
I got this:
Due to some previous bloopers with PHP and slotting, you may have multiple copies of mod_php installed. Please look at the autoclean output at the end of the emerge and unmerge all but relevant copies.....
after emerge -p mod_php (I don't know if I'm on the right track here..)
I get:
[ ebuild R ] dev-php/mod_php-4.3.3-r1
Now I'm gonna try to figure out what that means.... ![Rolling Eyes :roll:](images/smiles/icon_rolleyes.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
MrPyro Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 14 Aug 2003 Posts: 121 Location: Sheffield, England
|
Posted: Fri Oct 17, 2003 3:41 pm Post subject: |
|
|
That warning is done by default: it isn't based on any checking done to the system.
The ebuild config run basically adds a few lines to apache.conf to configure it for PHP _________________ Back off man, I'm a computer scientist |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
squealie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 06 Aug 2003 Posts: 45
|
Posted: Fri Oct 17, 2003 3:50 pm Post subject: |
|
|
MrPyro wrote: | That warning is done by default: it isn't based on any checking done to the system.
The ebuild config run basically adds a few lines to apache.conf to configure it for PHP |
Thanks, I did suspect that after looking at the ebuild file.
So, I'm back where I started, which is, without a clue. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
raDeon n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 13 Sep 2003 Posts: 58
|
Posted: Mon Oct 20, 2003 2:41 am Post subject: |
|
|
hi did you start apache with
how come I have to type -D PHP4 at the end if I want PHP enabled? I want it to be enabled when i run /etc/init.d/apache2 start or something. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
darfsnuzal n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 07 Aug 2003 Posts: 36
|
Posted: Mon Oct 20, 2003 4:43 am Post subject: |
|
|
I remember having a lot of trouble with apache + php. Now I'm not 100% certain that this was the exact cure, but I unemerged php, apache and mod_php and then only emerged apache and mod_php. That seemed to take care of the problem.
I believe if you do an emerge -p mod_php on a clean system it won't show "php" in the required list. That's what gave me the idea to unemerge php.
HTH. _________________ "Born to Compile" |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
squealie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 06 Aug 2003 Posts: 45
|
Posted: Mon Oct 20, 2003 5:42 pm Post subject: |
|
|
raDeon wrote: | hi did you start apache with
how come I have to type -D PHP4 at the end if I want PHP enabled? I want it to be enabled when i run /etc/init.d/apache2 start or something. |
That did it!
Thank you.
I don't know why, it doesn't work just putting the option in conf.d/apache2, but it did output this on startup:
[warn] module php4_module is already loaded, skipping
Thanks again, now I can at least get on with my server installation. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
RevJones n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 16 Jul 2003 Posts: 1
|
Posted: Thu Oct 23, 2003 1:54 am Post subject: |
|
|
I had a similar problem getting apache to load the php mod. It worked with if I did
but not if I added the option to the config file /etc/conf.d/apache2. After double checking the file I found that I had forgotten to remove the comment mark!
Works now. ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
tom Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/12195862453f8989e26b9b8.jpg)
Joined: 11 Jun 2002 Posts: 83 Location: Guildford, UK
|
Posted: Mon Nov 03, 2003 2:04 pm Post subject: |
|
|
squealie wrote: | I don't know why, it doesn't work just putting the option in conf.d/apache2, but it did output this on startup:
[warn] module php4_module is already loaded, skipping
|
Has anyone figured out why this should be? I'm experiencing the same thing: I have add the "-D PHP4" option explicitly on the command line. Why won't it pick it up in /etc/conf.d/apache2? Weird. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
squealie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 06 Aug 2003 Posts: 45
|
Posted: Thu Nov 13, 2003 3:21 pm Post subject: |
|
|
Quote: |
Has anyone figured out why this should be? I'm experiencing the same thing: I have add the "-D PHP4" option explicitly on the command line. Why won't it pick it up in /etc/conf.d/apache2? Weird. |
Bump for any new info? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
elvis38 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 26 Oct 2003 Posts: 20 Location: Madrid, Spain
|
Posted: Tue Nov 25, 2003 6:35 pm Post subject: |
|
|
squealie wrote: | Quote: |
Has anyone figured out why this should be? I'm experiencing the same thing: I have add the "-D PHP4" option explicitly on the command line. Why won't it pick it up in /etc/conf.d/apache2? Weird. |
Bump for any new info? |
Did you remove the # from the begining of the line in etc/conf.d/apache2 ?
Worked for me... ![Wink :wink:](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
MeBrains n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 05 Nov 2003 Posts: 22
|
Posted: Tue Nov 25, 2003 7:30 pm Post subject: |
|
|
I have the same problem as well....
have not found a solid answer from no one yet although I searched the board several times for this already.
works from prompt, does not work with APACHE_OPTS... ![Confused :?](images/smiles/icon_confused.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
elvis38 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 26 Oct 2003 Posts: 20 Location: Madrid, Spain
|
Posted: Wed Nov 26, 2003 9:48 am Post subject: |
|
|
Humm. You'd have to check the conf files, but I am assuming something went wrong on your machine during the emerge.
If it helps, this is what I did:
1. emerge sync
2. emerge phpmyadmin (this is what I really wanted)
3. edited /etc/conf.d/apache2 as per above (-D PHP4).
4. rc-update add apache2 default
I didn't have php, mod_php or apache2 emerged when I started. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sgarcia Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/1069834853546677b0c9b4a.gif)
Joined: 21 May 2003 Posts: 254 Location: Bakersfield, CA
|
Posted: Fri Nov 28, 2003 3:53 am Post subject: |
|
|
Quote: | Humm. You'd have to check the conf files, but I am assuming something went wrong on your machine during the emerge.
|
My guess is that something went wrong during the config update. I emerged mod_php and apache2 to the most current versions quite some time ago, but was too lazy to update the config files. I was installing a PHP package tonight and it was working fine.
In the middle of the install of a subsidiary package unrelated to PHP I decided to clean up the 46 config files portage had been telling me I urgently had to update, so while ImageMagick was compiling, I "cleaned up" my config files.
When I restarted apache, PHP was dead. If I put "-D PHP4" in /etc/config.d/apache2, nothing happens. If I start using nothing happens.
I like Gentoo's portage system, but its init scripts are a nightmare to deal with. They are convoluted and nasty. Rather than be ashamed of the ugly things like any sane person would be, the developers seem to be proud of them.
Why do we have to deal with "defines" at startup? It's SO much easier just to have the damned module listed in the ONE httpd.conf and be able to just use the apachectl that CAME with apache. Sheesh!
I just unmerged apache, php and mod_php and now the machine is grinding away reinstalling them. We'll see if anything works when I'm done. But if I *do* get it running again, I'm going to think very seriously before I do any more updates. This isn't the first time that "updating" startup scripts has broken things for me.
I would *NEVER* recommend Gentoo for anything important. It makes a fine desktop -- I've had better luck getting a nice customized desktop machine set up than with any other distribution I've tried. But this screwed up init/configuration maze is just too unreliable to use in the real world. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
To Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/106869468452b5c7dd8e5d.png)
Joined: 12 Apr 2003 Posts: 1145 Location: Coimbra, Portugal
|
Posted: Fri Nov 28, 2003 10:10 am Post subject: |
|
|
sgarcia wrote: | My guess is that something went wrong during the config update. I emerged mod_php and apache2 to the most current versions quite some time ago, but was too lazy to update the config files. |
One of the main problems on linux, ppl just don't read the manuals and don't edit the conf files.
sgarcia wrote: | I was installing a PHP package tonight and it was working fine.
In the middle of the install of a subsidiary package unrelated to PHP I decided to clean up the 46 config files portage had been telling me I urgently had to update, so while ImageMagick was compiling, I "cleaned up" my config files.
|
That's because you did a auto-update, you should read carefully the warning befour;)
I usually backup my /etc when I'm updating configure files, something may happend etc etc
sgarcia wrote: |
When I restarted apache, PHP was dead. If I put "-D PHP4" in /etc/config.d/apache2, nothing happens. If I start using nothing happens.
..... |
If you had it running befour, then you did an etc-update and stop working the answer is easy, edit you config files!
sgarcia wrote: |
I would *NEVER* recommend Gentoo for anything important. It makes a fine desktop -- I've had better luck getting a nice customized desktop machine set up than with any other distribution I've tried. But this screwed up init/configuration maze is just too unreliable to use in the real world. |
I recomend gentoo speacially for important things. Why? cause you can decide what you want and how you want it.
Any other distribuion has a nice KDE skin or wahtever and ppl love it, but nothing gets close to gentoo's optimization options.
Fact is, even if you aren't an expert, gentoo and the help of this foruns are one of the finest resources to learn and develop linux skills.
Tó _________________
------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------ |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bos_mindwarp Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/141828242046c9d43e9a577.png)
Joined: 19 Oct 2002 Posts: 275 Location: stockholm, sweden
|
Posted: Fri Nov 28, 2003 11:12 am Post subject: |
|
|
Last time I installed php, I forgot to add the file extensions part of apache.conf (portage doesnt do this for you).
Check this out:
http://www.php.net/manual/en/install.apache2.php
read the part about apache2 shared module instructions (example 3-6), paragraf 15. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Frans n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 27 Nov 2003 Posts: 13
|
Posted: Fri Nov 28, 2003 5:00 pm Post subject: |
|
|
bos_mindwarp wrote: | Last time I installed php, I forgot to add the file extensions part of apache.conf (portage doesnt do this for you).
|
uhm .... Like squealie said... Yes, portage will do that for you.. READ the output after a emerge!
squealie wrote: |
ebuild /var/db/pkg/dev-php/mod_php-4.2.2-r1/mod_php-4.2.2-r1.ebuild config
Your version numbers might differ. Do a "emerge -s mod_php" to get the present version number.
Then, remember to edit /etc/conf.d/apache2 and add/modify this line to look like
this (the SSL part is optional ofcourse):
APACHE_OPTS="-D SSL -D PHP4" |
Maybe ... just maybe APACHE2_OPTS works better.... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sgarcia Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/1069834853546677b0c9b4a.gif)
Joined: 21 May 2003 Posts: 254 Location: Bakersfield, CA
|
Posted: Mon Dec 01, 2003 8:01 pm Post subject: |
|
|
Quote: | sgarcia wrote:
Quote: | was installing a PHP package tonight and it was working fine.
In the middle of the install of a subsidiary package unrelated to PHP I decided to clean up the 46 config files portage had been telling me I urgently had to update, so while ImageMagick was compiling, I "cleaned up" my config files. |
That's because you did a auto-update, you should read carefully the warning befour;)
I usually backup my /etc when I'm updating configure files, something may happend etc etc
|
Backing up /etc would probably have been a good idea. Where did you get the idea that I did an auto-update?
I did, however replace the apache startup script with the new one that came out.
Quote: | sgarcia wrote:
Quote: | I would *NEVER* recommend Gentoo for anything important. It makes a fine desktop -- I've had better luck getting a nice customized desktop machine set up than with any other distribution I've tried. But this screwed up init/configuration maze is just too unreliable to use in the real world.
|
I recomend gentoo speacially for important things. Why? cause you can decide what you want and how you want it.
Any other distribuion has a nice KDE skin or wahtever and ppl love it, but nothing gets close to gentoo's optimization options.
|
Gentoo has the potential to be a superb option for important things. However, the init system is convoluted and largely undocumented. Instead of a config file for Apache 2, you have half a dozen, spread out all over the file system. If you want to trace what's going on during startup, most of the "action" happens inside the bowels of runscript, which appears to be completely undocumented. You're completely at the mercy of whoever most recently rewrote the init script for your particular service, because you're never going to be able to trace it to see what he screwed up.
It also doesn't help that instead of having a config file for each service, there is a normal config file as well as one in /etc/conf.d (which may or may not have critical settings) as well as potentially other config files at the discretion of the Gentoo maintainer. As, for example, the module config stuff in /etc/apache2/conf/modules.d. I searched for 20 minutes before I found settings that normally reside in the httpd.conf hiding away in modules.d.
If Gentoo used standard SysV init scripts, or if the Gentoo init setup was a bit more transparent, so administrators could easily trace what was going on and customize it to their own needs (or fix what a developer screwed up) -- well, then I'd concede that Gentoo was ready for the big time. As it is, it's a crap shoot. Mostly things work well, but when they don't, it's a nightmare to fix. If there were documentation for the init process this would be a lot more acceptable.
The init scripts use /sbin/runscript as the shell. That's fine, as long as the shell functions and script language are documented. If there is documentation, it's well hidden. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mallchin l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/829510687407e634a8dc99.gif)
Joined: 21 Jan 2003 Posts: 655 Location: United Kingdom
|
Posted: Wed Dec 10, 2003 2:26 am Post subject: |
|
|
elvis38 wrote: | squealie wrote: | Quote: |
Has anyone figured out why this should be? I'm experiencing the same thing: I have add the "-D PHP4" option explicitly on the command line. Why won't it pick it up in /etc/conf.d/apache2? Weird. |
Bump for any new info? |
Did you remove the # from the begining of the line in etc/conf.d/apache2 ?
Worked for me... ![Wink :wink:](images/smiles/icon_wink.gif) |
LMAO, I must have setup many Apache+PHP installs but... ... I got caught out by the #
Thanks elvis! _________________ 6700 @ 2.66GHz, 4Gb RAM, 2 x 500Gb, 8800 GTX, PhysX, X-Fi, 24" Widescreen, Tux mascot |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
korozion n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 08 Dec 2003 Posts: 26 Location: Canada
|
Posted: Wed Dec 10, 2003 7:06 am Post subject: |
|
|
Well, I may have a weird one. I have -D PHP4 and -D SSL in the config file, php works great, but ssl will not. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
elvis38 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 26 Oct 2003 Posts: 20 Location: Madrid, Spain
|
Posted: Wed Dec 10, 2003 9:07 am Post subject: |
|
|
korozion wrote: | Well, I may have a weird one. I have -D PHP4 and -D SSL in the config file, php works great, but ssl will not. |
Korozion, I know it may be an obvious question but did you have ssl in your USE variables when you emerged apache? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Oopsz Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 08 Oct 2002 Posts: 340
|
Posted: Wed Dec 10, 2003 5:01 pm Post subject: |
|
|
Gentoo is fantastic on the server. it's intuitive. All the apache specific configuration is in /etc/apache/conf, all the run time changes go in /conf.d. And module ebuilds automagically add themselves to your apache.conf! Changing start up options is as easy as editing one line. What more could you want?
If you don't want full control of your system, go download red hat, I hear lots of people like that. They have nice graphical interfaces for everything, too. ![Twisted Evil :twisted:](images/smiles/icon_twisted.gif) _________________ Pop-before-SMTP with the Gentoo Virtual Mailhosting Guide |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
duhmmm n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 13 Jan 2004 Posts: 4
|
Posted: Tue Jan 13, 2004 10:55 am Post subject: apache2 and php... is the problem solved? |
|
|
I just went though this last night....
Reading the thread it looks like many are typing "apache2 -D PHP4" at the commandline with success, but not not getting it to work with "apache2 -k start".
When you type "apache2...." at the commandline, you are not starting /etc/init.d/apache2, you actually run /usr/sbin/apache2, thus /etc/conf.d/apache2 is not used.
--- or maybe everyone had figured this out. _________________ doh! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|