从华为云镜像站下载nginx源码,并编译安装nginx.
[root@openEuler ~]# wget https://repo.huaweicloud.com/nginx/nginx-1.9.9.tar.gz
解压与编译
tar -zxvf nginx-1.9.9.tar.gz
cd nginx-1.9.9
./configure
make
make install
进入安装目录
[root@openEuler nginx-1.9.9]# cd /usr/local/nginx/sbin/
启动nginx
[root@openEuler sbin]# nginx
测试是否安装成功,访问网页
[root@openEuler sbin]# curl http://127.0.0.1
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is requir

本文介绍了如何从华为云镜像站下载nginx源码,进行编译安装,并详细讲述了如何配置主机防火墙服务,确保计算机重启后仍能通过网页访问nginx的首页。在过程中,涉及到了防火墙规则的查看与修改,以开放80端口确保正常访问。
最低0.47元/天 解锁文章
1571

被折叠的 条评论
为什么被折叠?



