[Solved] 403 on subdomain

Discussion in 'Installation/Configuration' started by niemand-glaumy, Apr 26, 2022.

  1. Sers!
    I am trying to install "pachno" (see https://pach.no) on Ubuntu 20.04 (just upgradet it from 18.04, still got a Postfix SSL issue to solve, might open thread on that later.) and latest ISPC. I use php7.4 and php8.0 als alternative, along with apache2.
    Sadly, I am running into an issue:
    Code:
    "ERROR 403 - Forbidden!
    The following error occurred:
    You are not permitted to access the requested URL.
    
    Please contact the webmaster with any queries."
    error.log gives me
    Code:
    [Mon Apr 25 21:32:16.258500 2022] [autoindex:error] [pid 160886] [client 62.91.124.58:64550] AH01276: Cannot serve directory /var/www/clients/client13/web60/web/pachno/: No matching DirectoryIndex(index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm,index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm,standard_index.html) found, and server-generated directory index forbidden by Options directive
    pach.no gives me an example for a vhost file (https://github.com/pachno/pachno/blob/master/docs/examples/apache.md), but subdomains are setup in the domain.vhost, right?
    Code:
    RewriteEngine on
                    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
                    RewriteRule ^ - [END]
                    RewriteCond %{HTTP_HOST} ^www\.example\.org$ [NC]
                                    RewriteRule ^(.*)$ http://example.org$1 [R=301,NE,L]
                    RewriteCond %{HTTP_HOST}   ^pachno\.example\.org$ [NC]
                                    RewriteCond %{REQUEST_URI} !^/webdav/
                    RewriteCond %{REQUEST_URI} !^/php-fcgi/
                    RewriteCond %{REQUEST_URI} !^/var/www/clients/client13/web60/web/pachno/
    
                    RewriteRule   ^/(.*)$ /var/www/clients/client13/web60/web/pachno/$1
    
                    RewriteCond %{HTTP_HOST}   ^forum\.example\.org$ [NC]
                                    RewriteCond %{REQUEST_URI} !^/webdav/
                    RewriteCond %{REQUEST_URI} !^/php-fcgi/
                    RewriteCond %{REQUEST_URI} !^/var/www/clients/client13/web60/web/forum/
    
                    RewriteRule   ^/(.*)$ /var/www/clients/client13/web60/web/forum/$1
    
            RewriteCond %{HTTPS} off
                    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
    There sadly wasn't a .htaccess included. Do you have any advise on how to add the correct settings to the vhost? :)
    Hope I didn't miss anything, I'm tired.
    Have a nice day!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please run the command:

    ls -la /var/www/clients/client13/web60/web/pachno/

    and post the result.
     
  3. Cheers for the quick reply, even if I wasn't able to react anymore.

    I chowned it all recursively to web60 and client13 when I uploaded it.
    Code:
    ls -la /var/www/clients/client13/web60/web/pachno/
    total 4696
    drwxr-xr-x  17 web60 client13    4096 Apr 25 21:31 .
    drwx--x--x   6 web60 client13    4096 Apr 22 16:36 ..
    drwxr-xr-x   4 web60 client13    4096 Apr 22 19:38 ansible
    drwxr-xr-x   2 web60 client13    4096 Apr 22 19:38 bin
    -rw-r--r--   1 web60 client13  203699 Dec 28 17:30 color_scheme_2.png
    -rw-r--r--   1 web60 client13  215845 Dec 28 17:30 color_scheme.png
    -rw-r--r--   1 web60 client13    2449 Dec 28 17:30 composer.json
    -rw-r--r--   1 web60 client13  204694 Apr 24 15:45 composer.lock
    -rw-r--r--   1 web60 client13 2697631 Apr 13 14:43 composer.phar
    -rw-r--r--   1 web60 client13   57721 Apr 22 20:11 composer-setup.php
    drwxr-xr-x  11 web60 client13    4096 Apr 22 19:42 core
    -rw-r--r--   1 web60 client13     765 Dec 28 17:30 DISCLAIMER.TXT
    drwxr-xr-x   2 web60 client13    4096 Apr 22 19:42 docker
    -rw-r--r--   1 web60 client13     679 Dec 28 17:30 docker-compose.yml
    -rw-r--r--   1 web60 client13    2142 Dec 28 17:30 Dockerfile
    -rw-r--r--   1 web60 client13      35 Dec 28 17:30 .dockerignore
    -rw-r--r--   1 web60 client13    1872 Dec 28 17:30 DOCKER.md
    drwxr-xr-x   3 web60 client13    4096 Apr 22 19:42 docs
    drwxr-xr-x   2 web60 client13    4096 Apr 25 21:31 error
    -rw-r--r--   1 web60 client13    9587 Dec 28 17:30 .eslintrc.js
    drwxr-xr-x   2 web60 client13    4096 Apr 22 19:42 files
    -rw-r--r--   1 web60 client13     277 Dec 28 17:30 .gitignore
    -rw-r--r--   1 web60 client13     649 Dec 28 17:30 Gruntfile.js
    drwxr-xr-x   7 web60 client13    4096 Apr 22 19:42 i18n
    -rw-r--r--   1 web60 client13    2127 Dec 28 17:30 INSTALL.md
    drwxr-xr-x   6 web60 client13    4096 Apr 22 19:42 js
    -rw-r--r--   1 web60 client13   16725 Dec 28 17:30 LICENSE
    -rw-r--r--   1 web60 client13     359 Dec 28 17:30 LICENSES
    -rw-r--r--   1 web60 client13     272 Dec 28 17:30 MIGRATION.md
    drwxr-xr-x   2 web60 client13    4096 Apr 22 19:42 modules
    drwxr-xr-x 817 web60 client13   32768 Apr 24 15:49 node_modules
    -rw-r--r--   1 web60 client13    1380 Apr 22 22:13 npm-debug.log
    -rw-r--r--   1 web60 client13    2496 Dec 28 17:30 package.json
    -rw-r--r--   1 web60 client13 1184324 Apr 24 15:49 package-lock.json
    -rw-r--r--   1 web60 client13     270 Dec 28 17:30 phpcs.xml
    -rw-r--r--   1 web60 client13    1034 Dec 28 17:30 phpstan-bootstrap.php
    -rw-r--r--   1 web60 client13     169 Dec 28 17:30 phpstan.neon
    -rw-r--r--   1 web60 client13     462 Dec 28 17:30 phpunit.xml
    -rw-r--r--   1 web60 client13      68 Dec 28 17:30 postcss.config.js
    drwxr-xr-x   7 web60 client13    4096 Apr 22 19:45 public
    -rw-r--r--   1 web60 client13    2032 Dec 28 17:30 README.md
    drwxr-xr-x   3 web60 client13    4096 Apr 22 19:45 tests
    drwxr-xr-x   3 web60 client13    4096 Apr 22 19:45 themes
    -rw-r--r--   1 web60 client13     173 Dec 28 17:30 .travis.yml
    -rw-r--r--   1 web60 client13     339 Dec 28 17:30 UPGRADE.md
    -rw-r--r--   1 web60 client13    2912 Dec 28 17:30 URL_REWRITE.md
    -rw-r--r--   1 web60 client13     942 Dec 28 17:30 Vagrantfile
    drwxr-xr-x  41 web60 client13    4096 Apr 24 15:45 vendor
    -rw-r--r--   1 web60 client13    3203 Dec 28 17:30 webpack.config.js
    
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no index.php file, that#s why you get that error. Most likely the index.php file is in the folder public, so you might have to adjust your rewrite rules to route the traffic to public folder instead.
     
    niemand-glaumy likes this.
  5. Thank you. Especially for the patience. Here I am, learning a php framework... and it was so obvious, right in front of my eyes.
     

Share This Page