Zabbix1.4.5安装笔记

Zabbix1.4.5安装笔记
本人BLOG:[url]http://bugchong.blog.163.com/[/url]

如转载请注明出处!
测试环境:
硬件环境:Vmware
软件环境:CentOS 4.5  Windows2003 Server  Ubuntu7.03
一、安装Apache:shell>./configure --prefix=/usr/local/apache --enable-module=so --enable-module=rewrite --enable-shared=max
二、安装MySQL:
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> tar zxvf mysql-5.0.22.tar.gz-
shell> cd mysql-5.0.22.tar.gz
shell> ./configure --prefix=/usr/local/mysql --with-charset=gb2312
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root
.
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
(用mysql用户启动很重要。)
shell> bin/mysql -uroot -p
(输入密码,默认密码为空,直接回车即可)
为mysql增加自动启动选项,并赋予相应权限:
shell> cp support-files/mysql.server /etc/rc.d/init.d/mysqld
shell> chkconfig --add mysqld
用ntsysv设置使mysql每次启动都能自动运行:
启动MYSQL:
shell> /etc/rc.d/init.d/mysqld start
同时别忘记给执行权限:进入/rc.d/init.d目录:
shell> chmod +x mysqld
三、安装PHP在安装PHP前,需要安装GD库以及libpng:
?
安装GD库:
shell> tar zxvf gd-2.0.33.tar.gz

shell> cd gd-2.0.33

shell> ./configure --with-png

shell> make

shell> make install
?
安装libpng:
shell>tar zxvf libpng-1.2.8.tar.gz
shell> cd libpng-1.2.8
shell> cd scripts/
shell> mv makefile.linux ../makefile
shell> cd ..
shell> make
shell> make install
?
安装PHP:
shell> tar zxvf php-5.2.4.tar.gz
shell> cd php-5.2.4
shell> ./configure --prefix=/usr/local/php \                                               #php安装在/usr/local位置
--with-apxs2=/usr/local/apache/bin/apxs \                                  #php支持apache
--with-mysql=/usr/local/mysql/
\                                                   #php支持mysql
--with-gd=/usr/gd2/
\                                                                      #php的GD库
--with-png-dir=/usr/local/include/libpng/
\                             #开启php的png支持功能
--enable-bcmath                                                                               #开启bcmath功能
shell> cp php.ini-dist /usr/local/lib/php.ini
四、修改Apache:shell> vi /usr/local/apache2/conf/httpd.conf
1、找到DirectoryIndex修改如下:
DirectoryIndex index.php index.html index.html.var
2、找到
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
在下面添加
AddType application/x-httpd-php .php
重启APACHE:
shell> /usr/local/apache2/bin/apachectl restart
五、安装Zabbix:建立zabbix数据库:
sql> Create database zabbix;
进入zabbix相应目录:
shell> tar zxvf zabbix-1.4.5.tar.gz
shell> cd zabbix-1.4.5
shell> cd create/schema
shell> cat mysql.sql | mysql -u<username> �Cp<password>zabbix
shell> cd ../data
shell> cat data.sql | mysql -u<username> -p<password> zabbix
shell> cat images_mysql.sql | mysql -u<username> -p<password> zabbix
如果出现ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: YES)
解决方法如下:
shell> /etc/init.d/mysql stop
shell> mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
shell> mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit;
mysql> /etc/init.d/mysql restart
mysql> mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
编译Zabbix:
shell> ./configure --enable-server --with-mysql=/usr/local/mysql/bin/mysql_config
shell> cp /frontends/php/* /usr/local/apache/htdoc/
需要修改PHP.INI,
将max_execution_time设置为300,同时还要设置time.zone=PRC或 Asia/Shanghai。
然后重新启动Apache,登录网页就可以进行在线安装了。^_^
[url]http://localhost/zabbix[/url]
 

你可能感兴趣的:(职场,监控,zabbix,休闲)