How to install ngnix server under Ubuntu

WBOY
Release: 2023-05-12 19:55:17
forward
649 people have browsed it

Install nginx

sudo
Copy after login
Copy after login

Modify nginx default port

sudo vi /etc/nginx/sites-enabled/default
Copy after login

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

Restart nginx server

sudo
Copy after login
Copy after login

Modify the default website directory

vi /etc/nginx/sites-enabled/default

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

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!