Awesome Open Source
Awesome Open Source

CentOS 7 Install LNMP Environment


The version list is available to install

Using YUM packages:

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

Using source code compile

OpenSSL 1.1.0f
Nginx 1.13.7
PHP 7.2.0


Using YUM packages:

sh -c "$(curl -fsSL"

Using source code compile:

sh -c "$(curl -fsSL"


Service management

systemctl {start,stop,status,restart} mysqld.service

# MariaDB
systemctl {start,stop,status,restart} mariadb.service

systemctl {start,stop,status,restart} php-fpm.service

# Nginx
systemctl {start,stop,status,restart,reload} nginx.service

Site management

# list
service vhost list

# start(restart), stop
service vhost {start,stop} [<domain>]

# add, edit
service vhost {add, edit} [<domain>] [<server_name>] [<index_name>] [<rewrite_file>] [<host_subdirectory>]

# delete
service vhost del [<domain>]

Parameter declaration

  • start start|restart
  • stop stop
  • add add
  • edit edit
  • del delete
  • <domain> site sign, default: domain
  • <server_name> domain list, use , partition, default:,
  • <index_name> the file of home page, take effect in proper order, default: index.html,index.htm,index.php
  • <rewrite_file> rewrite rule file, save in /etc/nginx/rewrite/, default: nomal.conf
  • <host_subdirectory> whether support subdirectory bind, on or off, default: off


# start or restart all site
service vhost start

# stop all site
service vhost stop

# list all site
service vhost list

# add a sign of `mysite`, domain list is ``
service vhost add mysite

# start or restart the site which is sign `mysite`
service vhost start mysite

# stop the site which is sign `mysite`
service vhost stop mysite

# edit the site which is sign `mysite`
service vhost edit mysite

# delete the site which is sign `mysite`
service vhost del mysite


# create a new backup
service vbackup start

# delete a new backup
service vbackup del [<file>.tar.gz]

# list all backup
service vbackup list


The MIT License (MIT)

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
php (16,077
shell (9,985
mysql (1,002
nginx (476
mariadb (92
centos7 (17
lnmp (16

Find Open Source By Browsing 7,000 Topics Across 59 Categories