如何使用 nginx+php-fpm 设置 SVN?

发布于 2024-12-10 15:56:44 字数 1369 浏览 1 评论 0原文

我有一个 Nginx 和 PHP-FPM 的工作安装,其默认索引目录是 /usr/share/nginx/html/

另外,我有一个 SVN 的工作安装,它的默认目录似乎是 /var/www/

我尝试更改 nginx.conf 中的默认路径以指向 /var/www/html 但它不起作用:

    #
# The default server
#
server {
    listen       80;
    server_name  _;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.php index.html index.htm;
    }

    error_page  404              /404.html;
    location = /404.html {
        root   /usr/share/nginx/html;
    }

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name; 
         ##** I tried to change the line above to /var/www/html/**
        include        fastcgi_params;

nginx.conf 中到底需要更改什么?或者也许我可以将 svn 默认目录更改为 /usr/share/nginx/html ?我怎样才能做这两件事?

I have a working installation of Nginx and PHP-FPM, which its default index directory is /usr/share/nginx/html/

Also, I have a working installation of SVN, it seems the default directory of this is /var/www/

I tried to change in nginx.conf the default path to point to /var/www/html but it didn't worked:

    #
# The default server
#
server {
    listen       80;
    server_name  _;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.php index.html index.htm;
    }

    error_page  404              /404.html;
    location = /404.html {
        root   /usr/share/nginx/html;
    }

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name; 
         ##** I tried to change the line above to /var/www/html/**
        include        fastcgi_params;

What exactly need to change in nginx.conf? or maybe I can change the svn default directory to /usr/share/nginx/html ? How can I do any of both things?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜柠檬 2024-12-17 15:56:44

如果您希望通过 nginx 提供 https 上的 svn commit 访问,我认为这是不可能的。我建议使用 nginx 反向代理 apache + mod_dav_svn 的服务器。如果您愿意,您可以将 apache 与 nginx 运行在同一台机器上。

If you wish to provide svn commit access over https through nginx, I don't believe that will be possible. What I would recommend is to have nginx reverse proxy a server with apache + mod_dav_svn. If you'd like, you could have apache live on the same machine as nginx.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文