• Suse linux 11 SP2 nginx 使用笔记


    1. 下载源代码
     
    2. DAV模块缺省没有编译,要加入编译选项
    # ./configure --with-http_dav_module
     
    # make install
     
    # cd /usr/local/nginx/sbin
     
    # ./nginx
     
    # ps -ef | grep nginx
     
    # ps -ef | grep nginx
    root      7330     1  0 22:46 ?        00:00:00 nginx: master process ./nginx
    nobody    7331  7330  0 22:46 ?        00:00:00 nginx: worker process
     
    # ./nginx -h
    nginx version: nginx/1.4.2
    Usage: nginx [-?hvVtq] [-s signal] [-c filename] [-p prefix] [-g directives]

    Options:
      -?,-h         : this help
      -v            : show version and exit
      -V            : show version and configure options then exit
      -t            : test configuration and exit
      -q            : suppress non-error messages during configuration testing
      -s signal     : send signal to a master process: stop, quit, reopen, reload
      -p prefix     : set prefix path (default: /usr/local/nginx/)
      -c filename   : set configuration file (default: conf/nginx.conf)
      -g directives : set global directives out of configuration file
     
     
    2. WebDav设置
    nginx的缺省html目录/usr/local/nginx/html, 为了以后的WebDav测试,先简单将权限设置为777
    # chmod 777 /usr/local/nginx/html
     
    nignx 源代码不包含digest认证模块
     
    下载digest模块并解压到目录nginx-http-auth-digest-master
     
    # ./configure --with-http_dav_module  --add-module=nginx-http-auth-digest-master
     
    nginx WebDav的配置: (http://wiki.nginx.org/HttpDavModule)
    修改/usr/local/nginx/conf/nginx.conf
     
    location / {
                root   html;
                index  index.html index.htm;
                dav_methods  PUT DELETE MKCOL COPY MOVE;

                create_full_put_path   on;
                dav_access                all:rw;
            }
     
    用curl测试上传:curl -T test.txt http://127.0.0.1/test.txt
     
     
    nginx digest认证的配置:
     
    创建密码文件:
    # htdigest2 -c /usr/local/nginx/conf/webdav.passwd WebDAV-Realm steve
    Adding password for steve in realm WebDAV-Realm.
    New password:
    Re-type new password: 
     
    修改/usr/local/nginx/conf/nginx.conf
    auth_digest_user_file /usr/local/nginx/conf/webdav.passwd;
            auth_digest_shm_size 4m;   # the storage space allocated for tracking active sessions

            location / {
                root   html;
                index  index.html index.htm;
                dav_methods  PUT DELETE MKCOL COPY MOVE;

                create_full_put_path   on;
                dav_access             all:rw;

                auth_digest 'WebDAV-Realm'; # realm name
                auth_digest_timeout 60s; # allow users to wait 1 minute between receiving the
                                         # challenge and hitting send in the browser dialog box
                auth_digest_expires 10s; # after a successful challenge/response, let the client
                                         # continue to use the same nonce for additional requests
                                         # for 10 seconds before generating a new challenge
                 auth_digest_replays 20; # also generate a new challenge if the client uses the
                                         # same nonce more than 20 times before the expire time limit
            }
     
    再用curl上传(没有用户名和密码)会失败
    # curl -T test.txt http://127.0.0.1/test.txt
  • 相关阅读:
    ELF BIN HEX[zz]
    电路、信号和PCB设计
    ADHelper中AD属性赋值的修正
    发布一个图片库轮显WebPart
    MOSS的ItemUpdated执行了10次,您碰到了吗?
    InfoPath 保存时自动生成文件名
    最新版WSS3.0 SDK
    自定义MOSS网站的masterpage
    自定义InfoPath数据验证有效性
    (暂时)解决InfoPath一直显示“installing”问题 续
  • 原文地址:https://www.cnblogs.com/huidaoli/p/3727054.html
Copyright © 2020-2023  润新知