Installation and configuration of the Web server Nginx uninstall the old version of Nginx
sudo apt-get--purge remove Nginxsudo apt-get autoremovedpkg--get-selections|grep nginx//will list the software related to Nginx, Remove sudo apt-get--prege remove nginx-common1234 as Nginx-common
Installing Nginx
tar -zxvf nginx-1.10.2.tar.gzcd nginx-1.10.2.tar.gz./configure //Note the information in the terminal, Missing library file Remember to install on re-configure line make sudo make install12345
Nginx Reverse proxy configuration
server { listen 8001; server_name localhost; charset utf-8; access_log /home/codemap.access.log; location / { proxy_set_header X-Forwarded-For $remote _addr</span><span class= "pun" >;</span></code> </li><li class= "L9" ><code><span class= "PLN" > proxy_set_header </span><span class= "Typ" >host</span><span class= "PLN" > $http _host; proxy_pass http://127.0.0.1:8000; }} 12345678910
Worker_processes 4; The number of processes, generally equal to the number of computer CPU cores events {Worker_connections 1024;//maximum number of links}http {//config file root include mime.types; Default_type Application/octet-stream; Sendfile on; #tcp_nopush on; #keepalive_timeout 0; Keepalive_timeout 65; #gzip on; The configuration file introduced by include codemap.conf;//}1234567891011121314
Common commands
Restart nginx:/usr/local/nginx/sbin/nginx-s reopen1 Reload config file:/uar/local/nginx/sbin/nginx-s reload 1 start:/uar/local/nginx/ SBIN/NGINX1 off:/uar/local/nginx/sbin/nginx-s STOP1
Process Management Tools Supervisor Installation
Terminal installation
Apt-get Install Supervisor1
Supervisor Configuration
[program:ggyun]directory = /home/noah/documents/src/github.com/hivenkay/ggyun // Project Path command = /home/noah/documents/src/github.com/hivenkay/ggyun/ggyun // Executable binary file path autostart = true //whether the braking start autorestart=true //automatically restarts startsecs = 5user = root //Execute User redirect_stderr = truestdout_logfile = /var/ log/supervisord/ggyun.logstderr_logfile =/var/log/supervisord/ghost_err.log12345678910
Supervisor Common Commands
Supervisorctl start ggyun//Start process 1supervisorctl Restart ggyun//Restart process 1supervisorctl Reload//Restart SUPERVISORCTL1
Supervisor problems that may occur after installation
sudo touch/var/run/supervisor.sock1sudo chmod 777/var/run/supervisor.sock1sudo service Supervisor Restart1
Connecting to a remote server
SSH [email protected]//root for username, 139.196.180.208 for server ip1
scp/home/noah/documents/... [Email protected]:/home/noah/documents/...
[3]supervisor Use management: Implements an automatic restart of an abnormal interrupt subprocess (for example, Nginx and Apache)