摘要:,初始化完畢。。。解決圖形中文亂碼把它拷貝到的端的目錄下例如,確認后綴為
本例環(huán)境使用Centos7.3 64位
安裝zabbix需要mysql的支持,下面是快速安裝LNMP的方法(使用EZHTTP安裝)
安裝LNMP首先創(chuàng)建一個目錄存放下載文件:
[root@localhost ~]# mkdir /software [root@localhost software]# cd /software/
安裝wget工具:
[root@localhost software]# yum -y install wget
下載EZHTTP安裝腳本:
[root@localhost software]# wget --no-check-certificate https://github.com/centos-bz/ezhttp/archive/master.zip?time=$(date +%s) -O ezhttp.zip
啟動腳本:
[root@localhost software]# unzip ezhttp.zip [root@localhost software]# cd ezhttp-master [root@localhost ezhttp-master]# chmod +x start.sh [root@localhost ezhttp-master]# ./start.sh
進去選擇頁面
除了數(shù)字選擇項需要確認輸入,其他的的按回車默認就行:
nginx 和 apache 都行,個人比較喜歡nginx
php版本5.5-7.1
mysql版本5.6
[root@localhost ezhttp-master]# ./start.sh ############################################################################# You are welcome to use this script to deploy your linux,hope you like. The script is written by Zhu Maohai. If you have any question. please visit http://www.centos.bz/ezhttp/ and submit your issue.thank you. ############################################################################ 1) LAMP LNMP LANMP Installation. 2) Some Useful Tools. 3) Upgrade Software 4) Exit. please select: 1 you select LAMP LNMP LANMP Installation. 1) LNMP(Nginx MySQL PHP) 2) LAMP(Apache MySQL PHP) 3) LNAMP(Nginx Apache MySQL PHP) 4) back to main menu please input the package you like to install: 1 #################### nginx setting #################### 1) nginx-1.8.0 2) tengine-2.1.0 3) openresty-1.9.7.3 4) custom_version 5) do_not_install which nginx you do select(default do_not_install): 1 your selection: nginx-1.8.0 nginx-1.8.0 install location(default:/usr/local/nginx,leave blank for default): nginx-1.8.0 install location: /usr/local/nginx the nginx-1.8.0 configure parameter is: --prefix=/usr/local/nginx --with-http_ssl_module --with-openssl=/software/ezhttp-master/soft/openssl-1.0.2h --with-http_sub_module --with-http_stub_status_module --with-pcre --with-pcre=/software/ezhttp-master/soft/pcre-8.33 --with-zlib=/software/ezhttp-master/soft/zlib-1.2.8 --with-http_secure_link_module Would you like to change it?[N/y](default n): you select no,configure parameter will not be changed. Do you need to install nginx module?[N/y](default n): #################### mysql setting #################### 1) mysql-5.1.73 2) mysql-5.5.54 3) mysql-5.6.35 4) mysql-5.7.17 (need about 2GB RAM when building,try mysql-5.6 if failed) 5) libmysqlclient18 6) custom_version 7) do_not_install which mysql you"d select(default do_not_install): 3 your selection: mysql-5.6.35 mysql-5.6.35 install location(default:/usr/local/mysql,leave blank for default): mysql-5.6.35 install location: /usr/local/mysql mysql data location(default:/usr/local/mysql/data,leave blank for default): mysql-5.6.35 data location: /usr/local/mysql/data mysql port number(default:3306,leave blank for default): mysql port number: 3306 mysql server root password (default:root,leave blank for default): 123456 mysql-5.6.35 root password: 123456 the mysql-5.6.35 configure parameter is: -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/usr/local/mysql/etc -DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=complex -DENABLED_LOCAL_INFILE=1 Would you like to change it?[N/y](default n): you select no,configure parameter will not be changed. #################### php setting #################### 1) php-5.2.17 2) php-5.3.29 3) php-5.4.43 4) php-5.5.27 5) php-5.6.15 6) php-7.1.0 7) custom_version 8) do_not_install which php you"d select(default do_not_install): 6 your selection: php-7.1.0 php-7.1.0 install location(default:/usr/local/php,leave blank for default): php-7.1.0 install location: /usr/local/php the php-7.1.0 configure parameter is: --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --enable-bcmath=shared --with-pdo_sqlite --with-gettext=shared --with-iconv --enable-ftp=shared --with-sqlite --with-sqlite3 --enable-mbstring=shared --enable-sockets=shared --enable-zip --enable-soap=shared --with-openssl --with-zlib --with-curl=shared --with-gd=shared --with-jpeg-dir --with-png-dir --with-freetype-dir --with-mcrypt=shared,/opt/ezhttp/libmcrypt-2.5.8 --with-mhash=shared,/opt/ezhttp/mhash-0.9.9.9 --enable-opcache --with-mysql=mysqlnd --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --without-pear --with-libdir=lib64 --disable-fileinfo Would you like to change it?[N/y](default n): you select no,configure parameter will not be changed. #################### PHP modules install #################### php-7.1.0 version available modules: #################### php_modules install #################### 1) fileinfo 2) php-gmp 3) php-swoole-1.7.20 4) do_not_install please input one or more number between 1 and 4(default do_not_install)(ie.1 2 3): your selection do_not_install #################### other_soft install #################### 1) memcached-1.4.24 2) pure-ftpd-1.0.41 3) phpMyAdmin-4.4.12-all-languages 4) redis-3.0.3 5) mongodb-linux-x86_64-2.4.9 6) phpRedisAdmin-1.1.0 7) memadmin-1.0.12 8) rockmongo-1.1.6-fix-auth 9) jdk1.7.0_79 10) jdk1.8.0_66 11) apache-tomcat-7.0.68 12) apache-tomcat-8.0.39 13) do_not_install please input one or more number between 1 and 13(default do_not_install)(ie.1 2 3): 1 2 3 4 6 10 12 your selection memcached-1.4.24 pure-ftpd-1.0.41 phpMyAdmin-4.4.12-all-languages redis-3.0.3 phpRedisAdmin-1.1.0 jdk1.8.0_66 apache-tomcat-8.0.39 input memcached-1.4.24 location(default:/usr/local/memcached): memcached location: /usr/local/memcached input pure-ftpd-1.0.41 location(default:/usr/local/pureftpd): pureftpd location: /usr/local/pureftpd Would you like to install web user manager for pureftpd?[N/y](default n): you select not install web manager input phpMyAdmin-4.4.12-all-languages location(default:/home/wwwroot/phpmyadmin): phpmyadmin location: /home/wwwroot/phpmyadmin input redis-3.0.3 location(default:/usr/local/redis): redis location: /usr/local/redis please input the max memory allowed for redis(ie.128M,512m,2G,4g): 128M 128M input phpRedisAdmin-1.1.0 location(default:/home/wwwroot/redisadmin): phpRedisAdmin location: /home/wwwroot/redisadmin input jdk1.8.0_66 location(default:/usr/local/jdk1.8.0_66): jdk8 location: /usr/local/jdk1.8.0_66 input apache-tomcat-8.0.39 location(default:/usr/local/tomcat8): tomcat8 location: /usr/local/tomcat8 #################### your choice overview #################### Package: lnmp *****Nginx Setting***** Nginx: nginx-1.8.0 Nginx Location: /usr/local/nginx Nginx Configure Parameter: --prefix=/usr/local/nginx --with-http_ssl_module --with-openssl=/software/ezhttp-master/soft/openssl-1.0.2h --with-http_sub_module --with-http_stub_status_module --with-pcre --with-pcre=/software/ezhttp-master/soft/pcre-8.33 --with-zlib=/software/ezhttp-master/soft/zlib-1.2.8 --with-http_secure_link_module Nginx Modules: *****MySQL Setting***** MySQL Server: mysql-5.6.35 MySQL Location: /usr/local/mysql MySQL Data Location: /usr/local/mysql/data MySQL Port Number: 3306 MySQL Root Password: 123456 MySQL Configure Parameter: -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/usr/local/mysql/etc -DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=complex -DENABLED_LOCAL_INFILE=1 *****PHP Setting***** PHP: php-7.1.0 PHP Location: /usr/local/php PHP Configure Parameter: --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --enable-bcmath=shared --with-pdo_sqlite --with-gettext=shared --with-iconv --enable-ftp=shared --with-sqlite --with-sqlite3 --enable-mbstring=shared --enable-sockets=shared --enable-zip --enable-soap=shared --with-openssl --with-zlib --with-curl=shared --with-gd=shared --with-jpeg-dir --with-png-dir --with-freetype-dir --with-mcrypt=shared,/opt/ezhttp/libmcrypt-2.5.8 --with-mhash=shared,/opt/ezhttp/mhash-0.9.9.9 --enable-opcache --with-mysql=mysqlnd --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --without-pear --with-libdir=lib64 --disable-fileinfo *****Other Software Setting***** Other Software: memcached-1.4.24 pure-ftpd-1.0.41 phpMyAdmin-4.4.12-all-languages redis-3.0.3 phpRedisAdmin-1.1.0 jdk1.8.0_66 apache-tomcat-8.0.39 memcached location: /usr/local/memcached pureftpd location: /usr/local/pureftpd phpmyadmin_location: /home/wwwroot/phpmyadmin redis_location: /usr/local/redis phpRedisAdmin_location: /home/wwwroot/redisadmin jdk8_location: /usr/local/jdk1.8.0_66 tomcat8_location: /usr/local/tomcat8 JAVA_HOME: /usr/local/jdk1.8.0_66 ############################################################## Are you ready to configure your Linux?[Y/n](default y):
安裝過程等待即可:
.............................. ..............................
安裝成功:
start programs... Starting nginx daemon: . Starting MySQL.. SUCCESS! Warning: Using a password on the command line interface can be insecure. Starting php-fpm done Starting memcached: Start pureftpd.... [OK] Starting Redis server...
使用EZHTTP安裝成功后各服務已經(jīng)打開,輸入Linxu 機器IP 訪問即可:
開始安裝zabbix 配置源
Zabbix在CentOS基本源里不可獲得,因此必須配置EPEL 和Zabbix 官方repository,因為需要一款名叫fping的軟件(這款軟件你下載源碼編譯安裝貌似行不通?。?,然后其他的yum源將mysql全部識別為mariadb了,所以想yum安裝mysql,請安裝mysql社區(qū)版官方源,或者編譯安裝,上面的EZHTTP安裝腳本就是編譯安裝
安裝EPEL repository
[root@localhost software]# pwd /software [root@localhost software]# yum -y install epel-release
配置ZabbixZone package repository and GPG key
[root@localhost software]# rpm --import http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX [root@localhost software]# rpm --import http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591 [root@localhost software]# yum -y install fping [root@localhost software]# rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm安裝Zabbix server and agent(agent是可選的)
安裝Zabbix server and agent:(配置自己監(jiān)控自己,所以安裝了zabbix-agent)
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
可以上zabbix rpm包官網(wǎng)查看或下載相應包
http://repo.zabbix.com/
創(chuàng)建MySQL 數(shù)據(jù)庫和用戶登錄Mysql:
[root@localhost software]# mysql -uroot -p123456
創(chuàng)建一個數(shù)據(jù)庫zabbix和數(shù)據(jù)庫用戶zabbix:
mysql> create database zabbix character set utf8; mysql> grant all privileges on zabbix.* to "zabbix"@"localhost" identified by "zabbix"; mysql> flush privileges;數(shù)據(jù)庫導入zabbix template
看yum安裝的zabbix-server-mysql-3.x.x 這個文件的版本是多少就改成多少
[root@localhost software]# zcat /usr/share/doc/zabbix-server-mysql-3.2.4/create.sql.gz |mysql -uzabbix -pzabbix -b zabbix配置Zabbix server
vi /etc/zabbix/zabbix_server.conf
配置下面的幾個參數(shù)
帶#號的就去掉#號,并修改其值
ListenPort=10051 DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix DBSocket=/usr/local/mysql/data/mysql.sock DBPort=3306配置zabbix-agent
vi /etc/zabbix/zabbix_agentd.conf
配置zabbix server的ip
## Line 95 - Specify Zabbix server ## Server=127.0.0.1 ## Line 136 - Specify Zabbix server ## ServerActive=127.0.0.1 ## Line 147 - Specify Zabbix server Hostname or IP address Hostname=127.0.0.1修改PHP 設置
修改php.ini為zabbix 建議的設置
編輯文件 php.ini,
[root@localhost software]# vi /usr/local/php/etc/php.ini
設置下面的參數(shù):
max_execution_time = 300 max_input_time = 300 memory_limit = 128M post_max_size = 32M upload_max_filesize = 2M date.timezone = Asia/Shanghai
安裝時可能缺少下面擴展,把下面內(nèi)容添加到php.ini
extension=bcmath.so extension=gettext.so extension=sockets.so
安裝擴展
[root@localhost ext]# cd /software/ezhttp-master/soft/php-7.1.0/ext [root@localhost ext]# pwd /software/ezhttp-master/soft/php-7.1.0/ext [root@localhost ext]# cd sockets/ [root@localhost sockets]# /usr/local/php/bin/phpize [root@localhost sockets]# ./configure --with-php-config=/usr/local/php/bin/php-config [root@localhost sockets]# cd .. [root@localhost ext]# cd bcmath/ [root@localhost bcmath]# /usr/local/php/bin/phpize [root@localhost bcmath]# ./configure --with-php-config=/usr/local/php/bin/php-config [root@localhost bcmath]# cd .. [root@localhost ext]# cd gettext/ [root@localhost gettext]# /usr/local/php/bin/phpize [root@localhost gettext]# ./configure --with-php-config=/usr/local/php/bin/php-config
使用下面命令可以看到有一個擴展存放的目錄,我們需要的擴展模塊在其中即安裝成功
[root@localhost gettext]# make && make install
修改php-fpm運行的用戶和組
[root@localhost software]# vi /usr/local/php/etc/php-fpm.d/www.conf user = www group = www方法一:使用 apache 服務器
apache配置zabbix-web站點文件
[root@localhost etc]# cd /etc/httpd/
vi conf/httpd.conf
修改下面內(nèi)容:
Listen 80 User www Group wwwwDirectoryIndex index.html index.php
vi conf.d/zabbix.conf
修改內(nèi)容如下:
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 32M php_value upload_max_filesize 8M php_value max_input_time 300 php_value always_populate_raw_post_data -1 php_value date.timezone Asia/Shanghai
然后重啟apache、mysql、php、zabbix-server
瀏覽器輸入ip/setup.php 即可進入zabbix初次web安裝界面
配置zabbix-web站點文件
把zabbix程序文件拷貝到我們指定的目錄,并修改屬主和屬組
[root@localhost software]# cp -r /usr/share/zabbix /var/www/ [root@localhost software]# chown -R www:www /var/www/zabbix [root@localhost software]# chown -R www:www /etc/zabbix [root@localhost software]# chown -R www:www /usr/share/zabbix [root@localhost software]# chown -R www:www /usr/lib/zabbix [root@localhost software]# chmod -R 755 /etc/zabbix/web
創(chuàng)建存放web站點配置文件的目錄
[root@localhost ~]# cd /usr/local/nginx/conf/ [root@localhost conf]# mkdir conf.d/
配置nginx.conf,把新建的目錄包含進去
[root@localhost conf]# vi nginx.conf listen 80 default_server; ===> 改為 listen 90 default_server; root /home/wwwroot/; ===> 改為 # root /home/wwwroot/; include vhost/*.conf; ===> 改為 include /usr/local/nginx/conf/conf.d/*.conf;
配置zabbix.conf(zabiix站點的配置文件)
[root@localhost conf]# cd conf.d/ [root@localhost conf.d]# vi zabbix.conf
zabbix.conf 內(nèi)容如下:
server { listen 80; server_name localhost; root /var/www/zabbix; index index.php index.html index.htm; access_log logs/zabbix.access.log; error_log logs/zabbix.error.log; location / { try_files $uri $uri/ /index.php?$args; } location ~ .*.(php)?$ { expires -1s; try_files $uri =404; fastcgi_split_path_info ^(.+.php)(/.+)$; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PHP_VALUE open_basedir=$document_root:/tmp/:/proc/:/usr/share/zabbix/:/etc/zabbix/web/:/etc/zabbix/; } }
啟動zabbix-server 和zabbix-agent。并設置zabbix-server和zabbix-agent開機自動啟動
systemctl start zabbix-server systemctl start zabbix-agent /etc/init.d/nginx restart chkconfig nginx on /etc/init.d/mysqld restart chkconfig mysqld on /etc/init.d/php-fpm restart chkconfig php-fpm on systemctl enable zabbix-server systemctl enable zabbix-agent修改Firewall 和SELinux 設置
開放zabbix端口10050 and 10051
firewall-cmd --permanent --add-port=10050/tcp firewall-cmd --permanent --add-port=10051/tcp
重啟firewall
systemctl restart firewalld
如果使用 SELinux, 運行以下命令使 Apache 可以和 Zabbix通信
setsebool -P httpd_can_connect_zabbix=1
如果是測試環(huán)境可以直接關閉防火墻和selinux
[root@localhost software]# systemctl stop firewalld [root@localhost local]# chkconfig firewalld off
修改配置文件,禁用selinux
[root@localhost software]# setenforce 0 [root@localhost software]# vi /etc/selinux/config SELINUX=disabled輸入ip/setup.php進入zabbix-web界面進行后續(xù)安裝操作
確認狀態(tài)都是ok
配置數(shù)據(jù)庫信息(填寫上面我們設置的數(shù)據(jù)庫賬戶和密碼:zabbix,zabbix,測試環(huán)境可以直接用root)
進入下一步,默認即可
如果出現(xiàn)下面錯誤
使用php7.0版本初始化完成后頁面有如下的報錯:
這個是因為PHP 7.1.0類型強化,處理方法也很簡單找到Zabbix WEB目錄下include/func.inc.php文件,執(zhí)行下面命令,并重啟php服務:
sed -i "/$last = strtolower(substr($val, -1));/a$val = substr($val,0,-1);" /var/www/zabbix/include/func.inc.php /etc/init.d/php-fpm reload
然后刷新頁面可以看到已經(jīng)正常。
ok,初始化完畢。。。
2.把它拷貝到zabbix的web端的fonts目錄下例如:/var/www/html/zabbix/fonts,確認后綴為ttf
文章版權歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://specialneedsforspecialkids.com/yun/8029.html
摘要:是新出現(xiàn)的自動化運維工具,基于開發(fā),集合了眾多運維工具的優(yōu)點,實現(xiàn)了批量系統(tǒng)配置批量程序部署批量運行命令等功能。是基于模塊工作的,本身沒有批量部署的能力。 ansible ansible是新出現(xiàn)的自動化運維工具,基于Python開發(fā),集合了眾多運維工具(puppet、cfengine、chef、func、fabric)的優(yōu)點,實現(xiàn)了批量系統(tǒng)配置、批量程序部署、批量運行命令等功能。ans...
閱讀 2686·2021-09-22 15:58
閱讀 2230·2019-08-29 16:06
閱讀 898·2019-08-29 14:14
閱讀 2810·2019-08-29 13:48
閱讀 2451·2019-08-28 18:01
閱讀 1495·2019-08-28 17:52
閱讀 3318·2019-08-26 14:05
閱讀 1610·2019-08-26 13:50