logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: Joomla/php/fcgi
Author
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Wed 03 Aug '11 15:52    Post subject: Joomla/php/fcgi Reply with quote

Hi

I'm strugling to run Joomla as VH on my Apache. The first idea was to install mysql (as php and apache was already installed and configured), configure it with php and install Joomla. When i've done my Apache was crushing almoust every two hours. As i couldn't accept it i've disable php module and comment Joomla VH since i solve the problem. I found that the recommended way to do this is to run php through mod_fcgi to split up apache and php process. When setup has been finished, everything seems to be working. After 4 hours Apache (which supposed to be splitted up) has been stopped by OS (see screen below)


I don't know exact level of this threat but i think that if OS-based security
mechanism have been used it had to be at least major. Am i right ?

As i don't want to resign from using Joomla i would like to know how to secure it and prevent such problems in future (i belive that Jommla is well protected with default settings) and why Apache has been crushed - not Joomla site ?

I didn't find correspondent logs in event log and apache error log as the only errors found in apache error.log has been registered 20 minutes before apache has been stopped by DEP.

Error log :
Code:

[Tue Aug 02 17:02:14 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Undefined property: stdClass::$user in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 159
[Tue Aug 02 17:02:14 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Undefined property: stdClass::$content in D:\\joomla\\templates\\system\\html\\modules.php on line 17
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 148
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 152
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 155
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Undefined property: stdClass::$user in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 159
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Undefined property: stdClass::$content in D:\\joomla\\templates\\system\\html\\modules.php on line 17
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 148
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 152
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 155
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Undefined property: stdClass::$user in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 159
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Undefined property: stdClass::$content in D:\\joomla\\templates\\system\\html\\modules.php on line 17
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 148
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 152
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 155
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Undefined property: stdClass::$user in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 159
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Undefined property: stdClass::$content in D:\\joomla\\templates\\system\\html\\modules.php on line 17
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 148
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in D:\\joomla\\libraries\\joomla\\application\\module\\helper.php on line 152
[Tue Aug 02 17:02:15 2011] [warn] [client 95.156.208.108] mod_fcgid: stderr: PHP Notice:  Trying to get property of non-object in


My configuration was :

1. Inside vhost
Code:


<Directory "d:/joomla">
    Options +Indexes +FollowSymLinks ExecCGI
    AllowOverride all
    Order Allow,Deny
    Allow from all
</Directory>



2. httpd.conf
Code:

LoadModule fcgid_module modules/mod_fcgid.so

#<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi .php
# Where to look for the php.ini file?
FcgidInitialEnv PHPRC        "c:/windows"
# Set PHP_FCGI_MAX_REQUESTS to greater than or equal to #FcgidMaxRequestsPerProcess
# to prevent php-cgi process from exiting before all requests completed
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS      1000
# Maximum requests a process should handle before it is terminated
FcgidMaxRequestsPerProcess       1000
# Maximum number of PHP processes
FcgidMaxProcesses             15
# Number of seconds of idle time before a php-cgi process is terminated
FcgidIOTimeout             120
FcgidIdleTimeout                120
#Path to php-cgi
FcgidWrapper "c:/php/php-cgi.exe" .php
# Define the MIME-Type for ".php" files
AddType application/x-httpd-php .php
</IfModule>



OS : Win2k3 R2 Standard x64
Apache : Apache/2.2.14 (Win32) mod_ssl/2.2.14 OpenSSL/0.9.8o mod_jk/1.2.25
Php : 5.2.12
Mysql : 5.5.15 x64
Joomla : 1.7.0
mod_fcgi : 2.3.6 from http://www.idg.pl/mirrors/apache//httpd/binaries/win32/mod_fcgid-2.3.6-win32-x86.zip
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Wed 03 Aug '11 16:15    Post subject: Reply with quote

First try with the common env:

FcgidInitialEnv PHPRC "path to your php.ini"
FcgidInitialEnv PATH "path to your php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"

and

replace AddType application/x-httpd-php .php

with AddHandler fcgid-script .php

Steffen
Back to top
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Thu 04 Aug '11 9:51    Post subject: Reply with quote

What about the OS reaction ? What kind of threat it was ?

I'm really focused on the security (this is my first goal) so before i'll update my config with paths to OS directory(thank you Steffen) i must be sure if its safe.
Back to top


Reply to topic   Topic: Joomla/php/fcgi View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules