Skip to content

Instantly share code, notes, and snippets.

@kalpesh-fulpagare
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save kalpesh-fulpagare/9407142 to your computer and use it in GitHub Desktop.

Select an option

Save kalpesh-fulpagare/9407142 to your computer and use it in GitHub Desktop.
RoR app with Wordpress on Nginx
$ cd /var/www
$ ll
drwxr-xr-x 5 root root 4096 Mar 7 12:52 wp
Installing php5-fpm
sudo apt-get install php5-fpm
php5-fpm configuration.Open up www.conf:
sudo nano /etc/php5/fpm/pool.d/www.conf
Find the line, listen = 127.0.0.1:9000, and change the 127.0.0.1:9000 to /var/run/php5-fpm.sock and change with
listen = /var/run/php5-fpm.sock
Restart php-fpm:
sudo service php5-fpm restart
www contains wordpress folder which is renamed as wp
Edit wp-config.php file in wp folder to add database details.
server {
listen 80;
server_name localhost;
root /home/kalpesh/rails_demo/public;
passenger_enabled on;
rails_env development;
location /wp {
root /var/www;
index index.php index.html index.htm;
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_read_timeout 300;
client_max_body_size 5M;
}
}
}
nginx log files
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
solving gateway timeout issue in php during wordpress setup
sudo nanno /etc/php5/fpm/php.ini
max_execution_time = 300 # Changed from 30 to 300
sudo service nginx restart
add at he bottom of wp-config.php
to allow upload and extraction of themes
define('FS_METHOD', 'direct');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment