How to Install Linux, Nginx, MySQL, PHP (LEMP) stacks on Debian 7

Source: Internet
Author: User
Tags fpm install php

Https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-debian-7

https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu-14-04

1) Update Apt-get

The apt-get Update command is used to re-synchronize, the package, index files from their sources. If used in combination with the Apt-get Upgrade command, they install the newest versions of all packages currently Availa ble.

At the moment, we have need to do a thorough update:

sudo apt-get update
2) Install MySQL on your VPS

MySQL is a powerful database management system used for organizing and retrieving data

To install MySQL, open terminal and type in these commands:

sudo apt-get install Mysql-server


During the installation, MySQL would ask you to set a root password. If you miss the chance to set the password and the program is installing, it's very easy-to-set the password later from Within the MySQL shell.

Once you has installed MySQL, we should activate it with the This command:

3) Install and Configure Nginx on your vpsinstallation

Initial installation is simple with the Apt-get command.

sudo apt-get install Nginx


Nginx needs a command to begin running:

sudo service nginx start
Configuration

Vim/etc/nginx/nginx.conf, add the following code to the HTTP

  server {listen  ;        Root /opt/app/blog/wz/wordpress/;        Index index.php index.html index.htm;        server_name iwangzheng.com;        Location / {try_files $uri $uri // index.html;        } error_page  404/404 . html;                Error_page  502 503 504/ 50x.html;        Location  =/ 50x.html {root /usr/share/nginx/ www;                } location  ~  \.php$ {try_files $uri  =404 ;                Fastcgi_pass Unix: /var/run/php5- Fpm.sock;                Fastcgi_index index.php;                Fastcgi_param script_filename $document _root$fastcgi_script_name;        Include Fastcgi_params; }     }

The first line of nginx.conf is User www-data;

Modify the permissions of this project directory

sudo chown-r www-data:www-data/opt/app/blog/wz/wordpress/
4) Install and Configure phpinstallation

You probably guessed it! We'll use the apt-get command to install PHP-FPM:

sudo apt-get install php5-fpm php5-mysql


sudo service nginx restartsudo service php5-fpm restart



How to Install Linux, Nginx, MySQL, PHP (LEMP) stacks on Debian 7

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.