Easy Way to Install Nginx Server on Ubuntu System

Install Nginx

sudo apt-get install nginx
     If you have installed Apache and Apache is running at this time, please modify the configuration file first (skip it if you don't have it): #Open

the configuration file
sudo vim /etc/nginx/sites- available/default
     and then modify it according to the following two (in order not to conflict with Apache):



server {
  #Modify here I will change 80 to 88
listen 88 default_server; #Also
  change here to the listening port you want
listen [::] :88 default_server ipv6only=on;
  .....

Run nginx

    /etc/init.d/nginx to

query the nginx process

    ps -ef | grep nginx

stop nginx
 
    kill -QUIT main process number

At this point , we test whether nginx is installed successfully, no If you make the above modification, enter localhost directly in the browser, and remember to add the port if you change it. Mine is localhost:88.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326437490&siteId=291194637