注意此文仅供参考,请勿用于服务器环境中,本地测试完成后再用于生产环境中。
1、脚本下载解压和执行安装
1 2 3 4 | wget http://mirrors.linuxeye.com/lnmp-full.tar.gz #下载一键包 tar xzf lnmp-full.tar.gz #解压一键包 cd lnmp #进入lnmp目录 ./install.sh #执行install.sh |
参考配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | ####################################################################### # OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+ # # For more information please visit https://oneinstack.com # ####################################################################### Please input SSH port(Default: 22): Do you want to install Web server? [y/n]: y Please select Nginx server: 1. Install Nginx 2. Install Tengine 3. Install OpenResty 4. Do not install Please input a number:(Default 1 press Enter) 4 Please select Apache server: 1. Install Apache-2.4 2. Install Apache-2.2 3. Do not install Please input a number:(Default 3 press Enter) 1 Do you want to install Database? [y/n]: y Please select a version of the Database: 1. Install MySQL-5.7 2. Install MySQL-5.6 3. Install MySQL-5.5 4. Install MariaDB-10.1 5. Install MariaDB-10.0 6. Install MariaDB-5.5 7. Install Percona-5.7 8. Install Percona-5.6 9. Install Percona-5.5 Please input a number:(Default 2 press Enter) 1 Please input the root password of database: 此处为SQL密码 Do you want to install PHP? [y/n]: y Please select a version of the PHP: 1. Install php-5.3 2. Install php-5.4 3. Install php-5.5 4. Install php-5.6 5. Install php-7 Please input a number:(Default 3 press Enter) 4 Do you want to install opcode cache of the PHP? [y/n]: n Do you want to install ZendGuardLoader? [y/n]: y Do you want to install ionCube? [y/n]: n Do you want to install ImageMagick or GraphicsMagick? [y/n]: n Do you want to install Pure-FTPd? [y/n]: n Do you want to install phpMyAdmin? [y/n]: y Do you want to install redis? [y/n]: y Do you want to install memcached? [y/n]: y Do you want to use jemalloc or tcmalloc optimize Database and Web server? [y/n]: y Please select jemalloc or tcmalloc: 1. jemalloc 2. tcmalloc Please input a number:(Default 1 press Enter) 1 Do you want to install HHVM? [y/n]: n |
添加站点:
1 2 | cd /root/lnmp ./vhost.sh |
删除配置:
1 2 | cd lnmp ./uninstall.sh |
备份:
1 2 3 | cd /root/lnmp ./backup_setup.sh # 备份参数设置 ./backup.sh # 立即执行备份 |
其他命令:
1 2 3 4 5 6 7 8 9 10 | Nginx/Tengine: service nginx {start|stop|status|restart|reload|configtest} MySQL/MariaDB/Percona: service mysqld {start|stop|restart|reload|status} PHP: service php-fpm {start|stop|restart|reload|status} Apache: service httpd {start|restart|stop} HHVM: service supervisord {start|stop|status|restart|reload} |