Created
March 24, 2012 21:11
-
-
Save cballou/2188015 to your computer and use it in GitHub Desktop.
SWITCHING APACHE FROM PREFORK TO WORKER MPM IN RHEL / CENTOS 5.X / FEDORA 13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install libtool httpd-devel apr-devel apr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) | |
[notice] Apache/2.2.15 (Unix) DAV/2 mod_fcgid/2.3.5 PHP/5.3.2 configured |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak | |
mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php.conf.disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoadModule php5_module modules/libphp5-zts.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum search zts | |
yum install php-zts mod_fcgid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The Communication timeout; your new max execution time variable | |
# The default is 20 seconds if omitted | |
IPCCommTimeout 60 | |
# Connection timeout: Default value is 3 seconds | |
IPCConnectTimeout 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_fcgid.c> | |
# Path to directory containing php.ini | |
DefaultInitEnv PHPRC=/etc/ | |
# Number of PHP children that will be launched. | |
#DefaultInitEnv PHP_FCGI_CHILDREN 3 | |
# Maximum requests before a process is stopped and a new one is launched. | |
#DefaultInitEnv PHP_FCGI_MAX_REQUESTS 5000 | |
# Define a new handler "php-fcgi" for ".php" files | |
AddHandler php-fcgi .php | |
# Add an action binding the new handler to an alias (see below) | |
Action php-fcgi /fcgi-bin/phpfcgi | |
# Define the MIME-Type for ".php" files | |
AddType application/x-httpd-php .php | |
# Define alias "/fcgi-bin/" used by the action above. | |
# Allows you to run a different command by overriding alias in vhosts | |
Alias /fcgi-bin/ /var/www/cgi-bin/ | |
# Turn on the fcgid-script handler for all files within the alias "/fcgi-bin/" | |
<Location /fcgi-bin/> | |
SetHandler fcgid-script | |
Options +ExecCGI | |
</Location> | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ln -s /usr/bin/php-cgi /var/www/cgi-bin/phpfcgi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#HTTPD=/usr/sbin/httpd.worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# service httpd restart | |
# apachectl graceful | |
/etc/init.d/httpd restart | |
# check log files to ensure a successful restart | |
# press ctrl+z to get out | |
tail -f /var/log/httpd/error.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment