Git Product home page Git Product logo

lnmp's Introduction

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
phpMyAdmin
Adminer

Using source code compile

OpenSSL 1.1.0f
Nginx 1.13.7
PHP 7.2.0

Installing

Using YUM packages:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/maicong/LNMP/master/lnmp.sh)"

Using source code compile:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/maicong/LNMP/master/source.sh)"

Using

Service management

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

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

# PHP
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: domain.com,www.domain.com
  • <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

Example

# 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 `mysite.com`
service vhost add mysite mysite.com

# 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

Backup

# create a new backup
service vbackup start

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

# list all backup
service vbackup list

Agreement

The MIT License (MIT)

lnmp's People

Contributors

maicong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lnmp's Issues

很遗憾,安装功败垂成

在安装的末尾:
Error: Package: php-mcrypt-5.5.38-7.el7.remi.x86_64 (remi-php55)
Requires: libmcrypt.so.4()(64bit)
Error: Package: php-mssql-5.5.38-7.el7.remi.x86_64 (remi-php55)
Requires: libsybdb.so.5()(64bit)
Error: Package: php-mssql-5.5.38-7.el7.remi.x86_64 (remi-php55)
Requires: libct.so.4()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[Notice] Config service ...
mv: cannot stat '/etc/php-fpm.d/': No such file or directory
mv: cannot stat '/etc/php.ini': No such file or directory
mv: cannot stat '/etc/nginx/conf.d/
': No such file or directory
mv: cannot stat '/etc/nginx/nginx.conf': No such file or directory
mv: cannot stat '/etc/nginx/fastcgi_params': No such file or directory
[Notice] Start service ...
Created symlink from /etc/systemd/system/mysql.service to /usr/lib/systemd/system/mysqld.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/mysqld.service to /usr/lib/systemd/system/mysqld.service.
Failed to execute operation: No such file or directory
Failed to execute operation: No such file or directory
Job for firewalld.service failed because the control process exited with error code. See "systemctl status firewalld.service" and "journalctl -xe" for details.
Traceback (most recent call last):
File "/usr/bin/firewall-cmd", line 24, in
from gi.repository import GObject
File "/usr/lib64/python2.7/site-packages/gi/init.py", line 37, in
from . import _gi
ImportError: /usr/lib64/python2.7/site-packages/gi/_gi.so: undefined symbol: g_type_check_instance_is_fundamentally_a
Traceback (most recent call last):
File "/usr/bin/firewall-cmd", line 24, in
from gi.repository import GObject
File "/usr/lib64/python2.7/site-packages/gi/init.py", line 37, in
from . import _gi
ImportError: /usr/lib64/python2.7/site-packages/gi/_gi.so: undefined symbol: g_type_check_instance_is_fundamentally_a
Traceback (most recent call last):
File "/usr/bin/firewall-cmd", line 24, in
from gi.repository import GObject
File "/usr/lib64/python2.7/site-packages/gi/init.py", line 37, in
from . import _gi
ImportError: /usr/lib64/python2.7/site-packages/gi/_gi.so: undefined symbol: g_type_check_instance_is_fundamentally_a
Failed to start php-fpm.service: Unit not found.
Failed to start nginx.service: Unit not found.
mysqladmin: connect to server at 'restorevps.com' failed
error: 'Access denied for user 'root'@'restorevps.com' (using password: YES)'
[LNMP] Sorry, Install Failed.
服务器在洛杉矶

aliyun centos 7.2 mysql5.6安装失败

安装脚本跑到最后出现如下错误,
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'izbpxxxxxx' failed
error: 'Access denied for user 'root'@'izbpxxxxxx' (using password: YES)'
Warning: Using a password on the command line interface can be insecure.

mysql 5.6安装失败

Start up bug

Great set of scripts.

I have installed on Centos 7 and when I reboot I get "502 Bad Gateway" when visiting PHP pages.

I think this is the error:
[12-Apr-2018 16:11:26] ERROR: Unable to create the PID file (/run/php-fpm/php-fpm-index.pid).: No such file or directory (2)

To get around this I have added the following to /etc/rc.local

mkdir /run/php-fpm
service vhost stop
service vhost start

[LNMP] Sorry, Install Failed.

[Notice] Start service ...
lnmp.sh: line 392: systemctl: command not found
lnmp.sh: line 393: systemctl: command not found
lnmp.sh: line 394: systemctl: command not found
lnmp.sh: line 395: systemctl: command not found
lnmp.sh: line 397: systemctl: command not found
lnmp.sh: line 399: firewall-cmd: command not found
lnmp.sh: line 400: firewall-cmd: command not found
lnmp.sh: line 401: firewall-cmd: command not found
lnmp.sh: line 403: systemctl: command not found
lnmp.sh: line 404: systemctl: command not found
lnmp.sh: line 405: systemctl: command not found
lnmp.sh: line 407: mysqladmin: command not found
lnmp.sh: line 408: mysqladmin: command not found
lnmp.sh: line 409: mysql: command not found

添加vhost之后,出现502错误

默认是一个vhost。现在用service vhost add再添加一个vhost,比如叫做foo。那么一旦启用foo,重启服务器,所有站点都会502.看log发现是php-fpm的管道没有建立。但是php-fpm不报错。service php-fpm restart无效。

故障排查,逐个删除vhost,删除index或者foo,只留下一个vhost,service php-fpm restart ,可以正常生成管道文件,网站可以访问。

so,配置文件哪里有冲突么?我是Nginx新手看不出来……

环境:Cent OS 7, OVZ的Minimum模板。

mysql启动不了

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/home/userdata/mysqld.sock'

一键脚本安装PHPMYADMIN登录错误

麦葱, 你好, 按你的一键脚本安装完成,PHPMYADMIN页面能正常访问,但输入ROOT及密码后,提示#2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).,求解决方法。谢谢

Centos7 安装出错。。。。

[Notice] Config service ...
mv: 无法获取"/etc/nginx/conf.d/*" 的文件状态(stat): 没有那个文件或目录
chown: 无效的用户: "mysql:mysql"
[Notice] Start service ...
Failed to execute operation: No such file or directory
Created symlink from /etc/systemd/system/multi-user.target.wants/php-fpm.service to /usr/lib/systemd/system/php-fpm.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
success
success
success
Failed to start mysqld.service: Unit mysqld.service failed to load: No such file or directory.
lnmp.sh:行407: mysqladmin: 未找到命令
lnmp.sh:行408: mysqladmin: 未找到命令
lnmp.sh:行409: mysql: 未找到命令
[LNMP] Sorry, Install Failed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.