View Single Post
  #1   (View Single Post)  
Old 27th February 2018
toprank toprank is offline
Fdisk Soldier
 
Join Date: Feb 2018
Posts: 54
Default www/nextcloud and httpd.conf subdomain config

I'm overlooking something that has my httpd server serving nextcloud as the domain's root rather than the created cloud.domain.tld subdomain, and would like a fresh set of eyes to please point out my errors.

/etc/httpd.conf is very basic:

Code:
server "default" {
        listen on * port 80

        location "/.well-known/acme-challenge/*" {
                root "/htdocs/acme"
                root strip 2
        }
}

server "cloud.domain.tld" {
        listen on * tls port 443
        root "/nextcloud/"
        directory index index.php
        tls {
                key "/etc/ssl/private/domain.tld.key"
                certificate "/etc/ssl/domain.tld.fullchain.pem"
        }
        hsts

        # This defines the maximum request size in bytes
        connection max request body 5000000000

        location "/db_structure.xml" { block }
        location "/.ht*"             { block }
        location "/README"           { block }
        location "/data*"            { block }
        location "/config*"          { block }

        location "/*.php*" {
                fastcgi socket "/run/php-fpm.sock"
        }
}

And the httpd chroot:

Code:
# pwd
/var/www
# ls -al
total 60
drwxr-xr-x  15 root  daemon   512 Feb 27 13:18 .
drwxr-xr-x  24 root  wheel    512 Feb 27 01:53 ..
drwxr-xr-x   2 root  daemon   512 Oct  4 12:42 acme
drwxr-xr-x   2 root  daemon   512 Feb 27 12:28 bin
drwx-----T   2 www   daemon   512 Oct  4 12:42 cache
drwxr-xr-x   2 root  daemon   512 Feb 23 23:52 cgi-bin
drwxr-xr-x   3 root  daemon   512 Feb 27 12:28 conf
drwxr-xr-x   2 root  daemon   512 Feb 27 02:34 etc
drwxr-xr-x   5 root  daemon   512 Feb 27 12:25 htdocs
drwxr-xr-x   2 root  daemon   512 Feb 25 00:00 logs
drwxr-xr-x  15 root  daemon  1024 Feb 27 13:16 nextcloud
drwxr-xr-x   2 root  daemon   512 Feb 27 13:27 run
drwx-----T   2 www   www     2048 Feb 27 15:51 tmp
drwxr-xr-x   4 root  daemon   512 Feb 27 12:30 usr
drwxr-xr-x   3 root  daemon   512 Feb 27 02:26 var
# ls -al htdocs/                                                                                                                                                                            
total 28
drwxr-xr-x   4 root  daemon  512 Feb 27 16:06 .
drwxr-xr-x  15 root  daemon  512 Feb 27 13:18 ..
drwxr-xr-x   2 www   www     512 Feb 23 22:42 acme
drwxr-xr-x   2 root  wheel   512 Oct  4 17:12 bgplg
-rw-r--r--   1 www   www     923 Feb 24 01:15 index.html
-rw-r--r--   1 root  daemon  114 Feb 23 23:10 index.php
-rw-r--r--   1 root  daemon   69 Feb 27 02:18 info.php
The tail of httpd's /var/www/logs/access.log while accessing cloud.domain.tld shows no activity. Whereas the output when accessing domain.tld is active:

Code:
cloud.domain.tld 10.0.0.138 - - [27/Feb/2018:16:09:47 +1100] "GET / HTTP/1.1" 302 0
cloud.domain.tld 10.0.0.138 - - [27/Feb/2018:16:09:47 +1100] "GET /index.php/apps/files/ HTTP/1.1" 200 0
cloud.domain.tld 10.0.0.138 - - [27/Feb/2018:16:09:47 +1100] "GET /index.php/core/js/oc.js?v=fc042ba824ff4166163bc855df2375bd HTTP/1.1" 200 0
cloud.domain.tld 10.0.0.138 - - [27/Feb/2018:16:09:48 +1100] "GET /cron.php HTTP/1.1" 200 0
cloud.domain.tld 10.0.0.138 - - [27/Feb/2018:16:09:48 +1100] "GET /index.php/apps/gallery/config?extramediatypes=1 HTTP/1.1" 200 0
cloud.domain.tld 10.0.0.138 - - [27/Feb/2018:16:09:48 +1100] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 0
cloud.domain.tld 10.0.0.138 - - [27/Feb/2018:16:09:48 +1100] "PROPFIND /remote.php/webdav/ HTTP/1.1" 207 0
cloud.domain.tld 10.0.0.138 - - [27/Feb/2018:16:09:48 +1100] "GET /index.php/apps/systemtags/lastused HTTP/1.1" 200 0
cloud.domain.tld 10.0.0.138 - - [27/Feb/2018:16:09:48 +1100] "GET /index.php/apps/files/ajax/getstoragestats.php?dir=%252F HTTP/1.1" 200 0
There are no outputs to /var/www/logs/error.log when accessing either URL. Although there is a lone PHP error that is unrelated to this issue:

Code:
PHP message: PHP Fatal error:  session_start(): Failed to create session ID: files (path: ) in /nextcloud/lib/private/Session/Internal.php on line 174
Any help would be much appreciated. Please advise if further information is needed. Thanks!
Reply With Quote