动态 版块 发帖 消息 我的
Loading...
小绿叶技术博客
小绿叶技术博客
小绿叶技术Lv153   
linux ububtu/centos 安装nginx 开启 tcp 和 文件目录浏览功能     


sudoc=sudo 
nginx_Compilation_method()
{
    $sudoc chmod 777 -R ./

     ./configure --prefix=./   --with-stream --with-http_stub_status_module
     # nginx 开启 tcp 和 文件浏览模块:  --with-stream --with-http_stub_status_module
    
    NR=`cat -n ./src/os/unix/ngx_user.c | grep cd.current_salt | awk -F" " '{print $1}'`        ; sleep 0.5
    $sudoc sed -i "$NR d" ./src/os/unix/ngx_user.c                                              ; sleep 0.5
    $sudoc sed -i "s/-Werror/ /g" objs/Makefile                                                 ; sleep 0.5
    # 先修改 c 文件,再修改make

    $sudoc mkdir $setdir/logs ; $sudoc chmod 777 $setdir/logs
    $sudoc make                                                                                 ; sleep 1         # make  会生成 新文件,新文件也需要修改才能编译
    $sudoc sed -i "s/-Werror/ /g" objs/Makefile                                                 ; sleep 0.5
    $sudoc make install

    nginx_file_list
}

nginx_file_list()
{

echo "
    sudo nano conf/nginx.conf
# http 模块外面写 tcp 配置路径:   include  /www/wwwconf/tcp/*.conf;
# http 模块 里面 http{} 写:      include /www/wwwconf/http/*.conf;

sudo mkdir -p /www/wwwconf/tcp /www/wwwconf/http ; sudo chmod 777 -R /www/wwwconf/*

sudo nano /www/wwwconf/http/web.conf
# 开启文件浏览器功能
server{
    listen 800;
    #server_name eisc.cn
    root /datadisk/eisc/download;

     location / {
                #root /mnt/software;            #我们开始新建的目录
                autoindex on;                   #以列表信息显示目录文件
                index index.html index.htm;
                charset utf-8;
        }
}


sudo nano /www/wwwconf/tcp/tcp.conf
# tcp 转发 
  stream {
       upstream eisc { server 8.219.134.200:1180;        }
       server        { listen 1180; proxy_pass   eisc;   }
  }
  
"

}


 1  已被阅读了238次  楼主 2023-07-10 10:12:07
回复列表

回复:linux ububtu/centos 安装nginx 开启 tcp 和 文件目录浏览功能

guest
登录之后更精彩~
Powered by HadSky 7.12.10
© 2015-2023 PuYueTian
您的IP:8.219.134.200,2023-10-04 00:44:30,Processed in 0.02359 second(s).
Powered by HadSky
小绿叶技术博客