linux安装nginx
1.安装依赖
- yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
2. 下载nginx压缩包,并解压
- wget https://nginx.org/download/nginx-0.1.19.tar.gz
- 解压压缩包: tar -vxf nginx-0.1.19.tar.gz
3.编译安装
- cd nginx-0.1.19
- 配置安装路径:./configure --prefix=/usr/local/nginx
- 编译:make
- 安装:make install
4.启动并测试
启动nginx:/usr/local/nginx/sbin/nginx
验证测试:curl 127.0.0.1,如果返回以下信息则正常启动:
Welcome to nginx! Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.Thank you for using nginx.
```