zabbix学习-安装nginx

zabbix服务端采用LNMP或者LAMP,我这里安装nginx,版本是nginx-1.12.1

需要提前安装的包,opssl,openssl-devel,pcre,pcre-devel,gcc*.

现将压缩包上传到linux服务器上,安装命令

./configure --prefix=/usr/local/nginx-1.12.1 --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-pcre

其中/usr/local/nginx-1.12.1 是指nginx的安装路径

上述命令执行完毕后,如果没有报错,接着执行make   make install

安装完成后,执行命令curl -s http://localhost,如下:

[root@zabbixserver nginx-1.12.1]# curl -s http://localhost
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
         35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html> 

或者在浏览器里访问:主机IP

启动:

/usr/local/nginx-1.12.1/sbin/nginx

关闭:

/usr/local/nginx-1.12.1/sbin/nginx -s stop

重置:(当配置文件更改时,可以不用重启来让新的配置生效)

/usr/local/nginx-1.12.1/sbin/nginx -s reload

------------先简单安装,后面再研究----------

原文地址:https://www.cnblogs.com/cq90/p/7221568.html