自动安装nginx-hades
touch install-nginx.shchmod +x install-nginx.sh
vim install-nginx.sh
#/bin/bash
# auto installnginx-1.4.2
#author swh
echo-e"Nginx will be installing,\nplease wait......"
yum install -y gcc automake autoconf libtool make
yum install -y gcc gcc-c++
yum install -y pcre* zlib*openssl*
mkdir/usr/local/nginx
groupadd nginx
useradd-r nginx -gnginx -s /sbin/nologin
chown-R nginx:nginx/usr/local/nginx
wget http://nginx.org/download/nginx-1.4.2.tar.gz
tar -zxvf nginx-1.4.2.tar.gz
cd nginx-1.4.2
./configure --prefix=/usr/local/nginx--user=nginx--group=nginx --with-http_ssl_module
make && make install
echo"Nginx install over,Now checking....."
/usr/local/nginx/sbin/nginx
netstat-tuplna|grepnginx
ps -ef | grep nginx
ret=$?
if [ $ret-eq 0 ]
then
echo"Nginx install sucess"
echo;echo
echo "`/usr/local/nginx/sbin/nginx -V`"
elif [ $ret -ne 0 ]
netstat -tuplna | grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 4515/nginx
# ps -ef |grep nginx
root 4515 10 10:36 ? 00:00:00 nginx: master process /home/nginx/sbin/nginx
www 451845150 10:36 ? 00:00:00 nginx: worker process
root 1178722010 11:24 pts/0 00:00:00 grep nginx
页:
[1]