2014-09-25 2 views
0

웹 전체를 검색했는데 찾고있는 설정이 없습니다. 현재 VM을 테스트하고 있는데, 서버 설정을 원한다면, 설치할 3 가지 애플리케이션은 rtrent, owncloud 및 plex 용 rutorrent, web 인터페이스입니다. 이들 중 2 개는 nginx로 구성되어 있지만 어떻게 든 구성되어 있습니다. 작동하지 않습니다. 나는 2 개의 가상 서버 중 하나를 rutorrent라는 이름으로 만들었고, 다른 owncloud는 내 생각에 serverip/rutorrent와 serverip/owncloud를 사용하여 액세스했다. 나는 우분투 14.04에 있고 rutorrent와 owncloud 폴더는 /var/www, my PHP 버전은 5.5.9-1입니다.nutorx에서 rutorrent와 owncloud 설정하기

현재 유일한 문제는 rutorrent 설정이 작동하지만, owncloud가 활성화되어 있으면 자체 클라우드 만 작동하지 않는 것입니다. 자신의 설명서에서 주식 owncloud 설정으로 owncloud는 작동하지만 rutorrent는 file not found 페이지를 반환합니다.

여기가 enabled 디렉토리에 연결 한 /etc/nginx/sites-available에서 내 서버 파일은 다음과 같습니다

upstream php-handler { 
    #server 127.0.0.1:9000; 
    server unix:/var/run/php5-fpm.sock; 
} 

server { 
    listen 80; 
    server_name 192.168.61.128; 
    return 301 https://$server_name$request_uri; # enforce https 
} 

server { 
    listen 443; 
    server_name 192.168.61.128; 

    ssl on; 
    ssl_certificate /srv/ssl/nginx.crt; 
    ssl_certificate_key /srv/ssl/nginx.key; 

    # Path to the root of your installation 
    root /var/www; 

    client_max_body_size 10G; # set max upload size 
    fastcgi_buffers 64 4K; 

    index index.php; 
    error_page 403 /core/templates/403.php; 
    error_page 404 /core/templates/404.php; 

    location = /robots.txt { 
     allow all; 
     log_not_found off; 
     access_log off; 
    } 

    location /owncloud/ { 
     alias /var/www/owncloud/; 
     location ~ ^/owncloud/(?:\.htaccess|data|config|db_structure\.xml|README) { 
       deny all; 
     } 

     rewrite ^/owncloud/caldav(.*)$ /owncloud/remote.php/caldav$1 redirect; 
     rewrite ^/owncloud/carddav(.*)$ /owncloud/remote.php/carddav$1 redirect; 
     rewrite ^/owncloud/webdav(.*)$ /owncloud/remote.php/webdav$1 redirect; 

     rewrite ^/owncloud/.well-known/host-meta /owncloud/public.php?service=host-meta last; 
     rewrite ^/owncloud/.well-known/host-meta.json /owncloud/public.php?service=host-meta-json last; 

     rewrite ^/owncloud/.well-known/carddav /owncloud/remote.php/carddav/ redirect; 
     rewrite ^/owncloud/.well-known/caldav /owncloud/remote.php/caldav/ redirect; 

     rewrite ^/owncloud/apps/([^/]*)/(.*\.(css|php))$ /owncloud/index.php?app=$1&getfile=$2 last; 
     rewrite ^(/owncloud/core/doc/[^\/]+/)$ $1/index.html; 

     try_files $uri $uri/ index.php; 

     location ~ ^/owncloud/(.+?\.php)(?:$|/) { 
      fastcgi_split_path_info ^(.+\.php)(/.+)$; 
      set $path_info $fastcgi_path_info; 
      try_files $fastcgi_script_name =404; 
      include fastcgi_params; 
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
      #fastcgi_param PATH_INFO $fastcgi_path_info; 
      fastcgi_param PATH_INFO $path_info; 
      fastcgi_param HTTPS on; 
      fastcgi_param SCRIPT_NAME /owncloud/Â$fastcgi_script_name; 
      fastcgi_pass php-handler; 
     } 
} 

    # Optional: set long EXPIRES header on static assets 
    location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { 
      expires 30d; 
      # Optional: Don't log access to assets 
      access_log off; 
    } 
} 

그것은 공식 owncloud 구성에 가능한 한 가까이하지만 페이지를로드 할 때 404 오류가 발생합니다. 다음과 같이 rutorrent 설정 내가 작동 SSL을 건드리지 않고 정상적인 일에 물건을 변경하려하기 때문에 정상 및 SSL 설정을 모두 가지고있다 : 마지막으로

server { 
    listen 80; 
    server_name 192.168.61.128; 

    root /var/www; 
    index index.php index.html index.htm; 

    #location/{ 
    # try_files $uri $uri/ =404; 
    #} 

    location /rutorrent { 
     auth_basic "rutorrent"; 
     auth_basic_user_file /var/www/rutorrent/.htpasswd; 
    } 

    location /RPC2 { 
     include scgi_params; 
     scgi_pass localhost:5000; 
    } 

    location ~ \.php$ { 
     fastcgi_split_path_info ^(.+\.php)(.*)$; 
     fastcgi_pass unix:/var/run/php5-fpm.sock; 
     fastcgi_index index.php; 
     include fastcgi.conf; 
     #fastcgi_intercept_errors  on; 
     #fastcgi_ignore_client_abort  off; 
     #fastcgi_connect_timeout 60; 
     #fastcgi_send_timeout 180; 
     #fastcgi_read_timeout 180; 
     #fastcgi_buffer_size 128k; 
     #fastcgi_buffers 4 256k; 
     #fastcgi_busy_buffers_size 256k; 
     #fastcgi_temp_file_write_size 256k; 
    } 

    location ~ /\.ht { 
     deny all; 
    } 
} 

