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|}