nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
重载配置以生效
1
nginx -s reload
此时去浏览器访问你的 ip 已经会出现如下提示:
您的PHP似乎没有安装运行WordPress所必需的MySQL扩展。
则还需要安装 php-mysql
1
apt install php-mysql
此时距离完成就剩下安装数据库了
3. Mysql
3.1 安装
1
apt install mysql-server
安装完成后输入如下命令
1
mysql_secure_installation
如果显示:
1 2 3
Securing the MySQL server deployment.
Enter password for user root:
如果在安装的时候设置过 root 的密码,则输入密码后再 Enter,否则直接 Enter 跳过
接着:
1 2 3 4 5 6
VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component?
Press y|Y for Yes, any other key for No:
输入 y 然后 Enter
1 2 3 4 5 6 7
There are three levels of password validation policy:
LOW Length >= 8 MEDIUM Length >= 8, numeric, mixed case, and special characters STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG:
这里是设置密码强度校验,根据个人的密码强度选择即可
1 2 3 4 5 6 7 8
By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) :
删除匿名用户,输入 y 然后 Enter
1 2 3 4 5 6 7 8
Success.
Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) :
是否禁止 root 远程登录,一般选是,输入 y 然后 Enter
1 2 3 4 5 6 7 8 9
Success.
By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) :
是否删除测试数据库,选是,输入 y 然后 Enter
1 2 3 4 5 6 7 8 9
Success.
- Removing privileges on test database... Success.
Reloading the privilege tables will ensure that all changes made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) :
是否立即重新加载权限,选是,输入 y 然后 Enter
1 2 3
Success.
All done!
数据库初始化设置完成,输入以下命令进入数据库:
1
mysql -uroot -p
提示要输入密码:
1
Enter password:
输入前面设置的 root 的密码,然后 Enter,如果出现如下则证明成功进入数据库
1 2 3 4 5 6 7 8 9 10 11 12 13
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 10 Server version: 8.0.23-0ubuntu0.20.04.1 (Ubuntu)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
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'forhelp. Type '\c' to clear the current input statement.
mysql>
然后创建数据库
1
CREATE DATABASE IF NOTEXISTS wordpress DEFAULTCHARACTERSET= utf8mb4 DEFAULTCOLLATE= utf8mb4_general_ci;