server { 
    listen 443; 
    server_name 192.168.61.128; 

    root /var/www; 
    index index.php index.html index.htm; 

    ssl on; 
    ssl_certificate  /srv/ssl/nginx.crt; #server.crt 
    ssl_certificate_key /srv/ssl/nginx.key; #server.key 

    ssl_session_timeout 5m; 

    ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; 
    ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; 
    ssl_prefer_server_ciphers on; 

    location/{ 
     #try_files $uri $uri/ =404; 
    } 

    location /rutorrent { 
     auth_basic "rutorrent"; 
     auth_basic_user_file /var/www/rutorrent/.htpasswd; 
    } 

    location ~ \.php$ { 
     fastcgi_split_path_info ^(.+\.php)(.*)$; 
     fastcgi_pass unix:/var/run/php5-fpm.sock; 
     fastcgi_index index.php; 
     include fastcgi.conf; 
     #fastcgi_intercept_errors on; 
     #fastcgi_ignore_client_abort off; 
     #fastcgi_connect_timeout 60; 
     #fastcgi_send_timeout 180; 
     #fastcgi_read_timeout 180; 
     #fastcgi_buffer_size 128k; 
     #fastcgi_buffers 4 256k; 
     #fastcgi_busy_buffers_size 256k; 
     #fastcgi_temp_file_write_size 256k; 
    } 

    location /RPC2 { 
     include scgi_params; 
     scgi_pass localhost:5000; 
    } 

    location ~ /\.ht { 
     deny all; 
    } 
} 

그리고 내 다시 같은 표준만큼 가까운 nginx.conf 가능한.

user www-data; 
    worker_processes 4; 
    pid /run/nginx.pid; 

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 /etc/nginx/mime.types; 
    default_type application/octet-stream; 

    ## 
    # Logging Settings 
    ## 

    access_log /var/log/nginx/access.log; 
    error_log /var/log/nginx/error.log info; 

    ## 
    # 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; 

    ## 
    # nginx-naxsi config 
    ## 
    # Uncomment it if you installed nginx-naxsi 
    ## 

    #include /etc/nginx/naxsi_core.rules; 

    ## 
    # nginx-passenger config 
    ## 
    # Uncomment it if you installed nginx-passenger 
    ## 

    #passenger_root /usr; 
    #passenger_ruby /usr/bin/ruby; 

    ## 
    # Virtual Host Configs 
    ## 

    include /etc/nginx/conf.d/*.conf; 
    include /etc/nginx/sites-enabled/*; 
} 

저는이 물건에별로 좋지 않지만 직관적으로는 그렇게 열심히해서는 안됩니다. 도와 주셔서 감사합니다.

답변

0

개선 될 수있는이 구성에는 많은 것이 있지만 기본 문제는 동일한 server_name을 가진 두 개의 서버 블록을 정의하는 것입니다. 그게 당신이 기대하는 것인데 병합되지는 않지만, 다른 하나는 뽑혔습니다.

1

당신은 완전히 똑같습니다. 동일한 가상 호스트에 두 위치를 배치하는 구성을 수정했습니다. 이것은 작동 결과이며, 다시 주로 OwnCloud 설명서에서 수정되었습니다.

upstream php-handler { 
    #server 127.0.0.1:9000; 
    server unix:/var/run/php5-fpm.sock; 
} 

server { 
    listen 80; 
    server_name 192.168.61.128; 
    return 301 https://$server_name$request_uri; # enforce https 
} 

server { 
    listen 443; 
    server_name 192.168.61.128; 

    root /var/www; 
    index index.php index.html index.htm; 

    ssl on; 
    ssl_certificate  /srv/ssl/nginx.crt; #server.crt 
    ssl_certificate_key /srv/ssl/nginx.key; #server.key 

    rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; 
    rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; 
    rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; 

    client_max_body_size 10G; # set max upload size 
    fastcgi_buffers 64 4K; 

    location = /robots.txt { 
     allow all; 
     log_not_found off; 
     access_log off; 
    } 

    location/{ 
     rewrite ^/.well-known/host-meta /public.php?service=host-meta last; 
     rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; 

     rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; 
     rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; 

     rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; 

     try_files $uri $uri/ index.php;   
    } 

    location ~ ^/(data|config|\.ht|db_structure\.xml|README) { 
     deny all; 
    } 

    location ~ \.php(?:$|/) { 
     fastcgi_split_path_info ^(.+\.php)(.*)$; 
     include fastcgi_params; 
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
     fastcgi_param PATH_INFO $fastcgi_path_info; 
     fastcgi_param HTTPS on;; 
     fastcgi_pass php-handler; 
    } 

    location /rutorrent { 
     auth_basic "rutorrent"; 
     auth_basic_user_file /var/www/rutorrent/.htpasswd; 
    } 

    location /RPC2 { 
     include scgi_params; 
     scgi_pass unix:/home/rtorrent/.sockets/scgi.socket; 
    } 

    location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { 
     expires 30d; 
     access_log off; 
    } 
}