Architecture: Nginx
php5
mysql
Install depends
<code><span>#apt</span><span>-get</span> install <span>-y</span> nginx php5<span>-fpm</span> php5<span>-gd</span> mysql<span>-server</span> php5<span>-mysql</span> libmysqld<span>-dev</span> libxml2<span>-dev</span> libsnmp<span>-dev</span> libcurl4<span>-openssl</span><span>-dev</span></code>
Config php5-fpm
<code><span>#/etc/php5/fpm/pool.d/www.conf</span><span>...</span> > <span>33</span> ;listen = /var/run/php5-fpm.sock > <span>34</span> listen = <span>9000</span><span>#service php5-fpm restart</span></code>
Config nginx
<code><span>#cp /etc/nginx/sites-available/default{,.bak}</span><span>#vim /etc/nginx/sites-enabled/default</span><span>...</span><span>24</span><span>## root /usr/share/nginx/html;</span><span>25</span> root /var/www/html/zabbix; <span>26</span> index index.php index.html index.htm; <span>...</span><span>54</span> location ~ \.php$ { <span>55</span> fastcgi_split_path_info ^(.+\.php)(/.+)$; <span>56</span><span># # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini</span><span>57</span><span>#</span><span>58</span><span># # With php5-cgi alone:</span><span>59</span> fastcgi_pass <span>127.0</span><span>.0</span><span>.1</span>:<span>9000</span>; <span>60</span><span># # With php5-fpm:</span><span>61</span><span># fastcgi_pass unix:/var/run/php5-fpm.sock;</span><span>62</span> fastcgi_index index.php; <span>63</span> include fastcgi_params; <span>64</span> } <span>...</span><span>#nginx -t</span> nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful <span>#service nginx reload</span></code>
Installing Zabbix daemons
download and untar pkg
<code><span>#wget http://7mnldi.com1.z0.glb.clouddn.com/zabbix-2.2.10.tar.gz</span><span>#tar -xf zabbix-2.2.10.tar.gz</span></code>
Create user account
<code><span>#groupadd zabbix</span><span>#useradd -g zabbix zabbix</span></code>
Create Zabbix database
For Zabbix server and proxy daemons, as well as Zabbix frontend, a database is required. It is not needed to run Zabbix agent.
SQL scripts are provided for creating database schema and inserting the dataset. Zabbix proxy database needs only the
schema while Zabbix server database requires also the dataset on top of the schema.
For example: config mysql
<code>shell> mysql -u<span>username</span>> -p<span>password</span>> mysql> create database zabbix character set utf8 collate utf8_bin; mysql> quit; shell> mysql -u<span>username</span>> -p<span>password</span>> zabbix <span>database</span>/<span>mysql</span>/<span>schema.sql</span> # <span>stop</span><span>here</span><span>if</span><span>you</span><span>are</span><span>creating</span><span>database</span><span>for</span><span>Zabbix</span><span>proxy</span><span>shell</span>> mysql -u<span>username</span>> -p<span>password</span>> zabbix <span>database</span>/<span>mysql</span>/<span>images.sql</span><span>shell</span>> mysql -u<span>username</span>> -p<span>password</span>> zabbix <span>database</span>/<span>mysql</span>/<span>data.sql</span></code>
Having created a Zabbix database, proceed to the following steps of compiling Zabbix.
Configure the sources
When configuring the sources for a Zabbix server or proxy, you must specify the database type to be used. Only one database type can be compiled with a server or proxy process at a time.
To see all of the supported configuration options, inside the extracted Zabbix source directory run:
<code><span>#./configure --help</span></code>
To configure the sources for a Zabbix server and agent, you may run something like:
<code><span>#</span><span>.</span><span>/configure</span><span>-</span><span>-</span><span>enable</span><span>-</span><span>server</span><span>-</span><span>-</span><span>enable</span><span>-</span><span>agent</span><span>-</span><span>-</span><span>with</span><span>-</span><span>mysql</span><span>-</span><span>-</span><span>enable</span><span>-</span><span>ipv6</span><span>-</span><span>-</span><span>with</span><span>-</span><span>net</span><span>-</span><span>snmp</span><span>-</span><span>-</span><span>with</span><span>-</span><span>libcurl</span><span>-</span><span>-</span><span>with</span><span>-</span><span>libxml2</span></code>
note: –with-libxml2 configuration option is required for virtual machine monitoring, supported since Zabbix 2.2.0.
To configure the sources for a Zabbix server (with PostgreSQL etc.), you may run:
<code><span>#</span><span>.</span><span>/configure</span><span>-</span><span>-</span><span>enable</span><span>-</span><span>server</span><span>-</span><span>-</span><span>with</span><span>-</span><span>postgresql</span><span>-</span><span>-</span><span>with</span><span>-</span><span>net</span><span>-</span><span>snmp</span></code>
To configure the sources for a Zabbix proxy (with SQLite etc.), you may run:
<code><span>#</span><span>.</span><span>/configure</span><span>-</span><span>-</span><span>prefix=/usr</span><span>-</span><span>-</span><span>enable</span><span>-</span><span>proxy</span><span>-</span><span>-</span><span>with</span><span>-</span><span>net</span><span>-</span><span>snmp</span><span>-</span><span>-</span><span>with</span><span>-</span><span>sqlite3</span><span>-</span><span>-</span><span>with</span><span>-</span><span>ssh2</span></code>
To configure the sources for a Zabbix agent, you may run:
<code><span>#./configure --enable-agent</span></code>
Make and install everything
<code><span>#make install</span></code>
This step should be run as a user with sufficient permissions (commonly ‘root’, or by using sudo
).
Running make install
will by default install the daemon binaries (zabbix_server, zabbix_agentd, zabbix_proxy) in /usr/local/sbin and the client binaries (zabbix_get, zabbix_sender) in /usr/local/bin.
To specify a different location than /usr/local, use a
--prefix
key in the previous step of configuring sources, for example--prefix=/home/zabbix
. In this case daemon binaries will be installed under /sbin, while utilities under /bin. Man pages will be installed under /share.
Review and edit configuration files
- edit the Zabbix
agent
configuration file /usr/local/etc/zabbix_agentd.conf
You need to configure this file for every host with zabbix_agentd installed.
You must specify the Zabbix server IP address in the file. Connections from other hosts will be denied.
- edit the Zabbix server configuration file /usr/local/etc/zabbix_server.conf
You must specify the database name, user and password (if using any).
With SQLite the full path to database file must be specified; DB user and password are not required.
The rest of the parameters will suit you with their defaults if you have a small installation (up to ten monitored hosts). You should change the default parameters if you want to maximize the performance of Zabbix server (or proxy) though. See the performance tuning section for more details.
- if you have installed a Zabbix proxy, edit the proxy configuration file /usr/local/etc/zabbix_proxy.conf
You must specify the server IP address and proxy hostname (must be known to the server), as well as the database name, user and password (if using any)
With SQLite the full path to database file must be specified; DB user and password are not required.
Start up the daemons
Run zabbix_server on the server side.
<code><span>#zabbix_server</span></code>
Make sure that your system allows allocation of 36MB (or a bit more) of shared memory, otherwise the server may not start and you will see “Cannot allocate shared memory for .” in the server log file. This may happen on FreeBSD, Solaris 8.
See the “See also” section at the bottom of this page to find out how to configure shared memory.
Run zabbix_agentd on all the monitored machines.
<code><span>#zabbix_agentd</span></code>
Make sure that your system allows allocation of 2MB of shared memory, otherwise the agent may not start and you will see “Cannot allocate shared memory for collector.” in the agent log file. This may happen on Solaris 8.
If you have installed Zabbix proxy, run zabbix_proxy.
<code><span>#zabbix_proxy</span></code>
Installing Zabbix web interface
Copying PHP files
Zabbix frontend is written in PHP, so to run it a PHP supported webserver is needed. Installation is done by simply copying the PHP files from frontends/php to the webserver HTML documents directory.
<code><span>#mkdir /var/www/html/zabbix</span><span>#cd frontends/php</span><span># cp -a . /var/www/html/zabbix</span></code>
Installing frontend
Step 1
In your browser, open Zabbix URL: http://<server_ip_or_name></server_ip_or_name>
You should see the first screen of the frontend installation wizard.
Step 2
Make sure that all software prerequisites are met.
<code> Current <span>value</span> Required PHP <span>version</span><span>5.5</span><span>.9</span>-<span>1</span>ubuntu4<span>.12</span><span>5.3</span><span>.0</span> OK PHP option memory_limit <span>128</span>M <span>128</span>M OK PHP option post_max_size <span>8</span>M <span>16</span>M Fail PHP option upload_max_filesize <span>2</span>M <span>2</span>M OK PHP option max_execution_time <span>30</span><span>300</span> Fail PHP option max_input_time <span>60</span><span>300</span> Fail PHP <span>time</span> zone unknown Fail PHP databases support MySQL OK PHP bcmath <span><span>on</span><span>OK</span></span> PHP mbstring <span><span>on</span><span>OK</span></span> PHP sockets <span><span>on</span><span>OK</span></span> PHP gd <span>2.1</span><span>.1</span><span>2.0</span> OK PHP gd PNG support <span><span>on</span><span>OK</span></span> PHP gd JPEG support <span><span>on</span><span>OK</span></span> PHP gd FreeType support <span><span>on</span><span>OK</span></span> PHP libxml <span>2.9</span><span>.1</span><span>2.6</span><span>.15</span> OK PHP xmlwriter <span><span>on</span><span>OK</span></span> PHP xmlreader <span><span>on</span><span>OK</span></span> PHP ctype <span><span>on</span><span>OK</span></span> PHP session <span><span>on</span><span>OK</span></span> PHP session auto start off off OK PHP gettext <span><span>on</span><span>OK</span></span></code>
Resolve:
<code><span>#vim /etc/php5/fpm/php.ini</span><span>...</span><span>385</span><span>#max_execution_time = 30</span><span>386</span> max_execution_time = <span>300</span><span>396</span><span>#max_input_time = 60</span><span>397</span> max_input_time = <span>300</span><span>675</span><span>#post_max_size = 8M</span><span>676</span> post_max_size = 32M <span>883</span> date.timezone =<span>'Asia/Shanghai'</span></code>
make sure like this:
<code> Current <span>value</span> Required PHP <span>version</span><span>5.5</span><span>.9</span>-<span>1</span>ubuntu4<span>.12</span><span>5.3</span><span>.0</span> OK PHP option memory_limit <span>128</span>M <span>128</span>M OK PHP option post_max_size <span>32</span>M <span>16</span>M OK PHP option upload_max_filesize <span>2</span>M <span>2</span>M OK PHP option max_execution_time <span>300</span><span>300</span> OK PHP option max_input_time <span>300</span><span>300</span> OK PHP <span>time</span> zone Asia/Shanghai OK PHP databases support MySQL OK PHP bcmath <span><span>on</span><span>OK</span></span> PHP mbstring <span><span>on</span><span>OK</span></span> PHP sockets <span><span>on</span><span>OK</span></span> PHP gd <span>2.1</span><span>.1</span><span>2.0</span> OK PHP gd PNG support <span><span>on</span><span>OK</span></span> PHP gd JPEG support <span><span>on</span><span>OK</span></span> PHP gd FreeType support <span><span>on</span><span>OK</span></span> PHP libxml <span>2.9</span><span>.1</span><span>2.6</span><span>.15</span> OK PHP xmlwriter <span><span>on</span><span>OK</span></span> PHP xmlreader <span><span>on</span><span>OK</span></span> PHP ctype <span><span>on</span><span>OK</span></span> PHP session <span><span>on</span><span>OK</span></span> PHP session auto start off off OK PHP gettext <span><span>on</span><span>OK</span></span></code>
Step 3
Enter details for connecting to the database. Zabbix database must already be created.
Step 4
Enter Zabbix server details.
Step 5
Review a summary of settings.
Step 6
Download the configuration file and place it under conf/.
Step 7
Finish the installation.
Step 8
Zabbix frontend is ready! The default user name is Admin
, password zabbix
.
ISSUES
missing libmysqld-dev
<code><span>#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2</span><span>...</span>checking <span>for</span> mysql_config... no configure: error: MySQL <span>library</span> not found</code>
Resolve:
<code><span>#apt</span><span>-get</span> install <span>-y</span> libmysqld<span>-dev</span></code>
missing libxml2-dev
<code><span>#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2</span><span>...</span>checking <span>for</span> xml2-config... no configure: error: LIBXML2 <span>library</span> not found</code>
Resolve:
<code><span>#apt</span><span>-get</span> install <span>-y</span> libxml2<span>-dev</span></code>
missing libsnmp-dev
<code><span>#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2</span><span>...</span> checking <span>for</span> net-snmp-config... no configure: error: Invalid Net-SNMP directory - unable to find net-snmp-config</code>
Resolve:
<code><span>#apt</span><span>-get</span> install libsnmp<span>-dev</span></code>
missing libcurl4-openssl-dev
<code><span>#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2</span><span>...</span>checking <span>for</span> curl-config... no configure: error: Curl <span>library</span> not found </code>
Resolve:
<code><span>#apt</span><span>-get</span> install <span>-y</span> libcurl4<span>-openssl</span><span>-dev</span></code>
On the dashboard of zabbix, it’s display:
<code>"Zabbix server <span>is</span><span>not</span> running: the information displayed may <span>not</span><span>be</span> current."</code>
Resolve:
<code><span>#vim /var/www/html/zabbix/conf/zabbix.conf.php</span><span>$ZBX_SERVER</span> = <span>'localhost'</span>; > <span>$ZBX_SERVER</span> = <span>'192.168.22.122'</span>; <span>#your ip address</span><span>#</span></code>
版权声明:本文为博主原创文章,未经博主允许不得转载。
以上就介绍了deploy zabbix 2210 on ubuntu 1404 64bit,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

