linux
查看linux版本
cat /proc/version
查看 apache版本
appliance@zabbix:~$ apachectl -v
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2019-04-03T13:34:47
查看mysql版本
appliance@zabbix:~$ mysql -V
mysql Ver 14.14 Distrib 5.7.27, for Linux (x86_64) using EditLine wrapper
查看 php版本
appliance@zabbix:~$ php -v
PHP 7.0.33-0ubuntu0.16.04.6 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33-0ubuntu0.16.04.6, Copyright (c) 1999-2017, by Zend Technologies
appliance@zabbix:~$
-----------------------------------------------------------------------------------------------------------------
使用root用户登录进入Linux,打开进去终端
在终端中输入:vi /etc/sysconfig/network-scripts/ifcfg-ens192
重启网络模块
service network restart
-----------------------------------------------------------------------------------------------------------------
修改主机名
[root@zabbix ~]# hostnamectl set-hostname zabbix-lnmp
[root@zabbix ~]# cat /etc/hostname
zabbix-lnmp
[root@zabbix ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
------------------------------------------------------------------------------------------------------------------------
显示tcp的端口和进程等相关情况
netstat -tnlp
------------------------------------------------------------------------------------------------------------------------
ifconfig----yum install net-tools
ip addr show 这个命令也可以
------------------------------------------------------------------------------------------------------------------------
上传下载。
yum install lrzsz -y
----------------------------------------------------------------------------------------------------------------------------
ll -rht
------------------------------------------------------------------------------------------------------------------------
yum包默认下载目录,如果因为网络问题无法顺利下载,可以把下载好的包传到这个目录来
------------------------------------------------------------------------------------------------------------------------
vi 查找关键字
/关键字,,,按n或者shift + n 查找下一个或上一个
系统下查找关键字
whereis 关键字
------------------------------------------------------------------------------------------------------------------------
从最新版本的linux系统开始,默认的是 Mariadb而不是mysql!
使用系统自带的repos安装很简单:
# yum install -y mariadb mariadb-server
启动mariadb
# systemctl start mariadb
之前的服务管理命令还可以用
# service mariadb start
设置开机自启动
# systemctl enable mariadb
安全初始化,设置root密码等
# mysql_secure_installation
测试登录
# mysql -uroot -p123456 //密码123456
--------------------------------------------------------------------------------------------------------------------------
CentOS 7.3 安装Zabbix3.X
一、配置CentOS 7
关闭selinux #setenforce 0 临时关闭
需要关闭 selinux,一定要关闭这个,开启selinux会引起一连串问题,甚至zabbix的discovery功能也不能正常使用
# sed -i"s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
确认是否修改成功
# grep SELINUX/etc/selinux/config
然后重启系统即可
# reboot
关闭防火墙
systemctl startfirewalld.service#启动firewall
systemctl stopfirewalld.service#停止firewall
systemctl disablefirewalld.service#禁止firewall开机启动
--------------------------------------------------------------------------------------------------------------------------
getenforce 查看 selinux是否已关闭
iptables-save 查看防火墙
--------------------------------------------------------------------------------------------------------------------------
安装vmware-tools
yum install perl
yum install net-tools
mount /dev/cdrom /media
cp /media/VMwareTools-10.1.7-5541682.tar.gz /tmp/
cd /tmp
ll
tar -zxvf VMwareTools-10.1.7-5541682.tar.gz
cd vmware-tools-distrib/
./vmware-install.pl
第一个yes之后一直回车
--------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
其他命令
ps -aux | grep oracle
sqlplus / as sysdba