如何安装nginx
展开全部
部署安装nignx的环境
yum -y install gcc gcc-c++ ncurses-devel libxml2-devel \
openssl-devel curl-devel libjpeg-devel libpng-devel autoconf pcre-devel \
libtool-libs freetype-devel gd zlib-devel zip unzip \
wget crontabs iptables file bison cmake patch mlocate \
flex diffutils automake make readline-devel \
glibc-devel glibc-static glib2-devel bzip2-devel \
gettext-devel libcap-devel logrotate ntp \
libmcrypt-devel patch
2.下载安装nginx
wget http://nginx.org/download/nginx-1.10.2.tar.gz --获取nignx安装包
tar -zxvf ./nginx-1.10.2.tar.gz --解压安装包
cd ./nginx-1.10.2
./configure
--with-stream ---开启tcp代理
--with-http_ssl_module ---开启https
make ---编译nginx
make install --安装nginx
3.启动nginx
nginx 启动命令 (注意nginx默认使用80端口,如果80端口已经使用,请去nginx.conf修改默认端口)
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
4.yum安装nginx。
yum -y install nginx
service nginx start --启动nginx
service nginx stop --停止nginx
service nginx restart --重启nginx
5.编译安装的nginx配置文件在/usr/local/nginx/conf/nginx.conf,网站在/usr/local/nginx/html/下面。yum安装的nginx配置文件在/etc/nginx/nginx.conf,网站在/var/www/html/下面
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |