You have 5 options for your DataBase install.
1: Install MySQL 5.1.732: Install MySQL 5.5.53 (Default)
3: Install MySQL 5.6.344: Install MySQL 5.7.165: Install MariaDB 5.5.536: Install MariaDB 10.0.287: Install MariaDB 10.1.190: DO NOT Install MySQL/MariaDB
Enter your choice (1, 2, 3, 4, 5, 6, 7or0):
此处根据所需选择,如果使用的上述服务器,请选择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即可。
You will install MySQL 5.5.53
===========================
Please setup root password of MySQL.(Default password: root)
Please enter:
输入密码回车或直接回车,直接回车默认密码为root。此处做实验我选择默认,个人实际使用请修改。
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存储引擎。我选择默认。
No input,The InnoDB Storage Engine will enable.
===========================
You have 6 options for your PHP install.
1: Install PHP 5.2.172: Install PHP 5.3.293: Install PHP 5.4.454: Install PHP 5.5.38 (Default)
5: Install PHP 5.6.306: Install PHP 7.0.157: Install PHP 7.1.1
Enter your choice (1, 2, 3, 4, 5, 6or7):
输入选项然后回车或者直接回车,直接回车默认安装PHP5.5.38版本。我选择默认。
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 Jemalloc
3: Install TCMalloc
输入选项然后回车或者直接回车,直接回车默认不安装内存分配器。我选择默认。
此时出现
Press any key to install...or Press Ctrl+c to cancel
当然是摁任意键啦,一般都是回车咯。
然后出现一大堆信息。前几行如下:
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/varDefault 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... done
Add mysql service at system startup...
Starting MySQL... SUCCESS!
Add php-fpm service at system startup...
Starting php-fpm done
============================== Check install ==============================
Checking ...
Nginx: OK
MySQL: OK
PHP: OK
PHP-FPM: OK
Clean 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 715713) 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.
# 进入根目录上一级目录
cd /home/wwwroot/
# 将default重命名为old
mv default old
# 下载WordPress包中文版
wget https://cn.wordpress.org/wordpress-4.7.2-zh_CN.tar.gz# 解压WordPress包
tar -zxvf wordpress-4.7.2-zh_CN.tar.gz
# 查看解压后的文件夹名,此处是wordpress,估计应该都是吧,看看保险啊
[root@vultr wwwroot]# ls
old wordpress wordpress-4.7.2-zh_CN.tar.gz
# 将wordpress重命名为default
mv wordpress default# 再次查看检验
[root@vultr wwwroot]# lsdefault old wordpress-4.7.2-zh_CN.tar.gz
给相应目录授权
# 目录以及目录下的文件授权
[root@vultr wwwroot]# chown -R 755 /home/wwwrootchown: changing ownership of ‘/home/wwwroot/old/.user.ini’: Operation not permitted
# 将目录的所有者分给www组下的www用户。
[root@vultr wwwroot]# chown -R www:www /home/wwwroot/chown: changing ownership of ‘/home/wwwroot/old/.user.ini’: Operation not permitted
出现的提示大概是说有一个文件无法更改用户分组和权限。不会影响你的wordpress,忽略就好。
创建一个数据库wordpress
# 登录数据库
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 its
affiliates. 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