NGINX安装
1、官网下载
http://nginx.org/en/download.html
2、上传到服务器安装目录
3、解压
tar -zxvf nginx-1.20.1.tar.gz
4、安装依赖
yum -y install gcc
yum -y install pcre pcre-devel
yum -y install openssl openssl-devel
cd nginx-1.20.1
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
make install
6、配置环境变量
vi /etc/profile
添加内容:
export PATH=/usr/local/nginx/sbin:$PATH
刷新配置:
source /etc/profile
7、启动服务
nginx
8、访问主页
shell> curl http://127.0.0.1
9、停止服务
shell> nginx -s stop