Click here to load reader
Upload
marcus-sa
View
2.632
Download
0
Embed Size (px)
Citation preview
Speed up your development environment
PHP + Nginx + Fedora + PG
Marcus SáDeveloper | Woompa
[email protected]@sa_vini
Scenario
● Ruby developer● PHP is the customer's requirement
● Development environment not installed● Very tight deadline (O RLY?)
Decisions taken
● Avoid complexity*● Use PHP to develop
● Install environment: PHP, PostgreSQL, Nginx● Using a CMS (Joomla will take care)
Avoid complexity*
● Develop the minimum possible● Use modules and components already made
● Focus on the important things
Installing environment
● Update your system● Install Nginx● Install PHP
● Install PostgreSQL● Configure Nginx
Update your system
$ yum update
Install NginxInstalling nginx$ yum install nginxSet it to start on boot$ chkconfig nginx onStart right now!$ service nginx start
sudo if needed
Configure Nginxserver {
server_name www.example.com example.com;root /srv/www/www.example.com/public_html;
location / { index index.html index.htm;}
location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:53217; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}
}
Install PHPinstall packages required for PHP-FastCGI$ yum install php spawn-fcgiSet it to start on boot$ chkconfig spawn-fcgi onStart right now!$ service spawn-fcgi start
sudo if needed
Configure PHPediting spawn-fcgi
$ nano /etc/sysconfig/spawn-fcgi
FASTCGI_USER=nginxFASTCGI_GROUP=nginxSOCKET=/var/run/spawn-fcgi.sockPIDFILE=/var/run/spawn-fcgi.pidPHP5_SOCKET=/var/run/php-fcgi.sockCHILDREN=6PHP5=/usr/bin/php-cgiMODE=0600OPTIONS="-s $PHP5_SOCKET -S -M $MODE -P $PIDFILE -C $CHILDREN -u $FASTCGI_USER -g $FASTCGI_GROUP -f $PHP5"
sudo if needed
Install PostgreSQL
Download it
http://www.enterprisedb.com/Make executable$ chmod +x postgre_file.binExecute and install
$ ./postgre_file.binsudo if needed
That's all folks
Thanks!