A simple way to install a nginx server on an Ubuntu system _nginx

Source: Internet
Author: User
Tags nginx server pkill

Install Nginx

sudo apt-get install Nginx 

If you have Apache installed, and Apache is running at this time, please modify the configuration file first (no students skip directly):

#打开配置文件 
sudo vim/etc/nginx/sites-available/default 

Then modify the following two (in order not to conflict with Apache):

server { 
  #修改这里 I will change 80 to 
 listen default_server; 
  #还有这里 also change to the listening port you want 
 listen [::]:88 default_server ipv6only=on; 
  ..... 


At this point, we test nginx whether the installation is successful, did not do the above changes directly in the browser input localhost, changed remember to add the port, my is localhost:88, if the following interface will be installed successfully:


startup and shutdown of Nginx

Start Nginx:

# nginx-c/etc/nginx/nginx.conf 
close Nginx

# nginx-s Stop
Reread profile

# nginx-s Reload
# pkill-hup nginx<  c6/> re-open log file

# nginx-s reopen
# PKILL-USR1 Nginx
can also download nginx files in/etc/init.d/nginx RPM packages, modify the path to use:

# Service Nginx {start|stop|status|restart|reload|configtest|}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.