Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic Aurora Files

 AfterLogic Forum : AfterLogic Aurora Files
Subject Topic: Configure Webdav Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
ManicsMan
Newbie
Newbie


Joined: 19 January 2019
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 05 February 2019 at 11:58pm | IP Logged Quote ManicsMan

There is a section in the documentation that details the nginx configuration settings to allow for WebDav connection. It is very unclear where in the nginx.conf file to enter the settings. Please can we have a sample nginx.conf in the documentation so we know where to enter the documented settings. I have tried myself and still cannot enable WebDav.
Back to Top View ManicsMan's Profile Search for other posts by ManicsMan
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6037
Posted: 06 February 2019 at 2:15am | IP Logged Quote Igor

As a working example, we can provide a fragment of our nginx configuration file used for webmail.afterlogic.com. In webmail.afterlogic.com.conf file under etc/nginx/sites-enabled directory, there's a separate location which looks like this:

Code:
server {
    listen 8008;
    listen 80;
    listen 443;
    root html/webmail.afterlogic.com/system/dav;
    server_name dav.afterlogic.com;

    access_log /opt/afterlogic/var/log/nginx.dav.afterlogic.com.access.log;
    error_log /opt/afterlogic/var/log/nginx.dav.afterlogic.com.error.log;

    include "nginx.inc.ssl.conf";
    include "nginx.inc.dav.conf";
    include "nginx.inc.php.conf";

...


As you can see, there are several additional files included. The content of nginx.inc.dav.conf file is as follows:

Code:
index server.php;
charset utf-8;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /.svn/ { deny all; }
location ~ /.git/ { deny all; }

location = / {
    try_files @dav @dav;
}

location / {
    try_files $uri $uri/ @dav;
}

location @dav {
    include fastcgi_params;
    fastcgi_read_timeout   600s;
    fastcgi_pass 127.0.0.1:7777;
    fastcgi_index   server.php;
    fastcgi_param   SCRIPT_FILENAME $document_root/server.php;
}


Hope this helps.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
ManicsMan
Newbie
Newbie


Joined: 19 January 2019
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 06 February 2019 at 2:23am | IP Logged Quote ManicsMan

Thanks very much. I will give it a try.
Back to Top View ManicsMan's Profile Search for other posts by ManicsMan
 
ManicsMan
Newbie
Newbie


Joined: 19 January 2019
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 08 February 2019 at 12:46am | IP Logged Quote ManicsMan

Your sample nginx.conf looks nothing like the documentation which reads:

Configuration for nginx
For nginx webserver, add the following rule to your current location:

root aurora;
index dav.php;
if ( !-d $request_filename) {
    rewrite ^(.*) /dav.php last;
}
In the above configuration sample, aurora stands for Aurora Files installation location.

To make sure all the http methods required by DAV server are allowed, the following configuration is performed:

if ($request_method ~ ^(OPTIONS|GET|HEAD|DELETE|PROPFIND|PUT|PROPPATCH|COPY|MOVE|MKCOL|REPORT)$) {
    fastcgi_pass 127.0.0.1:1028;
}
It should point to existing PHP backend or another web server where PHP backend runs.

Typical host configuration would look like:

location / {
    include fastcgi_params;
    fastcgi_read_timeout 600s;
    fastcgi_pass unix:/opt/afterlogic/tmp/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root/dav.php;
    fastcgi_split_path_info ^(.+\.php)(/[^?]*).*$;
    fastcgi_param SCRIPT_NAME      $fastcgi_script_name;
    fastcgi_param PATH_INFO        $fastcgi_path_info;
}
However, if you choose to use a separate domain or subdomain for DAV access, configuration will be different:

location = / {
    try_files @dav @dav;
}
location / {
    try_files $uri $uri/ @dav;
}
location ~* \.php$ {
    return 404;
}
location @dav {
    include fastcgi_params;
    fastcgi_read_timeout   180s;
    fastcgi_pass    unix:/opt/afterlogic/tmp/php5-fpm.sock;
    fastcgi_index   dav.php;
    fastcgi_param   SCRIPT_FILENAME $document_root/dav.php;
}


Igor wrote:
As a working example, we can provide a fragment of our nginx configuration file used for webmail.afterlogic.com. In webmail.afterlogic.com.conf file under etc/nginx/sites-enabled directory, there's a separate location which looks like this:

Code:
server {
    listen 8008;
    listen 80;
    listen 443;
    root html/webmail.afterlogic.com/system/dav;
    server_name dav.afterlogic.com;

    access_log /opt/afterlogic/var/log/nginx.dav.afterlogic.com.access.log;
    error_log /opt/afterlogic/var/log/nginx.dav.afterlogic.com.error.log;

    include "nginx.inc.ssl.conf";
    include "nginx.inc.dav.conf";
    include "nginx.inc.php.conf";

...


As you can see, there are several additional files included. The content of nginx.inc.dav.conf file is as follows:

Code:
index server.php;
charset utf-8;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /.svn/ { deny all; }
location ~ /.git/ { deny all; }

location = / {
    try_files @dav @dav;
}

location / {
    try_files $uri $uri/ @dav;
}

location @dav {
    include fastcgi_params;
    fastcgi_read_timeout   600s;
    fastcgi_pass 127.0.0.1:7777;
    fastcgi_index   server.php;
    fastcgi_param   SCRIPT_FILENAME $document_root/server.php;
}


Hope this helps.

--
Regards,
Igor, AfterLogic Support
Back to Top View ManicsMan's Profile Search for other posts by ManicsMan
 
ManicsMan
Newbie
Newbie


Joined: 19 January 2019
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 08 February 2019 at 12:47am | IP Logged Quote ManicsMan

This is my nginx.conf after following the user documentation on webdav configuration but after using this setup, the Aurora Files website will not load.


#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid        logs/nginx.pid;


events {
    worker_connections 1024;
}


http {
    include       mime.types;
    default_type application/octet-stream;

    #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log logs/access.log main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout 0;
    keepalive_timeout 65;

    #gzip on;

    server {
        listen       80;
        server_name localhost;

        #charset koi8-r;

        #access_log logs/host.access.log main;

        location / {
            root   html;
index dav.php;
if ( !-d $request_filename) {
    rewrite ^(.*) /dav.php last;
}
if ($request_method ~ ^(OPTIONS|GET|HEAD|DELETE|PROPFIND|PUT|PROPPATCH|COPY|MOVE|MKCOL|REPORT)$) {
    fastcgi_pass 127.0.0.1:1028;
}
location / {
    include fastcgi_params;
    fastcgi_read_timeout 600s;
    fastcgi_pass unix:/opt/afterlogic/tmp/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root/dav.php;
    fastcgi_split_path_info ^(.+\.php)(/[^?]*).*$;
    fastcgi_param SCRIPT_NAME      $fastcgi_script_name;
    fastcgi_param PATH_INFO        $fastcgi_path_info;
}
        }

        #error_page 404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504 /50x.html;
        location = /50x.html {
            root   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 C:/nginx_php/nginx-1.14.2/html$fastcgi_script_name;
            include        fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name somename alias another.alias;

    #    location / {
    #        root   html;
    #        index index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout 5m;

    #    ssl_ciphers HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers on;

    #    location / {
    #        root   html;
    #        index index.html index.htm;
    #    }
    #}

}
Back to Top View ManicsMan's Profile Search for other posts by ManicsMan
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6037
Posted: 08 February 2019 at 1:24am | IP Logged Quote Igor

The main idea of the sample file is that we're not changing main nginx.conf. Instead, we're dealing with a virtual host specified under etc/nginx/sites-available/ directory. Dealing with those entries is described here and here.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
ManicsMan
Newbie
Newbie


Joined: 19 January 2019
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 08 February 2019 at 1:44am | IP Logged Quote ManicsMan

The major issue here is I followed the documentation given at https://afterlogic.com/docs/aurora-files/configuration/configuring-dav-server

It is unclear where to enter the various settings in the documentation so I entered everything that was documented in one place (the documentation doesn't mention otherwise). The resultant nginx.conf is as per the 4th post in this thread. I am using Windows as I have no knowledge of Linux, so I didn't even bother reading your links and besides, I am not interested in the multiple blocks referenced in the links. I just want to follow the documentation and as it stands, I cannot make any progress. I am actually a software developer and have used nginx in the past but I don't have enough knowledge of the various webdav settings to understand how to fix any mistakes I had made when following the document.

In my nginx.conf (as per post number 4), I have this:

location / {
            root   html;
index dav.php;
if ( !-d $request_filename) {
    rewrite ^(.*) /dav.php last;
}
if ($request_method ~ ^(OPTIONS|GET|HEAD|DELETE|PROPFIND|PUT|PROPPATCH|COPY|MOVE|MKCOL|REPORT)$) {
    fastcgi_pass 127.0.0.1:1028;
}
location / {
    include fastcgi_params;
    fastcgi_read_timeout 600s;
    fastcgi_pass unix:/opt/afterlogic/tmp/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root/dav.php;
    fastcgi_split_path_info ^(.+\.php)(/[^?]*).*$;
    fastcgi_param SCRIPT_NAME      $fastcgi_script_name;
    fastcgi_param PATH_INFO        $fastcgi_path_info;
}
        }

I don't understand it and therefore cannot make any further progress to enable WebDav.

Igor wrote:
The main idea of the sample file is that we're not changing main nginx.conf. Instead, we're dealing with a virtual host specified under etc/nginx/sites-available/ directory. Dealing with those entries is described here and here.

--
Regards,
Igor, AfterLogic Support
Back to Top View ManicsMan's Profile Search for other posts by ManicsMan
 
ManicsMan
Newbie
Newbie


Joined: 19 January 2019
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 15 February 2020 at 11:02pm | IP Logged Quote ManicsMan

Igor,


I am going to try this again. I understand you are including the DAV configuration as a separate file but I need to understand what the problem is. Why is the sample configuration file nginx.inc.dav.conf so different to the documentation?

I want to follow the documentation and it is assuming the reader is an expert on nginx configuration files. I am not an nginx expert and nor do I have much knowledge with regular expressions.

1. Where must the following code be entered in the nginx.conf file. I am told to add the following rule to your current location, but what is the current location with respect to the nginx.conf file?

root aurora;
index dav.php;
if ( !-d $request_filename) {
    rewrite ^(.*) /dav.php last;
}

2. I am told that the following configuration is performed. What does that mean? Do I enter it in ngix.conf or is there a process that executes it?

if ($request_method ~ ^(OPTIONS|GET|HEAD|DELETE|PROPFIND|PUT|PROPPATCH|COPY|MOVE|MKCOL|REPORT)$) {
    fastcgi_pass 127.0.0.1:1028;
}

3. I am told typical host configation looks like. What host configuration - the nginx.conf file or something else? Is this supposed to be a snippet of the entire file or does it represent an actual file that is referenced by nginx.conf

location / {
    include fastcgi_params;
    fastcgi_read_timeout 600s;
    fastcgi_pass unix:/opt/afterlogic/tmp/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root/dav.php;
    fastcgi_split_path_info ^(.+\.php)(/[^?]*).*$;
    fastcgi_param SCRIPT_NAME      $fastcgi_script_name;
    fastcgi_param PATH_INFO        $fastcgi_path_info;
}
Back to Top View ManicsMan's Profile Search for other posts by ManicsMan
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide