Skip to content

Instantly share code, notes, and snippets.

@ondrejmirtes
Created August 12, 2010 08:50
Show Gist options
  • Save ondrejmirtes/520597 to your computer and use it in GitHub Desktop.
Save ondrejmirtes/520597 to your computer and use it in GitHub Desktop.
sudo apt-get install apache2 php5-cgi libapache2-mod-fastcgi
cd /etc/apache2/mods-enabled/
sudo ln -s ../mods-available/actions.load
sudo ln -s ../mods-available/actions.conf
/etc/apache2/mods-enabled/fastcgi.conf:
====================
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
FastCgiIpcDir /var/lib/apache2/fastcgi
FastCgiConfig -autoUpdate
</IfModule>
/etc/apache2/sites-available/default:
===================
<VirtualHost *:80>
ServerAdmin webmaster@localhost
AddType application/fastcgi-php .php
Action application/fastcgi-php /cgi-bin/php5-fastcgi
DocumentRoot /var/www
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
SetHandler fastcgi-script
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
/usr/lib/cgi-bin/php5-fastcgi:
====================
#!/bin/sh
PHP_FCGI_CHILDREN=5
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php-cgi
Dále...
================
Zkontrolovat právo spouštění na /usr/lib/cgi-bin/php5-fastcgi.
Povolit si další potřebné moduly v Apache (ne přes konfigurační soubor, ale pomocí `sudo a2enmod nazevmodulu`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment