一.linux配置jdk
1.安装rpm包,安装完成位置:/usr/java/jdk1.8.0_152
2.配置环境变量/etc/profile:
JAVA_HOME=/usr/java/jdk1.8.0_152 JRE_HOME=/usr/java/jdk1.8.0_152/jre PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib export JAVA_HOME JRE_HOME PATH CLASSPATH
3.测试安装是否成功
[root@kbase-42 etc]# java -version java version "1.8.0_152" Java(TM) SE Runtime Environment (build 1.8.0_152-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
二,linux安装tomcat
1.https://tomcat.apache.org/download-70.cgi 下载apache-tomcat-7.0.82.tar.gz
2.解压解包:tar -zvxf apache-tomcat-7.0.82.tar.gz
3.修改配置文件,将端口号修改成9999:
/home/lixiaojie/apache-tomcat-7.0.82/conf
vi server.xml
<Connector port="9999" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!-- A "Connector" using the shared thread pool--> <!-- <Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> -->
4.进入tomcat服务器的bin目录,然后执行"./startup.sh"命令启动Tomcat服务器
5.修改打开防火墙,使外部能访问
iptables -I INPUT -p tcp --dport 9999 -j ACCEPT service iptables save service iptables restart
6.浏览器输入:http://192.168.100.42:9999/ 成功
三.linux安装zabbix
1.zabbix下载:http://repo.zabbix.com/zabbix/
2.执行set LANG=en 和 export LANG=en
3.在线安装zabbix的release版:yum -y install http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
4.安装zabbix-server-mysql和zabbix-web-mysql:yum install zabbix-server-mysql zabbix-web-mysql
Installed: zabbix-server-mysql.x86_64 0:2.4.8-1.el6 zabbix-web-mysql.noarch 0:2.4.8-1.el6 Dependency Installed: OpenIPMI-libs.x86_64 0:2.0.16-14.el6 fping.x86_64 0:2.4b2-16.el6 iksemel.x86_64 0:1.4-2.el6 net-snmp.x86_64 1:5.5-60.el6 net-snmp-libs.x86_64 1:5.5-60.el6 php-bcmath.x86_64 0:5.3.3-49.el6 php-mbstring.x86_64 0:5.3.3-49.el6 zabbix.x86_64 0:2.4.8-1.el6 zabbix-server.x86_64 0:2.4.8-1.el6 zabbix-web.noarch 0:2.4.8-1.el6 Complete!
5.mysql建库建表
mysql> create database zabbix character set utf8 collate utf8_bin; mysql> show databases; mysql> use zabbix; mysql> show tables; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by'zabbix';
6.导入数据库源
导入数据: [root@lixiaojie bin]# cd /usr/share/doc/zabbix-server-mysql-2.4.8/create/ [root@lixiaojie create]# ls data.sql images.sql schema.sql [root@lixiaojie create]# mysql -uroot zabbix < schema.sql [root@lixiaojie create]# mysql -uroot zabbix < images.sql [root@lixiaojie create]# mysql -uroot zabbix < data.sql 检查数据: mysql> show databases; mysql> use zabbix; mysql> show tables; 执行: 104 rows in set (0.00 sec)
7.配置zabbix_server
vi /etc/zabbix/zabbix_server.conf 修改: DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix
8.配置所在时区:
vi /etc/httpd/conf.d/zabbix.conf <Directory "/usr/share/zabbix"> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all <IfModule mod_php5.c> php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 #php_value date.timezone Europe/Riga php_value date.timezone Asia/Shanghai </IfModule> </Directory>
9.重启apache
service httpd restart
10.重启zabbix
[root@lixiaojie java]# service zabbix-server restart
Shutting down Zabbix server: [确定]
Starting Zabbix server: [确定]
[root@lixiaojie java]# service httpd restart
停止 httpd: [确定]
正在启动 httpd: [确定]
11.浏览器输入:http://192.168.88.129/zabbix/ 顺序安装
用户和密:Admin zabbix
12.客户端需要做的事:
[root@lixiaojie java]# ps -ef|grep zabbix [root@lixiaojie zabbix]# vi /etc/zabbix/zabbix_agentd.conf (配置agent) Server=192.168.88.129 ServerActive=192.168.88.129 Hostname=lixiaojie (可以随便设置,这个和zabbix建hosts时的host name要一致) [root@lixiaojie zabbix]# service zabbix-agent restart