# 下载,后边的路径直接粘贴就好。XShell上面复制快捷键是ctrl+insert,粘贴快捷键是Shift+insert,mac上面是我们熟悉的 command+c,command+v wget http://soft.vpser.net/lnmp/lnmp1.4beta.tar.gz # 解压 tar -zxvf lnmp1.4beta.tar.gz # 进入lnmp目录 cd lnmp1.4 # 执行install.sh进行安装 ./install.sh
lnmp
依次输入你要安装的选项前的数字并回车即可下一步。
MYSQL 选项
1 2 3 4 5 6 7 8 9
You have 5 options for your DataBase install. 1: Install MySQL 5.1.73 2: Install MySQL 5.5.53 (Default) 3: Install MySQL 5.6.34 4: Install MySQL 5.7.16 5: Install MariaDB 5.5.53 6: Install MariaDB 10.0.28 7: Install MariaDB 10.1.190: DO NOT Install MySQL/MariaDB Enter your choice (1, 2, 3, 4, 5, 6, 7 or 0):
此处根据所需选择,如果使用的上述服务器,请选择2或者直接回车。我选择默认。
注意:安装MySql时,如果选择太高的版本安装会被拒绝,提示信息如下 Memory less than 1GB, can't install MySQL 5.6, 5.7 or MairaDB 10!。根据个人手动安装MySql5.7的经验来看,此768MB内存的服务器在运行一个nginx,mysql,php时还好,倘若再运行一个tomcat,mysql将会不定期down掉。所以此处选择一个低版本的5.5MySql即可。
1 2 3 4
You will install MySQL 5.5.53 =========================== Please setup root password of MySQL.(Default password: root) Please enter:
输入密码回车或直接回车,直接回车默认密码为root。此处做实验我选择默认,个人实际使用请修改。
1 2 3 4
MySQL root password: root =========================== Do you want to enable or disable the InnoDB Storage Engine? Default enable,Enter your choice [Y/n]:
输入Y或者n然后回车或直接回车,直接回车默认启用InnoDB存储引擎。我选择默认。
1 2 3 4 5 6 7 8 9 10 11
No input,The InnoDB Storage Engine will enable. =========================== You have 6 options for your PHP install. 1: Install PHP 5.2.17 2: Install PHP 5.3.29 3: Install PHP 5.4.45 4: Install PHP 5.5.38 (Default) 5: Install PHP 5.6.30 6: Install PHP 7.0.15 7: Install PHP 7.1.1 Enter your choice (1, 2, 3, 4, 5, 6 or 7):
输入选项然后回车或者直接回车,直接回车默认安装PHP5.5.38版本。我选择默认。
1 2 3 4 5
You will install PHP 7.1.1 =========================== You have 3 options for your Memory Allocator install. 1: Don't install Memory Allocator. (Default) 2: Install Jemalloc3: Install TCMalloc
输入选项然后回车或者直接回车,直接回车默认不安装内存分配器。我选择默认。
此时出现
1
Press any key to install...or Press Ctrl+c to cancel
当然是摁任意键啦,一般都是回车咯。
然后出现一大堆信息。前几行如下:
1 2 3 4 5 6 7 8 9 10 11 12 13
You will install lnmp stack. nginx-1.10.3 mysql-5.5.53 php-5.5.38 Enable InnoDB: y Print lnmp.conf infomation... Download Mirror: http://soft.vpser.net Nginx Additional Modules: PHP Additional Modules: Database Directory: /usr/local/mysql/var Default Website Directory: /home/wwwroot/default CentOS release 6.8 (Final) Kernel \r on an \m
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.Add Startup and Starting LNMP...Add nginx service at system startup...Starting nginx... doneAdd mysql service at system startup...Starting MySQL... SUCCESS! Add php-fpm service at system startup...Starting php-fpm done ============================== Check install ============================== Checking ...Nginx: OKMySQL: OKPHP: OKPHP-FPM: OKClean src directory...+------------------------------------------------------------------------+| LNMP V1.4 for CentOS Linux Server, Written by Licess |+------------------------------------------------------------------------+| For more information please visit https://lnmp.org |+------------------------------------------------------------------------+| lnmp status manage: lnmp {start|stop|reload|restart|kill|status} |+------------------------------------------------------------------------+| phpMyAdmin: http://IP/phpmyadmin/ || phpinfo: http://IP/phpinfo.php || Prober: http://IP/p.php |+------------------------------------------------------------------------+| Add VirtualHost: lnmp vhost add |+------------------------------------------------------------------------+| Default directory: /home/wwwroot/default |+------------------------------------------------------------------------+| MySQL/MariaDB root password: root |+------------------------------------------------------------------------++-------------------------------------------+| Manager for LNMP, Written by Licess |+-------------------------------------------+| https://lnmp.org |+-------------------------------------------+nginx (pid 715 713) is running...php-fpm is runing! SUCCESS! MySQL running (1247)Active Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp6 0 0 :::22 :::* LISTEN Install lnmp V1.4 completed! enjoy it.
# 登录数据库 mysql -u root -p # 输入密码默认的话就是root,否则就是你自己之前设置的那个 # 登录进来之后,看到这样一些东西 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.5.53-log Source distribution Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> # 不用理会上面的,创建我们的数据库,比如名字为wordpress。记得加分号。 mysql> create database wordpress; # 看一下,有没有我们创建的数据库 mysql> show databases; # 大概看到如下内容。意味着这一步也没问题。 +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | wordpress | +--------------------+ 4 rows in set (0.01 sec) # 退出mysql exit