centos7環境下安裝Nginx

2021-09-27 05:03:50 字數 1176 閱讀 8385

(出處: linux教程網)

一、介紹:nginx是一款web'伺服器、反向**伺服器、電子郵件伺服器。

二、安裝

1、安裝nginx yum源

# rpm -ivh

2、安裝nginx

# yum -y install nginx

3、啟動nginx

# systemctl start nginx.service

若埠被其他服務占用,可以關閉其他服務或者開通81埠

(1)關閉其他服務

a、找到占用埠的服務

#  netstat -tnlp

b、關閉服務(關閉相應服務,不一定是apache)

c、重新啟動nginx

# systemctl start nginx.service

(2)開通81埠

a、開啟配置檔案

根據其引用配置找到

/etc/nginx/conf.d/*.conf

b、開啟被nginx.conf引用的檔案*.conf

# vi /etc/nginx/conf.d/*.conf

c、將80埠修改為81埠

儲存退出。

4、設定nginx開機自動啟動

# systemctl enable nginx.service

5、檢視nginx版本

# nginx -v

輸出如下:

nginx version: nginx/1.14.2  

已安裝上了最新穩定版的nginx。

三、測試(若使用的是80埠則不加埠號)

瀏覽器開啟

出現以下頁面即表示安裝成功:

四、解除安裝nginx

#yum -y remove nginx

centos7環境下安裝MySQL

安裝mysql官方的yum repository wget i cyum y install mysql57 community release el7 10.noarch.rpm安裝mysql服務 yum y install mysql community server啟動mysql服務 syst...

Centos7環境下安裝gitlab

1.安裝依賴 yum install curl openssh server openssh clients postfix cronie y 2.開啟postfix systemctl start postfix 3.設定postfix開機自啟動 systemctl enable postfix....

Centos7環境下安裝curl

curl是利用url語法在命令列方式下工作的開源檔案傳輸工具。它被廣泛應用在unix 多種linux發行版中,並且有dos和win32 win64下的移植版本。官網文件 wget2.解壓到當前目錄 tar zxf curl 7.54.0.tar.gz3.進入解壓後的目錄內 cd curl 7.54....