美文网首页
trac 安装笔记

trac 安装笔记

作者: 9682f4e55d71 | 来源:发表于2018-03-27 09:54 被阅读26次
    # easy_install trac
    mkdir /data/trac && cd /data/trac
    trac-admin example.com initenv
    
    Project environment for 'TEST Mobile' created.
    
    You may now configure the environment by editing the file:
    
      /data/trac/example.com/conf/trac.ini
    
    If you\'d like to take this new project environment for a test drive,
    try running the Trac standalone web server `tracd`:
    
      tracd --port 8000 /data/trac/example.com
    
    Then point your browser to http://localhost:8000/example.com.
    There you can also browse the documentation for your installed
    version of Trac, including information on further setup (such as
    deploying Trac to a real web server).
    
    The latest documentation can also always be found on the project
    website:
    
      http://trac.edgewall.org/
    
    Congratulations!
    
    /data/trac/example.com/conf/trac.ini
    tracd --port 8000 /data/trac/example.com
    http://trac.edgewall.org/
    

    nginx config

    [root@mypc-dev-04 conf.d]# cat trac.conf

    upstream trac_server{
        ip_hash;
        server 127.0.0.1:8000 fail_timeout=0 weight=99;
    #server 127.0.0.1:3003 fail_timeout=0 weight=1;
    }
    
    server
    {
        listen 80;
        listen [::]:80;
        server_name trac.mypc.com;
        return 301 https://$server_name$request_uri;
    }
    
    server
    {
        listen 443 ssl;
        server_name trac.mypc.com;
    
        ssl on;
        ssl_certificate     /etc/nginx/ssl/mypc.com.crt;
        ssl_certificate_key /etc/nginx/ssl/mypc.com.key;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    
    
        location ~ ^/(public/|robots.txt){
            root /data/trac/example.com;
            expires max;
        }
    
        location / {
            proxy_pass http://trac_server;
            proxy_redirect off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_connect_timeout 150;
            proxy_send_timeout    100;
            proxy_read_timeout    100;
            proxy_buffers         4 32k;
    
            client_max_body_size 8m;
            client_body_buffer_size 128k;
        }
    
        error_log /var/log/trac/trac_nginx_error.log;
        access_log /var/log/trac/trac_nginx_access.log;
    }
    

    密码验证

    htpasswd -c /data/trac/example.com/passwd_mobi admin
    tracd --port 8000 --basic-auth="example.com,/data/trac/example.com/passwd_mobi,mobile test env" /data/trac/example.com
    

    端口号自己定义,并且加上参数basic-auth指定加密文件启动

    添加权限

    [root@mypc-dev-04 conf.d]# trac-admin /data/trac/example.com/ permission add admin TRAC_ADMIN
    

    插件

    trac.ini

    [components]
    autocompleteusers.autocompleteusers.autocompleteusers = enabled
    

    https://www.tianmingxing.com/archives/203
    https://trac-hacks.org/wiki/NoteBoxMacro

    相关文章

      网友评论

          本文标题:trac 安装笔记

          本文链接:https://www.haomeiwen.com/subject/rndjcftx.html