在Ubuntu 18.04上安装Nginx

NGINX pronounced as engine-x is an open source and popular HTTP server and can be configured to act as a reverse proxy and a load balancer.

NGINX的发音为engine-x是开放源代码和流行的HTTP服务器,可以配置为充当反向代理和负载平衡器。

In comparison with Apache, NGINX is less resource hungry and can serve a large number of concurrent request due to its event-based and asynchronous architecture.

与Apache相比,NGINX由于其基于事件和异步的体系结构,因此较少占用资源,并且可以处理大量并发请求。

Although Apache has a lead in the market share NGINX is steadily gaining the ground over the last few years. In this article, we will explore how to install NGINX on Ubuntu 18.04 along with configuring a virtual host.

尽管Apache在市场份额方面处于领先地位,但NGINX在过去几年中稳步发​​展。 在本文中,我们将探讨如何在Ubuntu 18.04上安装NGINX以及配置虚拟主机。

先决条件 (Prerequisites)

You can SSH into the Ubuntu 18.04 system using the root or a sudo enabled user. If you are logged in as root, then you can run the commands as it is. If you are using a sudo enabled used, please prefix the commands with “sudo”.

您可以使用启用了root或sudo的用户SSH进入Ubuntu 18.04系统。 如果您以root用户身份登录,则可以按原样运行命令。 如果您使用的是启用了sudo的命令,请在命令前加上“ sudo”。

更新系统 (Update the system)

Before you start installing NGINX, it is always recommended to upgrade your Ubuntu 18.04 to the latest. The following apt-get commands will do it for you.

在开始安装NGINX之前,始终建议您将Ubuntu 18.04升级到最新版本。 以下apt-get命令将为您完成此操作。

# apt-get update 
# apt-get upgrade

The first command will update the list of available packages and their versions and the second one will actually install the newer versions of the packages that you have.

第一个命令将更新可用软件包及其版本的列表,第二个命令将实际安装所拥有软件包的较新版本。

Once you are done with upgrading t

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值