tar -zxvf ngx_cache_purge-1.6.tar.gz
mv ngx_cache_purge-1.6 /usr/local/ngx_cache_purge
tar -zxvf nginx-1.3.5.tar.gz
cd nginx-1.3.5
./configure --prefix=/usr/local/nginx --user=nobody --group=nobody --with-http_stub_status_module --with-openssl=/usr/include/openssl --with-pcre=/tmp/pcre-8.31 --add-module=/usr/local/ngx_cache_purge --with-http_gzip_static_module
# 注意:--with-pcre指向的是源码包解压的路径,而不是安装的路径,否则编译会报错
make
make install
chown -R nobody:nobody /usr/local/nginx/html/
4.设置nginx开机启动
vi /etc/rc.d/init.d/nginx
#!/bin/bash # nginx Startup script for the Nginx HTTP Server # it is v.1.3.0 version. # chkconfig: - 85 15 # description: Nginx is a high-performance web and proxy server. # It has a lot of features, but it's not for everyone. # processname: nginx # pidfile: /var/run/nginx.pid # config: /usr/local/nginx/conf/nginx.conf nginxd=/usr/local/nginx/sbin/nginx nginx_config=/usr/local/nginx/conf/nginx.conf nginx_pid=/usr/local/nginx/logs/nginx.pid RETVAL=0 prog="nginx" # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -x $nginxd ] || exit 0 # Start nginx daemons functions. start() { if [ -e $nginx_pid ];then echo "nginx already running...." exit 1 fi echo -n $"Starting $prog: " daemon $nginxd -c ${nginx_config} RETVAL=$? echo [ $RETVAL = 0 ] && touch /var/lock/subsys/nginx return $RETVAL } # Stop nginx daemons functions. stop() { echo -n $"Stopping $prog: " killproc $nginxd RETVAL=$? echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /usr/local/nginx/logs/nginx.pid } reload() { echo -n $"Reloading $prog: " #kill -HUP `cat ${nginx_pid}` killproc $nginxd -HUP RETVAL=$? echo } # See how we were called. case "$1" in start) start ;; stop) stop ;; reload) reload ;; restart) stop start ;; status) status $prog RETVAL=$? ;; *) echo $"Usage: $prog {start|stop|restart|reload|status|help}" exit 1 esac exit $RETVAL
chmod +x /etc/rc.d/init.d/nginx
chkconfig nginx on
service nginx start
在浏览器地址栏里输入,如果显示“Welcome to nginx!”则表示nginx安装成功。
5.安装resin
tar -zxvf resin-4.0.30
cd resin-4.0.30
./configure --prefix=/usr/local/resin
make
make install
service resin start
在浏览器地址栏里输入:8080,出现如下图页面则表示resin安装成功。