CentOS> 服务器IP地址:
10.20.0.101
Apache安装
#yum install httpd libxml2-devel net-snmp-devel libcurl-devel
配置web
更改ServerName
# vim /etc/httpd/conf/httpd.conf
ServerName 10.20.0.101
安装MySQL
建议安装MySQL5.6 centos6 默认安装mysql是5.1 不是很稳定 性能也没有MySQL5.6好
下载rpm源及安装
#rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
# yum install -y mysql-server mysql-devel
更改配置文件 添加内容如下:
#vim /etc/my.cnf
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8
启动数据库
# service mysqld start
MySQL安全设置:
# 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 MySQL
root user without the proper authorisation.
Set root password? [Y/n] y #设置root密码 选择Y 或者回车
New password: #设置root密码
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
Remove anonymous users? [Y/n] y 是否删除匿名用户 选择y
... Success!
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] y 是否禁止用户登陆root 远程 选择Y 为了安全考虑
... Success!
Remove test database and access to it? [Y/n] y 删除test数据库 选择y
- Dropping test database...
Reload privilege tables now? [Y/n] y 是否重新加载刷新表空间 选择Y 是
... Success!
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Cleaning up...
创建zabbix数据库
# mysql -uroot -p
mysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
mysql> show create database zabbix;
+----------+----------------------------------------------------------------------------------+
| Database | Create Database |
+----------+----------------------------------------------------------------------------------+
| zabbix | CREATE DATABASE `zabbix` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */ |
+----------+----------------------------------------------------------------------------------+
1 row in set (0.00 sec)