linux安裝nginx
时间: 2023-10-15 07:24:16 浏览: 92
要在Linux上安装Nginx,您可以按照以下步骤操作:
1. 创建一个文件夹并进入该文件夹:
```shell
cd /usr/local
mkdir nginx
cd nginx
```
2. 下载Nginx的安装包并解压:
```shell
wget http://nginx.org/download/nginx-1.13.7.tar.gz
tar -xvf nginx-1.13.7.tar.gz
```
3. 安装Nginx的依赖库:
```shell
# 安装pcre库
yum install -y pcre-devel
# 安装zlib库
yum install -y zlib-devel
# 安装OpenSSL库
yum install -y openssl-devel
```
4. 进入解压后的Nginx目录,配置和编译Nginx:
```shell
cd nginx-1.13.7
./configure
make
make install
```
5. 启动Nginx服务:
```shell
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
```
请确保按照以上步骤一步一步执行,并根据您的需求进行相应的配置修改。 <span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [LINUX安装nginx详细步骤](https://blog.csdn.net/t8116189520/article/details/81909574)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文