How To Install Linux, Nginx, MySQL, PHP (LEMP) Stack on Debian 7

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 available.

At the moment, we only 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 will ask you to set a root password. If you miss the chance to set the password while the program is installing, it is very easy to set the password later from within the MySQL shell.

Once you have installed MySQL, we should activate it with this command:

3) Install and Configure Nginx on your VPS

Installation

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, 在http中加入以下代码,

      server {
        listen   80;

        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 500 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;

        }

     }

nginx.conf的第一行是user www-data;

把这个项目目录的权限修改下

sudo chown -R www-data:www-data /opt/app/blog/wz/wordpress/

4) Install and Configure PHP

Installation

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

sudo apt-get install php5-fpm php5-mysql
sudo service nginx restart
sudo service php5-fpm restart
时间: 2024-12-15 01:33:07

How To Install Linux, Nginx, MySQL, PHP (LEMP) Stack on Debian 7的相关文章

How To Install Linux, nginx, MySQL, PHP (LEMP) stack on CentOS 6

About Lemp LEMP stack is a group of open source software to get web servers up and running. The acronym stands for Linux, nginx (pronounced Engine x), MySQL, and PHP. Since the server is already running CentOS, the linux part is taken care of. Here i

Install LEMP (Linux, Nginx, MySQL and PHP) Stack on Ubuntu Linux 14.04 LTS(转)

Install LEMP (Linux, Nginx, MySQL and PHP) Stack on Ubuntu Linux 14.04 LTS Nginx Installation Nginx is one of the robust web server in Linux world. Nginx is a free, open source, high performance HTTP server and reverse proxy, as weell as an IMAP/POP3

How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu

About LAMP LAMP stack is a group of open source software used to get web servers up and running. The acronym stands for Linux, Apache, MySQL, and PHP. Since the virtual private server is already running Ubuntu, the linux part is taken care of. Here i

在ubuntu中用apt-get安装LEMP栈(linux+nginx+mysql+php)

在ubuntu上安装lamp大家应该都很熟悉了,但对于现在很流行的lemp栈怎么样用apt-get安装,这样介绍的文章的不多.下面我用Ubuntu 12.04 LTS为例来介绍下如何用apt-get安装这些. 为什么要用apt-get不用编译安装 用包管理除了可以方便统一的管理软件外,他还可以帮你搞定启动脚本,自动更新等一大堆麻烦的问题.其实大多数人用的编译安装,也是使用的默认编译参数,大多数定制化的东西都可以通过配置文件完成.如果你对编译的定制化比较高,甚至可以自己做一个私有源来放你自己编译的

centos6 LNMP的搭建(linux+nginx+mysql+php)

LNMP的搭建(linux+nginx+mysql+php) 简介 LNMP代表的就是:Linux系统下Nginx+MySQL+PHP网站服务器架构. Linux是一类Unix计算机操作系统的统称,是目前最流行的免费操作系统.代表版本有:debian.centos.ubuntu.fedora.gentoo等. Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器. Mysql是一个小型关系型数据库管理系统. PHP是一种在服务器端执行的嵌入HTML文档

LAMP架构演进到LAMPGC,再演进到LNMLGC(linux+nginx+mysql+lua+gearman+C)

LAMP是一个大众的架构了,linux+apache+mysql+php 在我们系统的架构中,做了进一步的演进,linux+apahce+mysql+php+gearman+C php作页面的展示 核心业务逻辑由C语言实现,php通过gearman中间件调用C任务 由于apache在高并发方面不太给力,因此在需要高并发的场景中,我们进一步演进,linux+nginx+mysql+php+lua+gearman+C 页面部分由nginx+fastcgi+php-fpm来展示 高并发的业务调用由ng

centos7安装Lnmp(Linux+Nginx+MySql+Php+phpMyAdmin+Apache)

centos7安装Lnmp(Linux+Nginx+MySql+Php)及Apache Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx是一个高性能的HTTP和反向代理服务器,Nginx 超越 Apache 的高性能和稳定性,使得国内使用 Nginx 作为 Web 服务器的网站也越来越多, 我们学习PHP,以及搭建我们自己的LNMP环境,不妨先在本机上尝试学习,下面我们一步一步来完成在CentOS7 下安装LNMP(Linux+Nginx+MySQL+PHP)及Apache. 查

linux+nginx+mysql+php

LNMP(linux+nginx+mysql+php)服务器环境配置 一.简介 Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx,它的发音为 “engine X”, 是一个高性能的HTTP和反向代理服务器,同时也是一个IMAP/POP3/SMTP 代理服务器.Nginx是由俄罗斯人 Igor Sysoev为俄罗斯访问量第二的 Rambler.ru站点开发的,它已经在该站点运行超过三年了.Igor Sysoev在建立的项目时,使用基于BSD许可. 在高并发连接的情况下,Nginx是

如何搭建LNMP环境(Linux+Nginx+MySql+Php)来运行wordpress

一.前言 今天是周六,积累了很多天的内容都要在今天来释放了,因为最近想弄一个自己的主页,查看网上之后,都说wordpress很不错,他是一个开源的后台程序,可以用来搭建自己的博客,论坛等功能.但是有一个蛋疼的地方,他是php写的,之前只弄过JavaWeb相关的后台程序,php不太熟呢,以前也是搭建过Linux+Apache+Tomcat+JavaWeb+MySql,那么这次也正好是一个机会学习一下如何搭建后台PHP系统,这里也是网上比较流行的后台系统组合:Linux+Nginx+MySql+Ph