Zabbix部署
文章目录
一、LNMP安装环境
1、安装nginx1.14
wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
#需要搭配本地源,千万不要移动到别的地方
vim /etc/yum.repos.d/nginx.repo
#手动创建nginx yum安装源
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
其中baseurl=http/nginx.org/packages/OS/OSRELEASE/$basearch/,把"” OS”替换成” rhel”或" centos”,把” OSRELEASE”替换成”6”或”7”
yum clean all
yum list
yum install nginx -y #安装nginx,默认为nginx-1.12.2
systemctl start nginx
systemctl enable nginx
#检查防火墙是否关闭
试访问192.168.171.7
2、安装mysql 5.7
yum install -y mariadb-server mariadb
systemctl enable mariadb.service
systemctl start mariadb.service
mysql_secure_installation #会进入设置阶段
具体操作
Enter current password for root (enter for none): #回车
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y #属入y
New password: #设置密码
Re-enter new password: #再次密码
Password updated successfully!
Reloading privilege tables..
... Success!
Remove anonymous users? [Y/n] n #n不删除匿名用户
... skipping.
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] n #n允许远程登录
... skipping.
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] n #n不删除测试数
... skipping.
Reload privilege tables now? [Y/n] y #y重新加载刷新
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
验证密码是否设置成功
mysql -uroot -p
3、安装php 7.2
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
或
yum install epel-release -y (没成功)
#yum仓库建立
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#yum源等待时间取决于网络
yum install -y php72w php72w-devel php72w-fpm php72w-gd php72w-mbstring php72w-mysql
php -v
#查看php版本
4、配置nginx支持php
vim /etc/php-fpm.d/ww