public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Setting up a local web server
@ 2011-04-01 11:57 Peter Humphrey
  2011-04-01 12:18 ` Stéphane Guedon
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Humphrey @ 2011-04-01 11:57 UTC (permalink / raw
  To: gentoo-user

Hello list,

I want a box on my LAN to be a local web and database server. I've installed 
Apache, MySQL, PHP and phpmyadmin and I'm about to get phpmyadmin going. The 
problem is that Apache is displaying the contents of php files instead of 
interpreting them.

What have I missed? I have USE="apache2 php" in make.conf and APACHE2_OPTS="-D 
PHP" in /etc/conf.d/apache2.

(Why is it so hard to get a web server going in Gentoo? I remember having the 
same difficulty 18 months ago; it'd be good to be able to remember what I did. 
This is the one area I've found where the Gentoo documentation is weak - well, 
nonexistent actually. We ought to have an idiot's guide to getting started, at 
least.)

-- 
Rgds
Peter



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Setting up a local web server
  2011-04-01 11:57 [gentoo-user] Setting up a local web server Peter Humphrey
@ 2011-04-01 12:18 ` Stéphane Guedon
  2011-04-01 19:56   ` Peter Humphrey
  0 siblings, 1 reply; 9+ messages in thread
From: Stéphane Guedon @ 2011-04-01 12:18 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 1163 bytes --]

On Friday 01 April 2011 13:57:49 Peter Humphrey wrote:
> Hello list,
> 
> I want a box on my LAN to be a local web and database server. I've
> installed Apache, MySQL, PHP and phpmyadmin and I'm about to get
> phpmyadmin going. The problem is that Apache is displaying the contents of
> php files instead of interpreting them.
> 
> What have I missed? I have USE="apache2 php" in make.conf and
> APACHE2_OPTS="-D PHP" in /etc/conf.d/apache2.
> 
> (Why is it so hard to get a web server going in Gentoo? I remember having
> the same difficulty 18 months ago; it'd be good to be able to remember
> what I did. This is the one area I've found where the Gentoo documentation
> is weak - well, nonexistent actually. We ought to have an idiot's guide to
> getting started, at least.)

I have APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D PHP5"

you should try at least language and php5 !

Don't know actually if it will help !

-- 
Stéphane Guedon
page web : http://www.22decembre.eu/
carte de visite : http://www.22decembre.eu/downloads/Stephane-Guedon.vcf
clé publique gpg : http://www.22decembre.eu/downloads/Stephane-Guedon.asc

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Setting up a local web server
  2011-04-01 12:18 ` Stéphane Guedon
@ 2011-04-01 19:56   ` Peter Humphrey
  2011-04-01 23:03     ` kashani
  2011-04-04  9:17     ` Joost Roeleveld
  0 siblings, 2 replies; 9+ messages in thread
From: Peter Humphrey @ 2011-04-01 19:56 UTC (permalink / raw
  To: gentoo-user

On Friday 01 April 2011 13:18:39 Stéphane Guedon wrote:

> I have APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D PHP5"
> 
> you should try at least language and php5 !

That missing 5 is important - thanks.

Then, however, I got this:

 * apache2 has detected an error in your setup:
apache2: Syntax error on line 149 of /etc/apache2/httpd.conf: Syntax error on 
line 4 of /etc/apache2/modules.d/70_mod_php5.conf: Cannot load 
/usr/lib/apache2/modules/libphp5.so into server: 
/usr/lib/apache2/modules/libphp5.so: cannot open shared object file: No such file 
or directory

That's after emerge -Cv apache and removing by hand all files and directories 
left behind by emerge. Same with php. Then I reinstalled both apache and php but 
without using the packages I had and all came right - thanks Stéphane.

This is connected with the other thread I've written to today, about using my 
workstation as an emerge server. A complication I didn't mention there is that 
both make.conf and package.use have to be identical in the chroot and the target 
system nfs-mounted under it. I must have got them out of step at some stage.

Incidentally, apache is wrong to complain of syntax errors - they're errors of 
configuration, not syntax.

-- 
Rgds
Peter



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Setting up a local web server
  2011-04-01 19:56   ` Peter Humphrey
