Demand:
Openresty Installation Location:/usr/local/openresty nginx log/data/www/logs code directory/data/www/htdocs
Installation dependencies
Yum install pcre-devel openssl-devel gcc Curl
To the Openresty download installation package 1.13.6.1, placed in the home directory.
Tar zxf openresty-1.13.6.1.tar.gz
cd openresty-1.13.6.1
./configure--prefix=/usr/local/openresty-- With-debug \
--error-log-path=/data/www/logs/error_nginx.log \
--http-log-path=/data/www/logs/access_ Nginx.log \
--user=root--with-http_stub_status_module \
-with-http_ssl_module --with-http_gzip_ Static_module
gmake
gmake Install
steps to install after installation complete
vim/etc/profile.d/openresty.sh
export path=/usr/local/openresty/nginx/sbin: $PATH
./etc/profile.d/ openresty.sh
Setting up boot up and specifying service files
Oh ah, here is a copy of someone else's bar, all content on the path of the place modified to the above installation location.
[Root@bogon bin]# Vim/etc/init.d/nginx
# processname:nginx #
config: /usr/local/openresty/nginx/nginx.conf
# config: /etc/sysconfig/ Nginx
# pidfile: /var/run/nginx.pid
# Source function library ...
/etc/rc.d/init.d/functions
# Source networking configuration.
/etc/sysconfig/network
# Check that networking are up.
["$NETWORKING" = "no"] && exit 0
nginx= "/usr/local/openresty/nginx/sbin/nginx"
prog=$ (basename $ Nginx)
nginx_conf_file= "/usr/local/openresty/nginx/conf/nginx.conf"
[-f/etc/sysconfig/nginx] & &. /etc/sysconfig/nginx
Fix the path on line 15th above.
And then
Chkconfig--add nginx
chkconfig nginx on
Finish