系統環境 FreeBSD 8.0
# cd zabbix-server
# make install clean
Options for zabbix-server 1.8.1,2
[X] MYSQL Use MySQL backend
[ ] PGSQL Use PostgreSQL backend
[ ] SQLITE Use SQLite backend
[ ] IPV6 Support for IPv6
[X] LDAP Support for checking LDAP servers
[X] JABBER Use jabber media type
[X] FPING Use fping for pinging hosts
Options for net-snmp 5.4.2.1_6
[ ] IPV6 Build with IPv6 support
[X] MFD_REWRITES Build with 64-bit Interface Counters
[X] PERL Install additional perl modules
[X] PERL_EMBEDDED Build embedded perl
[X] TKMIB Install graphical MIB browser
[X] DUMMY Enable dummy values as placeholders
[ ] DMALLOC Enable dmalloc debug memory allocator
Options for perl 5.8.9_3
[ ] DEBUGGING Build with debugging support
[ ] GDBM Build GDBM_File extension
[X] PERL_MALLOC Use Perl malloc
[X] PERL_64BITINT Use 64 bit integers (on i386)
[ ] THREADS Build threaded perl
[ ] SUIDPERL Build set-user-id suidperl binary
[ ] SITECUSTOMIZE Run-time customization of @INC
[X] USE_PERL Rewrite links in /usr/bin
Options for libxslt 1.1.26
[ ] MEM_DEBUG Enable memory debugging
[X] CRYPTO Enable crypto support for exslt
Options for python26 2.6.4
[X] THREADS Enable thread support
[ ] HUGE_STACK_SIZE Use a larger thread stack
[ ] SEM Use POSIX semaphores (experimental)
[ ] PTH Use GNU Pth for threading/multiprocessing
[X] UCS4 Use UCS4 for unicode support
[X] PYMALLOC Use python's internal malloc
[ ] IPV6 Enable IPv6 support
[ ] FPECTL Enable floating point exception handling
Options for m4 1.4.13,1
[ ] LIBSIGSEGV Use libsigsegv for better diagnostics
Options for curl 7.19.7_1
[ ] CARES Asynchronous DNS resolution via c-ares
[ ] CURL_DEBUG Enable curl diagnostic output
[ ] GNUTLS Use GNU TLS if OPENSSL is OFF
[X] IPV6 IPv6 support
[ ] KERBEROS4 Kerberos 4 authentication
[ ] LDAP LDAP support
[ ] LDAPS LDAPS support (requires LDAP and SSL)
[ ] LIBIDN Internationalized Domain Names via libidn
[ ] LIBSSH2 SCP/SFTP support via libssh2
[ ] NTLM NTLM authentication
[X] OPENSSL OpenSSL support
[X] PROXY Proxy support
[ ] TRACKMEMORY Enable curl memory diagnostic output
Options for ca_root_nss 3.12.4
[ ] ETCSYMLINK Add symlink to /etc/ssl/cert.pem
======================================================================
Zabbix requires a database. If you are using SQLite, on
e will be
created automatically. Otherwise you can install on
e as follows (<db>
is your database engine and <db_client> is its client program):
% cd /usr/local/share/zabbix/server/create
% cat schema/<db>.sql da
ta/da
ta.sql da
ta/images_<db>.sql | <db_client>
To upgrade an existing database, see the scripts in
/usr/local/share/zabbix/server/upgrades.
======================================================================
===> Installing rc.d startup script(s)
===> Compressing manual pages for zabbix-server-1.8.1,2
===> Registering installation for zabbix-server-1.8.1,2
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/sbin/zabbix_server
This port has installed the following startup scripts which may cause
these network services to be started at boot time.
/usr/local/etc/rc.d/zabbix_server
If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type 'make deinstall'
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
# cd /usr/ports/net-mgmt/zabbix-frontend
# make install clean
Options for zabbix-frontend 1.8.1,2
[X] MYSQL Use MySQL backend
[ ] PGSQL Use PostgreSQL backend
[ ] SQLITE Use SQLite backend
Options for php5 5.2.12
[X] CLI Build CLI version
[X] CGI Build CGI version
[X] APACHE Build Apache module
[ ] DEBUG Enable debug
[X] SUHOSIN Enable Suhosin protection system (not for jails)
[ ] MULTIBYTE Enable zend multibyte support
[ ] IPV6 Enable ipv6 support
[ ] MAILHEAD Enable mail header patch
[ ] REDIRECT Enable force-cgi-redirect support (CGI on
ly)
[ ] DISCARD Enable discard-path support (CGI on
ly)
[X] FASTCGI Enable fastcgi support (CGI on
ly)
[X] PATHINFO Enable path-info-check support (CGI on
ly)
Options for php5-gd 5.2.12
[X] T1LIB Include T1lib support
[X] TRUETYPE Enable TrueType string function
[ ] JIS Enable JIS-mapped Japanese font support
Options for php5-pcre 5.2.12
[ ] BUNDLED_PCRE Select if you use apache 2.0.x
# cd /usr/ports/databases/mysql50-server/
# make install clean
# echo 'mysql_enable="YES"' >> /etc/rc.conf
# cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnf
# ee /etc/my.cnf
# Uncomment the following if you are using InnoDB tables
innodb_da
ta_home_dir = /var/db/mysql/
innodb_da
ta_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /var/db/mysql/
innodb_log_arch_dir = /var/db/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
# /usr/local/etc/rc.d/mysql-server start
Starting mysql.
# sockstat -4 |grep 3306
mysql mysqld 61646 13 tcp4 *:3306 *:*
# mysqladmin -u root password ******
For MySQL:
shell> mysql -u<username> -p<password>
mysql> create database zabbix character set utf8;
mysql> quit;
shell> cd /usr/local/share/zabbix/server/create/schema
shell> cat mysql.sql | mysql -u<username> -p<password> zabbix
shell> cd ../da
ta
shell> cat da
ta.sql | mysql -u<username> -p<password> zabbix
shell> cat images_mysql.sql | mysql -u<username> -p<password> zabbix
# echo "GRANT ALL ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix'; FLUSH PRIVILEGES;" |
mysql -u root -p
# cp /usr/local/etc/zabbix/zabbix_server.conf.sample /usr/local/etc/zabbix/zabbix_server.conf
# ee /usr/local/etc/zabbix/zabbix_server.conf
DBUser=zabbix
DBPassword=zabbix
# echo 'zabbix_server_enable="YES"' >> /etc/rc.conf
# /usr/local/etc/rc.d/zabbix_server start
# sockstat -4
發現服務沒有成功啓動,查看日誌文件/tmp/zabbix_server.log有下面的提示
69083:20100212:094928.206 Can't allocate shared memory of size 8388608 [Cannot allocate memory]
69083:20100212:094928.206 ERROR: Can't allocate shared memory for configuration cache.
不能分配共享緩存的配置,配置文件定義8M的共享緩存CacheSize=8M。
# sysctl -a
kern.ipc.shmmin: 1
kern.ipc.shmmax: 33554432 (默認是32M)
安裝手冊中的案例
---------------------------------------------------------------------
爲了改善 X11 界面使用共享內存的能力, 建議提升一些 sysctl(8) 變量的值:
kern.ipc.shmmax=67108864
kern.ipc.shmall=32768
---------------------------------------------------------------------
# sysctl kern.ipc.shmmax=67108864
kern.ipc.shmmax: 33554432 -> 67108864
# 最大線程數量8改成32
# sysctl kern.ipc.shmall=32768
kern.ipc.shmall: 8192 -> 32768
實際只須要修改最大線程數,服務就能夠正常啓動了。
將修改值寫入配置文件,不然重啓後配置將會丟失。
# echo 'kern.ipc.shmmax=67108864' >> /etc/sysctl.conf
# echo 'kern.ipc.shmall=32768' >> /etc/sysctl.conf
# /usr/local/etc/rc.d/zabbix_server start
# sockstat -4 |grep 10051
zabbix zabbix_ser 858 4 tcp4 *:10051 *:*
zabbix zabbix_ser 857 4 tcp4 *:10051 *:*
zabbix zabbix_ser 856 4 tcp4 *:10051 *:*
zabbix zabbix_ser 855 4 tcp4 *:10051 *:*
zabbix zabbix_ser 854 4 tcp4 *:10051 *:*
zabbix zabbix_ser 853 4 tcp4 *:10051 *:*
zabbix zabbix_ser 852 4 tcp4 *:10051 *:*
zabbix zabbix_ser 851 4 tcp4 *:10051 *:*
zabbix zabbix_ser 850 4 tcp4 *:10051 *:*
zabbix zabbix_ser 849 4 tcp4 *:10051 *:*
zabbix zabbix_ser 848 4 tcp4 *:10051 *:*
zabbix zabbix_ser 847 4 tcp4 *:10051 *:*
zabbix zabbix_ser 846 4 tcp4 *:10051 *:*
zabbix zabbix_ser 845 4 tcp4 *:10051 *:*
zabbix zabbix_ser 844 4 tcp4 *:10051 *:*
zabbix zabbix_ser 843 4 tcp4 *:10051 *:*
zabbix zabbix_ser 842 4 tcp4 *:10051 *:*
zabbix zabbix_ser 841 4 tcp4 *:10051 *:*
zabbix zabbix_ser 840 4 tcp4 *:10051 *:*
zabbix zabbix_ser 839 4 tcp4 *:10051 *:*
zabbix zabbix_ser 838 4 tcp4 *:10051 *:*
zabbix zabbix_ser 825 4 tcp4 *:10051 *:*
線程還真很多。
由於ports自動安裝了apache13模塊,這裏就直接啓動就ok了
# echo 'apache_enable="YES"' >> /etc/rc.conf
# /usr/local/etc/rc.d/apache start
# sockstat -4 |grep 80
www httpd 66975 16 tcp4 *:80 *:*
www httpd 66974 16 tcp4 *:80 *:*
www httpd 66973 16 tcp4 *:80 *:*
www httpd 66972 16 tcp4 *:80 *:*
www httpd 66971 16 tcp4 *:80 *:*
root httpd 66970 16 tcp4 *:80 *:*
# ee /usr/local/etc/apache/httpd.conf 加入下面的內容
---------------------------------------------------
# php5
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
# Zabbix
Alias /zabbix/ /usr/local/www/zabbix/
<Directory /usr/local/www/nzabbix>
Order deny,allow
Deny from all
Allow from 127.0.0.1,192.168.101.16
</Directory>
---------------------------------------------------
# /usr/local/etc/rc.d/apache restart
打開瀏覽器http://192.168.101.5/zabbix/
進入Check of pre-requisites頁面,
PHP post max size 8M 16M 32M Fail
PHP max execution time 30 300 600 Fail
PHP timezone no Fail
PHP MB string overload no Fail
根據提示修改php.ini的配置值
# cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini
# ee /usr/local/etc/php.ini
post_max_size = 32m
max_execution_time = 600
[Date]
; Defines the default timezone used by the date functions
date.timezone = Asia/Shanghai
mbstring.func_overload = 7
重啓apache,仍是報
PHP MB string overload no Fail
# cd /usr/ports/converters/php5-mbstring
# make install clean
Options for php5-mbstring 5.2.12
[X] REGEX Enable multibyte regex support
重啓後ok。而後根據提示進行web的相關配置。在第7步install的時候,要將配置文件下載下來,而後考到相應的
位置,即便配置信息同樣,好像安裝程序都沒法完成。只能是配置頁面產生的內容纔有效。
Default user name is Admin, password zabbix