@ 2011-04-01 23:03     ` kashani
  2011-04-02  5:40       ` Adam Carter
  2011-04-02  8:45       ` Neil Bothwick
  2011-04-04  9:17     ` Joost Roeleveld
  1 sibling, 2 replies; 9+ messages in thread
From: kashani @ 2011-04-01 23:03 UTC (permalink / raw
  To: gentoo-user

On 4/1/2011 12:56 PM, Peter Humphrey wrote:
> On Friday 01 April 2011 13:18:39 Stéphane Guedon wrote:
>
>> I have APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D PHP5"
>>
>> you should try at least language and php5 !
>
> That missing 5 is important - thanks.
>
> Then, however, I got this:
>
>   * apache2 has detected an error in your setup:
> apache2: Syntax error on line 149 of /etc/apache2/httpd.conf: Syntax error on
> line 4 of /etc/apache2/modules.d/70_mod_php5.conf: Cannot load
> /usr/lib/apache2/modules/libphp5.so into server:
> /usr/lib/apache2/modules/libphp5.so: cannot open shared object file: No such file
> or directory
>
> That's after emerge -Cv apache and removing by hand all files and directories
> left behind by emerge. Same with php. Then I reinstalled both apache and php but
> without using the packages I had and all came right - thanks Stéphane.
>
> This is connected with the other thread I've written to today, about using my
> workstation as an emerge server. A complication I didn't mention there is that
> both make.conf and package.use have to be identical in the chroot and the target
> system nfs-mounted under it. I must have got them out of step at some stage.
>
> Incidentally, apache is wrong to complain of syntax errors - they're errors of
> configuration, not syntax.
>

Apache doesn't recognize the syntax, therefore it's a syntax error.

dig you build php with an apache2 flag to enable the Apache module?

kashani



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Setting up a local web server
  2011-04-01 23:03     ` kashani
@ 2011-04-02  5:40       ` Adam Carter
  2011-04-02 13:02         ` Todd Goodman
  2011-04-02  8:45       ` Neil Bothwick
  1 sibling, 1 reply; 9+ messages in thread
From: Adam Carter @ 2011-04-02  5:40 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 157 bytes --]

> dig you build php with an apache2 flag to enable the Apache module?
>

And you'll also need this in your httpd.conf;

AddType application/x-httpd-php .php

