maicong/LNMP


Support: Nginx 1.12/1.13 + MySQL 5.5/5.6/5.7/8.0(MariaDB 5.5/10.0/10.1/10.2/10.3) + PHP 5.4/5.5/5.6/7.0/7.1/7.2 + phpMyAdmin(Adminer)

License: MIT

Language: Shell

Keywords: centos7, lnmp, mariadb, mysql, nginx, php


CentOS 7 YUM 安装 LNMP 环境

CentOS 7 YUM Installation: Nginx 1.8/1.9 + MySQL 5.5/5.6/5.7 + PHP 5.5/5.6/7.0

主要目录

站点: /home/wwwroot/

备份: /home/backup/

MySQL 数据: /home/userdata/

MySQL 配置: /etc/my.cnf.d/

Nginx 配置(启用):/etc/nginx/conf.d/

Nginx 配置(禁用):/etc/nginx/conf.d.stop/

PHP 配置(启用):/etc/php-fpm.d/

PHP 配置(禁用):/etc/php-fpm.d.stop/

phpMyAdmin 配置: /etc/phpMyAdmin/

安装

# 安装 wget 和 unzip
yum install -y wget unzip

# 下载安装包
wget https://github.com/maicong/LNMP/archive/master.zip

# 解压安装包
unzip master.zip && cd LNMP-master

# 执行安装命令
bash lnmp.sh

# 如果想查看安装日志,可以将 log 输出到指定文件
# bash lnmp.sh 2>&1 | tee lnmp.log

服务管理

# 启动 MySQL
systemctl start mysqld.service

# 停止 MySQL
systemctl stop mysqld.service

# 重启 MySQL
systemctl restart mysqld.service

# 启动 PHP
systemctl start php-fpm.service

# 停止 PHP
systemctl stop php-fpm.service

# 重启 PHP
systemctl restart php-fpm.service

# 启动 Nginx
systemctl start nginx.service

# 停止 Nginx
systemctl stop nginx.service

# 重启 Nginx
systemctl restart nginx.service

站点管理

service vhost (start,stop,list,add,edit,del,exit) <domain> <server_name> <index_name> <rewrite_file> <host_subdirectory>

参数说明

  • start 启动

  • stop 停止

  • list 列出

  • add 添加

  • edit 编辑

  • del 删除

  • exit 什么都不做

  • <domain> 标识名称,默认:domain

  • <server_name> 域名列表,默认:domain.com,www.domain.com

  • <index_name> 首页文件,默认:index.html,index.htm,index.php

  • <rewrite_file> 伪静态规则文件,保存在 /etc/nginx/rewrite/,默认:nomal.conf

  • <host_subdirectory> 是否支持子目录绑定,on 或者 off,默认 off

参数示例

# 添加一个标识为 `mysite`,域名为 `mysite.com` 的站点
service vhost add mysite mysite.com

# 启动标识为 `mysite` 的站点
service vhost start mysite

# 停止标识为 `mysite` 的站点
service vhost stop mysite

# 编辑标识为 `mysite` 的站点
service vhost edit mysite

# 删除标识为 `mysite` 的站点
service vhost del mysite

# 列出所有站点
service vhost list

伪静态文件

# 增加一个 `wordpress` 伪静态文件
touch /etc/nginx/rewrite/wordpress.conf

# 修改 `mysite` 站点的配置
service vhost edit mysite mysite.com,www.mysite.com index.html,index.php,default.php wordpress.conf on

备份

service vbackup (start,list,del) <delete name.tar.gz>

参数说明

  • start 添加

  • list 列出

  • del 删除

  • <delete name.tar.gz> 需要删除的备份文件名称,和 del 搭配使用,存放在 /home/backup/

参数示例

# 添加一个新的备份
service vbackup start

# 列出备份文件
service vbackup list

# 删除一个备份
service vbackup del c7-20151010-101010.tar.gz

示例图

协议

The MIT License (MIT)

Project Statistics

Sourcerank 6
Repository Size 598 KB
Stars 238
Forks 93
Watchers 21
Open issues 0
Dependencies 0
Contributors 1
Tags 7
Created
Last updated
Last pushed

Top Contributors See all

MaiCong

Recent Tags See all

v3.0.0 January 31, 2018
LNMP3.0.0-beta2 December 12, 2017
LNMP3.0.0-beta1 April 12, 2016
v2.0.0 February 23, 2016
v2.0 February 22, 2016
v1.0.0 November 26, 2015
v1.0 November 26, 2015

Interesting Forks See all

lerre/LNMP
CentOS 7 YUM Installation: Nginx 1.8/1.9 + MySQL 5.5/5.6/5.7(MariaDB 5.5/10.0/10.1) + PHP 5.5/5.6...
PHP - Updated - 1 stars - 1 forks
TONYHEAD/LNMP
CentOS 7 YUM Installation: Nginx 1.8/1.9 + MySQL 5.5/5.6/5.7(MariaDB 5.5/10.0/10.1) + PHP 5.5/5.6...
PHP - Last pushed - 1 stars
simon-sun/LNMP
CentOS 7 YUM Installation: Nginx 1.8/1.9 + MySQL 5.5/5.6/5.7(MariaDB 5.5/10.0/10.1) + PHP 5.5/5.6...
PHP - Published - 1 stars
yeyeyuky/LNMP
CentOS 7 YUM Installation: Nginx 1.8/1.9 + MySQL 5.5/5.6/5.7(MariaDB 5.5/10.0/10.1) + PHP 5.5/5.6...
This repository is no longer available - 1 stars
jackzhangsir/LNMP
CentOS 7 YUM Installation: Nginx 1.8/1.9 + MySQL 5.5/5.6/5.7 + PHP 5.5/5.6/7.0
PHP - Updated - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2017-11-24 18:37:31 UTC

Login to resync this repository