怎样在CentOS下安装Nginx
1个回答
展开全部
1、如用源码安装,需要先准备编译环境
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel
2、下载所需安装包
pcre-8.13.tar.gz
nginx-1.8.0.tar.gz
zlib-1.2.5.tar.bz2
openssl-1.0.2d.tar.gz
3、安装pcre
tar zxf untar/pcre-8.13.tar.gz
pushd pcre-8.13
./configure;make;make install
popd
4、解压
tar zxf untar/nginx-1.8.0.tar.gz
tar jxf untar/zlib-1.2.5.tar.bz2
tar zxf untar/openssl-1.0.2d.tar.gz
5、编译nginx
pushd nginx-1.8.0
./configure \
–prefix=/usr/local/nginx \
–sbin-path=/usr/sbin \
–with-http_ssl_module \
–with-http_sub_module \
–with-http_flv_module \
–with-http_stub_status_module \
–with-zlib=../zlib-1.2.5 \
–with-openssl=../openssl-1.0.2d \
–with-pcre=../pcre-8.13
make;make install
popd
6、创建www用户
groupadd www
useradd -g www -d /dev/null -s /sbin/nologin www
7、创建脚本nginx,设置开机启动
/etc/init.d/nginx start
chkconfig nginx on
8、检查端口
netstat -ntlp |grep 80
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel
2、下载所需安装包
pcre-8.13.tar.gz
nginx-1.8.0.tar.gz
zlib-1.2.5.tar.bz2
openssl-1.0.2d.tar.gz
3、安装pcre
tar zxf untar/pcre-8.13.tar.gz
pushd pcre-8.13
./configure;make;make install
popd
4、解压
tar zxf untar/nginx-1.8.0.tar.gz
tar jxf untar/zlib-1.2.5.tar.bz2
tar zxf untar/openssl-1.0.2d.tar.gz
5、编译nginx
pushd nginx-1.8.0
./configure \
–prefix=/usr/local/nginx \
–sbin-path=/usr/sbin \
–with-http_ssl_module \
–with-http_sub_module \
–with-http_flv_module \
–with-http_stub_status_module \
–with-zlib=../zlib-1.2.5 \
–with-openssl=../openssl-1.0.2d \
–with-pcre=../pcre-8.13
make;make install
popd
6、创建www用户
groupadd www
useradd -g www -d /dev/null -s /sbin/nologin www
7、创建脚本nginx,设置开机启动
/etc/init.d/nginx start
chkconfig nginx on
8、检查端口
netstat -ntlp |grep 80
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
力控科技
2024-08-19 广告
2024-08-19 广告
ForceSCADA是力控科技信创产品的重要组成部分,具备完全自主知识产权,支持部署在Linux桌面版、服务器版、嵌入式等系统架构下。使用ForceSCADA可以搭建创新性高、扩展性佳、融合度强的SCADA平台,进而构建高效、智能化的监控中...
点击进入详情页
本回答由力控科技提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询