[-- Attachment #2: Type: text/html, Size: 354 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Setting up a local web server
  2011-04-01 23:03     ` kashani
  2011-04-02  5:40       ` Adam Carter
@ 2011-04-02  8:45       ` Neil Bothwick
  1 sibling, 0 replies; 9+ messages in thread
From: Neil Bothwick @ 2011-04-02  8:45 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 870 bytes --]

On Fri, 01 Apr 2011 16:03:10 -0700, kashani wrote:

> >   * apache2 has detected an error in your setup:
> > apache2: Syntax error on line 149 of /etc/apache2/httpd.conf: Syntax
> > error on line 4 of /etc/apache2/modules.d/70_mod_php5.conf: Cannot
> > load /usr/lib/apache2/modules/libphp5.so into server:
> > /usr/lib/apache2/modules/libphp5.so: cannot open shared object file:
> > No such file or directory

> > Incidentally, apache is wrong to complain of syntax errors - they're
> > errors of configuration, not syntax.
 
> Apache doesn't recognize the syntax, therefore it's a syntax error.

It does recognise the syntax, otherwise it wouldn't be trying to load
the module. I agree, it's a misleading error message.


-- 
Neil Bothwick

"Insanity: doing the same thing over and over again and expecting
different results." (Albert Einstein)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Setting up a local web server
  2011-04-02  5:40       ` Adam Carter
@ 2011-04-02 13:02         ` Todd Goodman
  0 siblings, 0 replies; 9+ messages in thread
From: Todd Goodman @ 2011-04-02 13:02 UTC (permalink / raw
  To: gentoo-user

* Adam Carter <adamcarter3@gmail.com> [110402 01:15]:
> > dig you build php with an apache2 flag to enable the Apache module?
> >
> 
> And you'll also need this in your httpd.conf;
> 
> AddType application/x-httpd-php .php

70_mod_php5.conf in /etc/apache2/modules.d adds the handler for that
automatically when PHP5 is defined (and mod_mime.c is there.)

So doublecheck that php was built with the apache2 USE flag as mentioned
above.  I've rebuilt php after apache2 before to be sure the needed
modules are installed.

Also as mentioned make sure your APACHE2_OPTS in /etc/conf.d/apache2
uses -D PHP5 and not just PHP or PHP4.

And finally don't forget to restart apache after emerging php

Todd



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Setting up a local web server
  2011-04-01 19:56   ` Peter Humphrey
  2011-04-01 23:03     ` kashani
@ 2011-04-04  9:17     ` Joost Roeleveld
  2011-04-04 13:15       ` Peter Humphrey
  1 sibling, 1 reply; 9+ messages in thread
From: Joost Roeleveld @ 2011-04-04  9:17 UTC (permalink / raw
  To: gentoo-user

On Friday 01 April 2011 21:56:47 Peter Humphrey wrote:
> On Friday 01 April 2011 13:18:39 Stéphane Guedon wrote:
> > I have APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D PHP5"
> > 
> > you should try at least language and php5 !
> 
> That missing 5 is important - thanks.
> 
> Then, however, I got this:
> 
>  * apache2 has detected an error in your setup:
> apache2: Syntax error on line 149 of /etc/apache2/httpd.conf: Syntax error
> on line 4 of /etc/apache2/modules.d/70_mod_php5.conf: Cannot load
> /usr/lib/apache2/modules/libphp5.so into server:
> /usr/lib/apache2/modules/libphp5.so: cannot open shared object file: No
> such file or directory
> 
> That's after emerge -Cv apache and removing by hand all files and
> directories left behind by emerge. Same with php. Then I reinstalled both
> apache and php but without using the packages I had and all came right -
> thanks Stéphane.
> 
> This is connected with the other thread I've written to today, about using
> my workstation as an emerge server. A complication I didn't mention there
> is that both make.conf and package.use have to be identical in the chroot
> and the target system nfs-mounted under it. I must have got them out of
> step at some stage.
> 
> Incidentally, apache is wrong to complain of syntax errors - they're errors
> of configuration, not syntax.

Try recompiling php.
You may have accidentally removed the php-library as that is located under:
/usr/lib/apache2/modules/...

--
Joost



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Setting up a local web server
  2011-04-04  9:17     ` Joost Roeleveld
@ 2011-04-04 13:15       ` Peter Humphrey
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Humphrey @ 2011-04-04 13:15 UTC (permalink / raw
  To: gentoo-user

On Monday 04 April 2011 10:17:34 Joost Roeleveld wrote:
> On Friday 01 April 2011 21:56:47 Peter Humphrey wrote:

> > This is connected with the other thread I've written to today, about
> > using my workstation as an emerge server. A complication I didn't
> > mention there is that both make.conf and package.use have to be
> > identical in the chroot and the target system nfs-mounted under it. I
> > must have got them out of step at some stage.
> 
> Try recompiling php.
> You may have accidentally removed the php-library as that is located under:
> /usr/lib/apache2/modules/...

It may not be clear from what preceded this, but the problem was actually caused 
by the particular way I'd used chroot, nfs mounting and --root parameter to 
portage running in the chroot on my "emerge server".

As soon as I change my process the problem went away, together with several 
others I haven't bothered the list with.

Thanks anyway.

-- 
Rgds
Peter



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-04-04 13:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-01 11:57 [gentoo-user] Setting up a local web server Peter Humphrey
2011-04-01 12:18 ` Stéphane Guedon
2011-04-01 19:56   ` Peter Humphrey
2011-04-01 23:03     ` kashani
2011-04-02  5:40       ` Adam Carter
2011-04-02 13:02         ` Todd Goodman
2011-04-02  8:45       ` Neil Bothwick
2011-04-04  9:17     ` Joost Roeleveld
2011-04-04 13:15       ` Peter Humphrey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox