Document Root - Where should I place my domain's files?

Discussion in 'General' started by mezelf, Jun 14, 2016.

  1. mezelf

    mezelf New Member

    Hello,
    I am new to ISPConfig3. I have installed ISPConfig3 version 3.0.5.4p9 on Debian 8. I have Apache 2.4.10 running.
    My steps have been:
    1- I have added mysite (hierafter `mysite1DOTcom` - I can't write it properly because forum message says I can't include links in my post) via the ISPConfig3 'Sites' tab.
    2- I have checked /etc/apache2/sites-enabled/100-mysite1DOTcom.vhost and saw that DocumentRoot is: /var/www/mysite1DOTcom/web (as opposed to my expectation of /var/www/html). Hence I have placed my site code directory below the DocumentRoot. Hence it now looks like:
    /var/www/mysite1DOTcom/web/mysite1DOTcom
    I have deleted other files and directories under /var/www/mysite1DOTcom/web.
    I made sure that mysite1DOTcom under /var/www/mysite1DOTcom/ web/ and everything under that have the owner and group of www-data and checked that indeed this is what Apache has in its environment variables file.
    3- But when I type mysite1DOTcom or wwwDOTmysite1DOTcom on the browser, I am getting:
    Error 403 Forbidden
    You don't have permission to access / on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/2.4.10 (Debian) Server at wwwDOTmysite1DOTcom Port 80

    Obviously, I made a mistake somewhere... I appreciate your help please!
    Best!
     
    Last edited: Jun 14, 2016
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Just copy the files into the "web" folder of your website. And files of a website are owned by the user and group of this website, this is never www-data. Never chown them to www-data as this will result ina forbidden error.

    Creating a website and uploading files is totally easy, jsut dont mess around manually!.

    1) Login to ispconfig and create the site.
    2) create a fpt user for this site.
    3) Connect with this FTP user, you will see a folder called "web", upload all html and php files into that folder. All files have the correct owners automatically, do not manually alter any ownerships!
     
    mezelf likes this.
  3. mezelf

    mezelf New Member

    Thank you for your reply!
    Does it mean that,
    instead of placing the code files (index.html etc) under :
    /var/www/mysite1DOTcom/web/mysite1DOTcom
    I should be placing them directly under /web?
    /var/www/mysite1DOTcom/web/

    Best
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, putting them in a subfolder makes no sense and apache will not find them there off course. And do not set the user to www-data. All files in the web folder are owned by the webID user and clientID group of this website and each website has its own user and each client its own group to separate websites for security reasons.
     
    mezelf likes this.
  5. mezelf

    mezelf New Member

    It worked.
    THANK YOU till!
     

Share This Page