PHP和Python各有优势,选择应基于项目需求。1.PHP适合web开发,语法简单,执行效率高。2.Python适用于数据科学和机器学习,语法简洁,库丰富。

PHP不是在消亡,而是在不断适应和进化。1)PHP从1994年起经历多次版本迭代,适应新技术趋势。2)目前广泛应用于电子商务、内容管理系统等领域。3)PHP8引入JIT编译器等功能,提升性能和现代化。4)使用OPcache和遵循PSR-12标准可优化性能和代码质量。

PHP的未来将通过适应新技术趋势和引入创新特性来实现:1)适应云计算、容器化和微服务架构,支持Docker和Kubernetes;2)引入JIT编译器和枚举类型,提升性能和数据处理效率;3)持续优化性能和推广最佳实践。

在PHP中,trait适用于需要方法复用但不适合使用继承的情况。1)trait允许在类中复用方法,避免多重继承复杂性。2)使用trait时需注意方法冲突,可通过insteadof和as关键字解决。3)应避免过度使用trait,保持其单一职责,以优化性能和提高代码可维护性。

依赖注入容器(DIC)是一种管理和提供对象依赖关系的工具,用于PHP项目中。DIC的主要好处包括:1.解耦,使组件独立,代码易维护和测试;2.灵活性,易替换或修改依赖关系;3.可测试性,方便注入mock对象进行单元测试。

SplFixedArray在PHP中是一种固定大小的数组,适用于需要高性能和低内存使用量的场景。1)它在创建时需指定大小,避免动态调整带来的开销。2)基于C语言数组,直接操作内存,访问速度快。3)适合大规模数据处理和内存敏感环境,但需谨慎使用,因其大小固定。

PHP通过$\_FILES变量处理文件上传,确保安全性的方法包括:1.检查上传错误,2.验证文件类型和大小,3.防止文件覆盖,4.移动文件到永久存储位置。

JavaScript中处理空值可以使用NullCoalescingOperator(??)和NullCoalescingAssignmentOperator(??=)。1.??返回第一个非null或非undefined的操作数。2.??=将变量赋值为右操作数的值,但前提是该变量为null或undefined。这些操作符简化了代码逻辑,提高了可读性和性能。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

SublimeText3 Linux新版
SublimeText3 Linux最新版

禅工作室 13.0.1
功能强大的PHP集成开发环境

SublimeText3汉化版
中文版,非常好用

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

mPDF
mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),