标签:脚本 nec listen chkconfig read alt 启动脚本 hup setting
yum install zabbix-server-mysql zabbix-web-mysql zabbix-sender yum install zabbix-agent
# mysql -uroot mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by ‘zabbix‘; mysql> exit
# cd /usr/share/doc/zabbix-server-mysql-2.2.0/create # mysql -uroot -p zabbix < schema.sql # mysql -uroot -p zabbix < images.sql # mysql -uroot -p zabbix < data.sql
DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix
Start Zabbix server process.
# service zabbix-server start
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 date.timezone = Asia/Shanghai
nginx-1.6.2.tar.gz openssl-1.0.1c.tar.gz pcre-8.34.tar.gz zlib-1.2.8.tar.gz
yum -y install openssl openssl-devel ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module 可能会提示libpcre.so.1找不到 ln -s /usr/local/lib/libpcre.so.1 /lib64/ 安装php-fpm yum install php php-fpm
chown -R nginx:nginx /usr/share/zabbix/ chown -R nginx:nginx /etc/zabbix/web/
# cat nginx.conf|grep -v "#" user nginx; worker_processes 4; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; charset utf-8; access_log /var/log/nginx/zabbix.access.log; error_log /var/log/nginx/zabbix.error.log; location / { root /usr/share/zabbix/; allow 你的IP; deny all; index index.php index.html index.htm; } location ~ \.php$ { root /usr/share/zabbix/; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/zabbix$fastcgi_script_name; include fastcgi_params; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }
#!/bin/sh # # nginx - this script starts and stops the nginx daemin # # chkconfig: - 85 15 # description: Nginx is an HTTP(S) server, HTTP(S) reverse # proxy and IMAP/POP3 proxy server # processname: nginx # config: /usr/local/nginx/conf/nginx.conf # pidfile: /usr/local/nginx/logs/nginx.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "$NETWORKING" = "no" ] && exit 0 nginx="/usr/local/nginx/sbin/nginx" prog=$(basename $nginx) NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" lockfile=/var/lock/subsys/nginx start() { [ -x $nginx ] || exit 5 [ -f $NGINX_CONF_FILE ] || exit 6 echo -n $"Starting $prog: " daemon $nginx -c $NGINX_CONF_FILE retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval } stop() { echo -n $"Stopping $prog: " killproc $prog -QUIT retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { configtest || return $? stop start } reload() { configtest || return $? echo -n $"Reloading $prog: " killproc $nginx -HUP RETVAL=$? echo } force_reload() { restart } configtest() { $nginx -t -c $NGINX_CONF_FILE } rh_status() { status $prog } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart|configtest) $1 ;; reload) rh_status_q || exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}" exit 2 esac
标签:脚本 nec listen chkconfig read alt 启动脚本 hup setting
原文地址:http://www.cnblogs.com/skyflask/p/7499913.html