您好,欢迎访问代理记账网站
移动应用 微信公众号 联系我们

咨询热线 -

电话 15988168888

联系客服
  • 价格透明
  • 信息保密
  • 进度掌控
  • 售后无忧

乌班图安装nginx

sudo apt search nginx | grep ^nginx

查询仓库里面是否有nginx

 之后详细见:nginx: Linux packages

跟着步骤安装

安装完后输入

sudo systemctl status nginx

如果是非激活状态

● nginx.service - nginx - high performance web server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: inactive (dead)非激活
     Docs: https://nginx.org/en/docs/

启动

sudo systemctl start nginx

查询nginx文件所在位置

whereis nginx
nginx: /usr/sbin/nginx /usr/lib/nginx /etc/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz
usr:软件相关东西
etc:配置

nginx 主配置文件

cat nginx.conf



user (用户) nginx;   
worker_processes  auto;

error_log  /var/log/nginx/error.log notice; #日志(错误日志)
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

安装完之后访问内部防火墙,成功后将ip地址放至浏览器

 /etc/nginx/conf.d
curl localhost


分享:

低价透明

统一报价,无隐形消费

金牌服务

一对一专属顾问7*24小时金牌服务

信息保密

个人信息安全有保障

售后无忧

服务出问题客服经理全程跟进