linux-安装nginx
1、下载安装pcre库
pcre是一个正则表达式库,nginx的rewrite模块需要依赖该库。
下载地址:http://www.pcre.org/
wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.gz tar -zxvf pcre-8.40.tar.gz cd pcre-8.40 ./configure make make install
2、下载安装nginx
下载地址:http://nginx.org/
wget http://nginx.org/download/nginx-1.8.1.tar.gz tar -zxvf nginx-1.8.1.tar.gz cd nginx-1.8.1 ./configure make make install
3、验证安装是否成功
默认安装路径:/usr/local/nginx
建立软链接(配置启动命令,不管在哪级目录,都可以采用nginx直接操作命令):
ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/nginx(操作命令名称)
执行nginx命令验证是否安装成功:
nginx -t
安装成功:
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
相关推荐
nginxs 2020-11-14
Guanjs0 2020-11-13
小木兮子 2020-11-11
yserver 2020-11-11
ssihc0 2020-11-11
windle 2020-11-10
HanksWang 2020-11-10
liuchen0 2020-11-10
Freshairx 2020-11-10
ccschan 2020-11-10
liwf 2020-11-10
Guanjs0 2020-11-09
AderStep 2020-11-09
zrtlin 2020-11-09
mqfcu 2020-11-10
windle 2020-10-29