Linux, nginx, MySQL, PHP – LEMP AWS server setup
Step 1 : Create account on AWS and select right region for you create ec2 instance with Ubuntu AMI.
Step 2 : Do ssh login to server and update OS using command
sudo apt-get update
Step 3 : Lets install nginx, php, mysql one by one using following commands.
sudo apt-get install nginx
sudo apt-get install mysql-server
sudo apt-get install php5-fpm php5-mysql
Choices – we can decide where we want to setup our website, either default directory of ngnix or apache style in /var/www ?
Nginx + wordpress in default path
sudo chown -R www-data:www-data wp-content/uploads // for ubuntu sudo chown nginx:nginx * -R // for centos sudo usermod -a -G nginx username //for centos write permission
Increase php.ini
post_max_size
memory_limit
max_execution_time
file_upload_size
Nginx conf :
Add in sever directive –
client_max_body_size 2M;
client_header_buffer_size 32k;
large_client_header_buffers 2 16k;
fastcgi_buffers 2 16k;
fastcgi_buffer_size 16k;
WordPress pretty permalink fix in nginx conf file : –
location / { try_files $uri $uri/ /index.php?$args; }