• padavan解决没有u盘不能安装nginx问题


    padavan下载源
    http://h5ppt.com/bin.entware.net/mipselsf-k3.4/

    首先opkg install nginx-extras
    安装好后用winscp连接路由器
    修改/opt/etc/nginx/nginx.conf中第一行user
    将nobody 改成user admin root;

    参考
    https://blog.csdn.net/u011066470/article/details/122279857
    https://www.right.com.cn/forum/thread-753365-1-1.html
    将nobody 改成***user admin root;***
    /opt/etc/nginx/nginx.conf完整文件如下

    user admin root;
    worker_processes auto;
    pid /opt/var/run/nginx.pid;
    include /opt/etc/nginx/modules-enabled/*.conf;
    
    events {
    	worker_connections 768;
    	# multi_accept on;
    }
    
    http {
    
    	##
    	# Basic Settings
    	##
    
    	sendfile on;
    	tcp_nopush on;
    	tcp_nodelay on;
    	keepalive_timeout 65;
    	types_hash_max_size 2048;
    	# server_tokens off;
    
    	# server_names_hash_bucket_size 64;
    	# server_name_in_redirect off;
    
    	include /opt/etc/nginx/mime.types;
    	default_type application/octet-stream;
    
    	##
    	# SSL Settings
    	##
    
    	ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    	ssl_prefer_server_ciphers on;
    
    	##
    	# Logging Settings
    	##
    
    	access_log /opt/var/log/nginx/access.log;
    	error_log /opt/var/log/nginx/error.log;
    
    	##
    	# Gzip Settings
    	##
    
    	gzip on;
    	gzip_disable "msie6";
    
    	# gzip_vary on;
    	# gzip_proxied any;
    	# gzip_comp_level 6;
    	# gzip_buffers 16 8k;
    	# gzip_http_version 1.1;
    	# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    
    	##
    	# Virtual Host Configs
    	##
    
    	include /opt/etc/nginx/conf.d/*.conf;
    	include /opt/etc/nginx/sites-enabled/*;
    server {
        listen 81;
        server_name localhost;
        root /opt/share/www/;
        #index index.html index.htm index.php tz.php;
        
                    location / {
                index  index.html index.htm index.php l.php;
               autoindex  off;
            }
    }}
    
    
    #mail {
    #	# See sample authentication script at:
    #	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
    # 
    #	# auth_http localhost/auth.php;
    #	# pop3_capabilities "TOP" "USER";
    #	# imap_capabilities "IMAP4rev1" "UIDPLUS";
    # 
    #	server {
    #		listen     localhost:110;
    #		protocol   pop3;
    #		proxy      on;
    #	}
    # 
    #	server {
    #		listen     localhost:143;
    #		protocol   imap;
    #		proxy      on;
    #	}
    #}
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97

    打开opt/etc/nginx/sites-available
    找到defalut文件双击打开后如下
    修改listen 将原来的80改为81
    最后在ssh界面启动nginx

    /opt/etc/init.d/S80nginx start

    参考文章
    openwrt 安装nginx 冲突
    Nginx 安装后 /etc/init.d/ 没有nginx 配置得启动服务
    Nginx通过/etc/init.d/nginx方式启动或停止服务
    启动Nginx出现Failed to start nginx.service:unit not found
    斐讯K2P刷OpenWrt,并使用Nginx做服务,添加ssl

    老毛子Padavan一键安装LNMP后部署自建网站教程(例子: mayswind的Aria-Ng新Web前端 )

    修改nginx配置文件

    打开/opt/etc/nginx/vhost复制一份配置

    家用存储折腾之9-OpenWrt安装web环境(nginx+php)

    老毛子固件ONMP自动覆盖NGINX配置怎么办
    /opt/etc/nginx/vhost/default.conf修改后保存重启服务后还变成默认的,直接修改\opt\etc\nginx\nginx.conf这个配置还不会生效

    opt/etc/nginx/sites-available完整文件如下

    
    
    ##
    # You should look at the following URL's in order to grasp a solid understanding
    # of Nginx configuration files in order to fully unleash the power of Nginx.
    # https://www.nginx.com/resources/wiki/start/
    # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
    # https://wiki.debian.org/Nginx/DirectoryStructure
    #
    # In most cases, administrators will remove this file from sites-enabled/ and
    # leave it as reference inside of sites-available where it will continue to be
    # updated by the nginx packaging team.
    #
    # This file will automatically load configuration files provided by other
    # applications, such as Drupal or Wordpress. These applications will be made
    # available underneath a path with that package name, such as /drupal8.
    #
    ##
    
    # Default server configuration
    #
    server {
    	listen 81 default_server;
    	listen [::]:81 default_server;
    
    	# SSL configuration
    	#
    	# listen 443 ssl default_server;
    	# listen [::]:443 ssl default_server;
    	#
    	# Note: You should disable gzip for SSL traffic.
    	# See: https://bugs.debian.org/773332
    	#
    	# Read up on ssl_ciphers to ensure a secure configuration.
    	# See: https://bugs.debian.org/765782
    	#
    	# Self signed certs generated by the ssl-cert package
    	# Don't use them in a production server!
    	#
    	# include snippets/snakeoil.conf;
    
    	root /opt/share/www;
    
    	# Add index.php to the list if you are using PHP
    	index index.html index.htm index.nginx-debian.html;
    
    	server_name _;
    
    	location / {
    		# First attempt to serve request as file, then
    		# as directory, then fall back to displaying a 404.
    		try_files $uri $uri/ =404;
    	}
    
    	# pass PHP scripts to FastCGI server
    	#
    	#location ~ \.php$ {
    	#	include snippets/fastcgi-php.conf;
    	#
    	#	# With php-fpm (or other unix sockets):
    	#	fastcgi_pass unix:/opt/var/run/php7-fpm.sock;
    	#	# With php-cgi (or other tcp sockets):
    	#	fastcgi_pass 127.0.0.1:9000;
    	#}
    
    	# deny access to .htaccess files, if Apache's document root
    	# concurs with nginx's one
    	#
    	#location ~ /\.ht {
    	#	deny all;
    	#}
    }
    
    
    # Virtual Host configuration for example.com
    #
    # You can move that to a different file under sites-available/ and symlink that
    # to sites-enabled/ to enable it.
    #
    #server {
    #	listen 80;
    #	listen [::]:80;
    #
    #	server_name example.com;
    #
    #	root /opt/share/www/example.com;
    #	index index.html;
    #
    #	location / {
    #		try_files $uri $uri/ =404;
    #	}
    #}
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
  • 相关阅读:
    如何使用 Spring Data JPA 在存储过程中使用 IN、OUT 和 INOUT 参数
    linux查看服务器登录成功和登录失败的命令
    模板_整数二分
    皕杰报表在tomcat的server.xml中配置了什么?
    [ARC098F] Donation(找性质+点 Kruskal 重构树)
    安徽校园招聘黄金时间
    openGauss学习笔记-95 openGauss 数据库管理-访问外部数据库-postgres_fdw
    【数据结构】栈的知识点总结--关于栈的定义和基本操作;C语言实现栈;顺序栈;链栈;共享栈;栈的易错点的总结
    前端工作总结248-uni-预加载问题
    Hybrid app混合开发的一些经验和总结
  • 原文地址:https://blog.csdn.net/weixin_40938312/article/details/125472323