最近搞了很多了Ubuntu服务器,命令和CentOS有些区别

记录一下,备用

增加用户:

手动加
groupadd pm2  
useradd -m -s /bin/bash -g pm2 pm2

一步一步加
adduser pm2  

装nginx

sudo apt-get -y install nginx  
sudo vi /etc/nginx/sites-available/gogs  
server {  
    listen 80;
    server_name your_server_ip;

    proxy_set_header X-Real-IP  $remote_addr; # pass on real client IP

    location / {
        proxy_pass http://localhost:3000;
    }
}

php的部分:  
        root     /export/www;
        location / {
             try_files $uri $uri/ /index.php$is_args$args;
             index index.php;
        }
        location ~ \.php$ {
                try_files $uri /index.php =404;
                fastcgi_pass unix:/var/run/php-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
sudo ln -s /etc/nginx/sites-available/gogs /etc/nginx/sites-enabled/gogs  
sudo service nginx restart  
comments powered by Disqus