Results 1 to 9 of 9

Thread: Contao 4.4.18 and DocumentRoot

  1. #1
    New user
    Join Date
    05-12-18.
    Posts
    5

    Default Contao 4.4.18 and DocumentRoot

    Hi.
    I am running a server and want to install Contao 4.4.18
    The first problem I encountered when I wanted to use the manual: https://docs.contao.org/books/manual...ng-contao.html
    It says I just have to add install.php add the end of the URL. Seems like the manual is wrong and it should be /contao/install.

    Now the real problem arises when I have to set the DocumentRoot to the web-Directory of Contao.
    I am running multiple projects on my Apache2.4 Webserver, for example a DokuWiki and other stuff.
    So I have URLs like http://servername.com/DokuWiki or http://servername.com/SomethingElse
    I want Contao to be accessible from http://servername.com/Contao
    I therefore cannot set the DocumentRoot, or otherwise I can't host the DokuWiki etc...
    My DocumentRoot is /var/www/html/ and I prefer for it to stay that way.
    The only possible way I see is to use a Subdomain, which would allow for a VirtualHost in Apache configuration.

    Right now the installer says the Document-Root is unsafe (translated from what it says in german) and that I should make the web-Directory the DocumentRoot. Also it says Contao 4 no longer uses .htaccess-Files for access protection.

    Even if I use .htaccess-Files to protect the Contao Directory (that contains the web-Directory) it won't let me install (still the same page appears).

    Why this unnecessary restriction? Is my understanding correct, that I must change my DocumentRoot in order for Contao to work (resulting in not being able to serve any of my other projects)?

  2. #2
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    Quote Originally Posted by teremy View Post
    Seems like the manual is wrong and it should be /contao/install.
    That's right!

    Quote Originally Posted by teremy View Post
    Is my understanding correct, that I must change my DocumentRoot in order for Contao to work (resulting in not being able to serve any of my other projects)?
    Yes, you must change the DocumentRoot directive to point to the web/ subfolder of your Contao installation. The other projects are not affected if you set the DocumentRoot for a subdomain (or additional domain):
    Code:
    https://foo.example.com --> /var/www/html/contao-project/web/
    Contao Community Moderator
    → Support options

  3. #3
    New user
    Join Date
    05-12-18.
    Posts
    5

    Default

    Thanks for your reply.
    So http://some.url/contao is not possible?
    Then I have to look for another CMS, I don't like this design choice.

  4. #4
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    It is only possible on localhost, i.e. http://localhost/contao-project/

    The reason for this is that Contao is so independent of the web server, be it Apache or nginx (where no .htaccess files exist).
    Contao Community Moderator
    → Support options

  5. #5
    New user
    Join Date
    05-12-18.
    Posts
    5

    Default

    Quote Originally Posted by xchs View Post
    It is only possible on localhost, i.e. http://localhost/contao-project/

    The reason for this is that Contao is so independent of the web server, be it Apache or nginx (where no .htaccess files exist).
    Because certain files have to be protected? Then use .htaccess on apache and whatever nginx uses to protect directories/files.
    I still don't see why one would force users to set the DocumentRoot to the web-Directory.
    With other cms I have never encountered this.
    If independence is the reason, there are definitely hosters that won't even let you set the DocumentRoot. Very bad design choice in my opinion and the reason (despite an outdated manual) to not use contao.

  6. #6
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    Quote Originally Posted by teremy View Post
    there are definitely hosters that won't even let you set the DocumentRoot.
    Sorry, I'd consider THAT a bad design!

    Quote Originally Posted by teremy View Post
    Very bad design choice in my opinion
    Contao adheres to the concept and directory structure of Symfony, a popular high performance PHP framework.

    Quote Originally Posted by teremy View Post
    … and the reason (despite an outdated manual) to not use contao.
    You've already made your decision anyway. ¯\_(ツ)_/¯
    Contao Community Moderator
    → Support options

  7. #7
    New user
    Join Date
    05-12-18.
    Posts
    5

    Default

    For other people who want to install Contao in a subdirectory or for other reasons can't set the DocumentRoot or a VirtualHost, here is what I did:
    I commented out the throwing of the exception in the InsecureInstallationListener.php-file. https://github.com/contao/core-bundl...onListener.php

    I also added an .htaccess file to the contao root directory (the one that contains the web-directory) to deny access and edited the (already existing) .htaccess-file inside the web-directory to allow access.

    This way I was able to install Contao 4.4.18 without further problems. Hopefully this is still a viable way in terms of security. Symlinking might additionally help to keep everything except the web-directory outside the directories, that are served.

  8. #8
    New user
    Join Date
    05-25-18.
    Posts
    1

    Default

    So I spent two hours and it doesn't even work. I've tried multiple PAID hosters and gone through multiple tutorials as well. ALWAYS THE SAME RESULTS.

    I don't believe for a second I'm the only one with grey hair on this board. At least make the error messages more useful. This is just shit. I'm not talking about the CMS itself - it's awesome but the installer itself is a huge PITA.


    Here's the last tutorial I've followed https://lab.uberspace.de/en/guide_contao.html

    "There is no website root page which matches the requested language and/or domain name."


    [testnet@taylor testnet]$ pwd
    /var/www/virtual/testnet
    [testnet@taylor testnet]$ ls
    cms html
    [testnet@taylor html]$ tree
    .
    ├── app_dev.php
    ├── app.php
    ├── assets -> ../assets
    ├── bundles
    │** ├── contaocalendar -> ../../vendor/contao/calendar-bundle/src/Resources/public/
    │** ├── contaocomments -> ../../vendor/contao/comments-bundle/src/Resources/public/
    │** ├── contaocore -> ../../vendor/contao/core-bundle/src/Resources/public/
    │** ├── contaofaq -> ../../vendor/contao/faq-bundle/src/Resources/public/
    │** ├── contaonews -> ../../vendor/contao/news-bundle/src/Resources/public/
    │** └── contaonewsletter -> ../../vendor/contao/newsletter-bundle/src/Resources/public/
    ├── favicon.ico
    ├── share
    └── system
    └── themes -> ../../system/themes

    11 directories, 3 files
    Last edited by xchs; 05/25/2018 at 14:32.

  9. #9
    User Spooky's Avatar
    Join Date
    01-03-13.
    Posts
    339

    Default

    Quote Originally Posted by KREBS View Post
    "There is no website root page which matches the requested language and/or domain name."
    This error message is not related to the DocumentRoot configuration or the file and folder structure. It means your Contao installation is running correctly, but you either do not have a site structure within Contao at all or your site structure is misconfigured

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •