linux-安装、启动nginx
2024-09-06 21:08:49
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..tar.gz
cd nginx-1.8.
./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
注:以上来自https://segmentfault.com/a/1190000013065982
4、启动:nginx安装目录地址 -c nginx配置文件地址
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
5、停止
nginx -s stop
6、重启
nginx -s reload
最新文章
- Scalaz(3)- 基础篇:函数概括化-Generalizing Functions
- an important difference between while and foreach on Perl
- struts2中用xml配置文件去验证填写信息
- 跟我一起学WCF(7)——WCF数据契约与序列化详解
- noip2003复赛普及组第一题——乒乓球
- Codeforces Round #307 (Div. 2) E. GukiZ and GukiZiana 分块
- IE10 下兼容性问题
- 关于本人遇到的nodejs的一些错误信息
- Maven 工程下 Spring MVC 站点配置 (三) C3P0连接池与@Autowired的应用
- js 常用方法记事本
- Linux的错误码
- Android Studio的使用(十二)怎样打包项目
- mysql数据库索引调优
- Ubuntu 中文拼音输入法键入异常
- python3学习笔记12(变量作用域)
- python note 10 函数变量
- Linux下java开发环境配置总结
- ssh访问服务器端visdom
- xenapp 6.5 客户端插件第一次安装总是跳到官网
- Ajax学习(二):模仿jQuery的Ajax封装工具