Last active
February 22, 2016 03:23
-
-
Save mifix/6163975 to your computer and use it in GitHub Desktop.
Setup and forget Apache Host and PHP configuration. (VirtualDocumentRoot and php-fpm)
This file contains hidden or 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
<Virtualhost *:80> | |
VirtualDocumentRoot /home/mayer/Work/Workspace/www/%1 | |
ServerName chm.dev | |
ServerAlias *.chm.dev | |
UseCanonicalName Off | |
<Directory "/home/mayer/Work/Workspace/www/*"> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
Allow from all | |
Require all granted | |
</Directory> | |
AddHandler php5-fcgi .php | |
Action php5-fcgi /php5-fcgi | |
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi | |
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9001 -pass-header Authorization | |
</Virtualhost> |
This file contains hidden or 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
[example.com] | |
listen = 127.0.0.1:9001 | |
listen.allowed_clients = 127.0.0.1 | |
user = mayer | |
group = mayer | |
pm = dynamic | |
pm.max_children = 50 | |
pm.start_servers = 20 | |
pm.min_spare_servers = 5 | |
pm.max_spare_servers = 35 | |
chdir = / | |
php_admin_value[open_basedir] = /var/www/:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/home/mayer/Work/Workspace/www |
This file contains hidden or 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
Prerequisites | |
============= | |
$ apt-get install apache2-mpm-worker libapache2-mod-fastcgi php5-fpm php5 php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl | |
$ a2enmod actions fastcgi alias rewrite vhost_alias | |
$ sudo service apache2 reload | |
$ sudo /etc/init.d/php5-fpm reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment