Linux环境下的Nginx编译与安装

1.新建文件夹:

mkdir -p /zuker

cd /zuker

 

2.编译:

yum -y install gcc-c++ make wget autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxm12 libxm12-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel ssse2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

 

3.下载软件包:

wget http://soft.beauty-soft.net/lib/nginx-1.3.8.tar.gz

wget http://soft.beauty-soft.net/lib/pcre-8.10.tar.gz 

 

4.安装pcre:

tar zxvf pcre-8.10.tar.gz

cd pcre-8.10/

./configure

make && make  install

cd ../

 

5.创建Nginx运行用户及用户组:

groupadd -g 402 www

useradd www -g www

 

6.安装Nginx-1.3.8:

tar zxvf nginx-1.3.8.tar.gz

cd nginx-1.3.8

./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

make

make install

 

7.启动服务:/usr/local/nginx/sbin/nginx

 

8.找了半天为啥可以ping通主机,但是网页打不开,最后才发现原来是我的主机配置安装组问题:应该配置成安全组放通全部端口

 

posted @ 2016-11-30 19:53  小春熙子  阅读(496)  评论(0编辑  收藏  举报