Last active
August 29, 2015 13:57
-
-
Save kalpesh-fulpagare/9407142 to your computer and use it in GitHub Desktop.
RoR app with Wordpress on Nginx
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
| $ 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