侧边栏壁纸
博主头像
网事无痕 博主等级

恍若青春正好 不期皮囊日憔

  • 累计撰写 20 篇文章
  • 累计创建 1 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

在玩客云armbian系统内安装lnmp 网站环境

九月
2024-07-12 / 0 评论 / 0 点赞 / 33 阅读 / 0 字

启动nginx服务:

sudo service nginx restart

启动php7.0服务

sudo service php7.0-fpm restart

重启mysql服务

sudo service mysql restart

安装lnmp 网站环境

教程网址

https://www.rstk.cn/news/1115057.html?action=onClick

https://demo.dandelioncloud.cn/article/details/1593414697087062017

https://zhuanlan.zhihu.com/p/344979476

卸载数据库教程

https://www.python100.com/html/M3BIT122T84H.html

1.安装N

apt-get -y install nginx

2.3安装php7.4

apt install -y php7.4 php7.4-fpm php7.4-mysql php7.4-gd php7.4-curl php7.4-mbstring php7.4-xml php7.4-xmlrpc php7.4-json php7.4-zip php7.4-intl php7.4-xsl

3.安装数据库

apt install -y mariadb-server

3.1配置nginx

首先输入vim /etc/nginx/sites-enabled/default,打开nginx配置文件

vim /etc/nginx/sites-enabled/default

在44行前面添加index.php,56.57行和60行以及63行去除行头#号

输入nginx -t

root@aml-s812:~# nginx -t

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok

nginx: configuration file /etc/nginx/nginx.conf test is successful

表示没有问题

重新启动nginx

service nginx restart

3.2配置Mariadb

3.2.1安全设置

输入mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the current

password for the root user. If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.Enter current password for root (enter for none):

注意:建议所有人都运行此脚本的所有部分服务器在生产中使用!请仔细阅读每一步!为了登录MariaDB以确保其安全,我们需要当前根用户的密码。如果你刚刚安装了MariaDB您尚未设置根密码,密码将为空,所以你应该在这里按回车键。输入root用户的当前密码(输入无):

我们刚刚安装,没有密码直接回车

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.You already have a root password set, so you can safely answer 'n'.Change the root password? [Y/n]

设置root密码可以确保任何人都无法登录MariaDB未经适当授权的root用户。您已经设置了根密码,因此可以安全地回答“n”。更改根密码?[是/否]

输入y设置一个简单而且你记得住密码 我这里是P@ssW0

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB 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? [Y/n]

默认情况下,MariaDB安装有匿名用户,允许任何人登录MariaDB而无需为其创建用户帐户他们这仅用于测试和安装再平稳一点。你应该在搬进公寓前把它们取下来生产环境。删除匿名用户?[是/否]

y 删除就完了

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? [Y/n]

通常,root用户只能从“localhost”连接。这确保有人无法从网络中猜到根密码。不允许根用户远程登录?[是/否]

n方便修改

By default, MariaDB 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? [Y/n]

默认情况下,MariaDB附带一个名为“test”的数据库,任何人都可以使用通道这也仅用于测试,应移除在进入生产环境之前。删除测试数据库并访问它?[是/否]

n没有用直接删除

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.Reload privilege tables now? [Y/n]

重新加载特权表将确保迄今为止所做的所有更改将立即生效。现在重新加载特权表吗?[是/否]

y

3.2.2 账户设置

直接输入mysql直接登录

mysql

查询用户表

select User,host from mysql.user;

使用mysql数据库

use mysql;

GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY '6166b2002fdcb5df' WITH GRANT OPTION;

ALTER USER 'root'@'%' IDENTIFIED BY '6166b2002fdcb5df';

ALTER USER 'root'@'localhost' IDENTIFIED BY 'P@ssW0rd';

update user set plugin = 'mysql_native_password' where user = 'root';

添加一个可以从任何地址登录的root账户密码建议复杂一点

flush privileges;

刷新

exit退出

vim /etc/mysql/mariadb.conf.d/50-server.cnf

把29行bind-address = 127.0.0.1 改为 bind-address = 0.0.0.0

systemctl restart mysql

重启Mariadb

3.2.2 远程连接MySQL

mysql -u root -p -h 10.0.0.109

拿cmd连接看看

4.1新增wordpress账户

create user wordpress@'10.0.0.%' identified by '02fdcb5df';

create database www_wordpress default charset utf8;

grant all on www_wordpress.* to wordpress@'10.0.0.%' identified by '02fdcb5df';

新建账户,新建数据库,给权限

5.Wordpres使用

5.1下载Wordpres

wget https://cn.wordpress.org/latest-zh_CN.tar.gz

tar xvzf latest-zh_CN.tar.gz

rm -rf html

mv wordpress html

给www的读写权限

chown -R www-data /var/www/html

chmod -R 755 /var/www/html

5.1wordpres

浏览器输入ip

按自己的输入信息

安装完成

---------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------

0

评论区