Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache wiki issues
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
davidbrooke
Guru
Guru


Joined: 03 Jan 2015
Posts: 341

PostPosted: Sat Sep 05, 2015 5:09 pm    Post subject: Apache wiki issues Reply with quote

I was in the process of installing Owncloud and ran into a few issues using the apache wiki.
The first issue involves wiki suggested code to be used while apache generates something different. See numbers 1 and 2.

1. Enabling PHP support
/etc/apache2/modules.d/70_mod_php5.conf
In wiki:
Code:
<IfDefine PHP5>
        # Load the module first
        <IfModule !mod_php5.c>
                LoadModule php5_module    modules/libphp5.so
        </IfModule>
 
        # Set it to handle the files
        <IfModule mod_mime.c>
                AddHandler application/x-httpd-php .php .php5 .phtml
                AddHandler application/x-httpd-php-source .phps
        </IfModule>
 
        DirectoryIndex index.php index.phtml
</IfDefine>

Software generated:
Code:
<IfDefine PHP5>
   # Load the module first
   <IfModule !mod_php5.c>
      LoadModule php5_module    modules/libphp5.so
   </IfModule>

   # Set it to handle the files
   # NOTE: Avoiding AddHandler/AddType for security (bug #538822)
   # NOTE: Please read the related news item!
   <FilesMatch "\.(php|php5|phtml)$">
      SetHandler application/x-httpd-php
   </FilesMatch>
   <FilesMatch "\.phps$">
      SetHandler application/x-httpd-php-source
   </FilesMatch>

   DirectoryIndex index.php index.phtml
</IfDefine>

2. Enabling PHP through fcgid
/etc/apache2/modules.d/20_mod_fcgid.conf
In wiki:
Code:
<IfDefine FCGID>
LoadModule fcgid_module modules/mod_fcgid.so
SocketPath /var/run/fcgidsock
SharememPath /var/run/fcgid_shm
 
AddHandler php-fcgid .php
AddType application/x-httpd-php .php
Action php-fcgid /fcgid-bin/php-fcgid-wrapper
# max request 128mb
FcgidMaxRequestLen 134217728
<Location /fcgid-bin/>
        SetHandler fcgid-script
        Options +ExecCGI
</Location>
</IfDefine>

Software generated:
Code:
<IfDefine FCGID>
LoadModule fcgid_module modules/mod_fcgid.so
SocketPath /var/run/fcgidsock
SharememPath /var/run/fcgid_shm
</IfDefine>

# vim: ts=4 filetype=apache


The next issue is the wiki offers code that causes the webserver to stop displaying php.
The php test used in example #1 fails when the following code is applied. See https://forums.gentoo.org/viewtopic-t-1028188.html
Basically #3 over writes #1 and the current work-around I use is to revert back to #1.

3. Enabling PHP-FPM through mod_proxy_fcgi in Apache 2.4
/etc/apache2/modules.d/70_mod_php5.conf
In wiki:
Code:
<IfDefine PHP5>
        <FilesMatch "\.php$">
                SetHandler "proxy:unix:///var/run/php-fpm/www.sock|fcgi://localhost/"
        </FilesMatch>
 
   # Set it to handle the files
   <IfModule mod_mime.c>
      AddHandler application/x-httpd-php .php .php5 .phtml
      AddHandler application/x-httpd-php-source .phps
   </IfModule>
 
   DirectoryIndex index.php index.phtml
 </IfDefine>


If someone could offer advice as to which code to use, it would be appreciated.
Thanks
Back to top
View user's profile Send private message
davidbrooke
Guru
Guru


Joined: 03 Jan 2015
Posts: 341

PostPosted: Mon Sep 07, 2015 5:13 am    Post subject: Reply with quote

Update
I found a news item that helps:
2015-04-06-apache-addhandler-addtype

This resolves item #1. Due to the changes in the news item, the software generated option is the correct one to use and not the wiki. The following is the correct code.
1. Enabling PHP support
/etc/apache2/modules.d/70_mod_php5.conf
Code:
<IfDefine PHP5>
   # Load the module first
   <IfModule !mod_php5.c>
      LoadModule php5_module    modules/libphp5.so
   </IfModule>

   # Set it to handle the files
   # NOTE: Avoiding AddHandler/AddType for security (bug #538822)
   # NOTE: Please read the related news item!
   <FilesMatch "\.(php|php5|phtml)$">
      SetHandler application/x-httpd-php
   </FilesMatch>
   <FilesMatch "\.phps$">
      SetHandler application/x-httpd-php-source
   </FilesMatch>

   DirectoryIndex index.php index.phtml
</IfDefine>

Item #2 has a test to verify if it is working correctly which is also used to test item #1. After the wiki changes are applied for item #2, use the php test file:
/var/www/localhost/htdocs/info.php
with the following code:
Code:
<html>
 <body>
  <?php phpinfo(); ?>
 </body>
</html>

There is a field called Server API and it's value should be "CGI/FastCGI" but it isn't, the value is "Apache 2.0 Handler".
So there is an issue at this stage which needs to be corrected before item #3 can be evaluated.
Both sets of code were tested, wiki and software generated, and both failed the test.
Back to top
View user's profile Send private message
sseguron
n00b
n00b


Joined: 31 Mar 2015
Posts: 24

PostPosted: Wed Nov 04, 2015 3:19 pm    Post subject: New ? Reply with quote

Hi,

I do have the same problem, stuck with Apache 2 Handler and unable to activate Fact CGI.

Did you find the solution ?

For anyone else, can you please give us a hint here ?
Back to top
View user's profile Send private message
davidbrooke
Guru
Guru


Joined: 03 Jan 2015
Posts: 341

PostPosted: Fri Nov 06, 2015 1:47 am    Post subject: Reply with quote

I never got any answer to the Apache issues so I tried Lighttpd and got it working with Owncloud. See here:
https://forums.gentoo.org/viewtopic-t-1028396.html
Back to top
View user's profile Send private message
sseguron
n00b
n00b


Joined: 31 Mar 2015
Posts: 24

PostPosted: Fri Nov 06, 2015 9:10 am    Post subject: Specific to Gentoo ? Reply with quote

Is this incapacity of implementing FactCgi also the case on other Linux distribution or specific to Gentoo ?
Same for Apache 2.4 ? only on beta on Gentoo or for all other Linuxes ?

What is preventing FastCgi working on Gentoo ? debug by the community ?
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Fri Nov 06, 2015 12:10 pm    Post subject: Re: Specific to Gentoo ? Reply with quote

sseguron wrote:
Is this incapacity of implementing FactCgi also the case on other Linux distribution or specific to Gentoo ?
Same for Apache 2.4 ? only on beta on Gentoo or for all other Linuxes ?

Download a bindist or two, and see for yourself; then let us know ;-)
Quote:
What is preventing FastCgi working on Gentoo ? debug by the community ?

It's not FastCGI overall, it's just in one httpd; whereas many of us use nginx or lighty, where FCGI was nurtured.

PHP has always (well, at least 15 years) been supported as a built-in to apache, so it's less of an issue.

Not saying you don't want it fixed: just that you might need to (do the research to) answer some of your own questions.
Other users can be more help correcting from there.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum