Home  >  Article  >  Operation and Maintenance  >  How to install ngnix server under Ubuntu

How to install ngnix server under Ubuntu

WBOY
WBOYforward
2023-05-12 19:55:17781browse

Install nginx

sudo

Modify nginx default port

sudo vi /etc/nginx/sites-enabled/default

listen 81 default_server;
Modify the port number you need
listen 81 default_server;

Restart nginx server

sudo

Modify the default website directory

vi /etc/nginx/sites-enabled/default

#root /var/www/html;
root /usr/share/nginx/html; # 修改默认网站目录

Restart nginx server

The above is the detailed content of How to install ngnix server under Ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete