The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Directory Structure Apache

Discussion in 'EasyApache' started by nibb, Sep 30, 2012.

  1. nibb

    nibb Well-Known Member

    Joined:
    Mar 22, 2008
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    We all know cPanel uses /home as vhosts directory for Apache. This is so popular this days that pretty much everyone else copied the setup.

    But I always had the impression this comes from Apache 1 era, and the reason why cPanel still maintains this is because of compability.

    Apache2 seems to use as default /var/www/html

    My question is, what are really the benefits on using /home/account instead?

    Is is more secure? Is is more flexible? Or its just a visual mock change to be easier to remember?

    This posts is more curiosity based on the technical working of Apache because I see vhosts work just fine in their default directory as well on a standard Apache server.
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The only benefit I can see being possible for /home/username over /var or /usr would be that /var contains the log files (/var/log), exim queue and database files (/var/spool/exim), user and root crons (/var/spool/cron), and MySQL data (/var/lib/mysql), while /usr contains the Apache directories (/usr/local/apache), mailman (/usr/local/cpanel/3rdparty/mailman), and cPanel (/usr/local/cpanel). Since nothing else writes to /home, having an entirely different partition for the cPanel account data and files for the website makes sense.

    You also have the option to set the directory for accounts actually. In WHM > Basic cPanel & WHM Setup, you decide which partition to use for user accounts:

    Pick whatever you prefer there.
     
  3. nibb

    nibb Well-Known Member

    Joined:
    Mar 22, 2008
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Thanks for the reply. No I don´t plan to change this. I was just curious as I imagined this is just for simplicity while doing backups, moving accounts, etc. This way you only keep user data in /home

    But lets not forget that Apache is also writing at least some data to it, like the access logs or errors logs.
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Apache is not writing any data to /home as the error log isn't contained for Apache in /home/username but in /usr/local/apache/log/error_log location. The PHP error log might write to /home for /home/username/public_html but PHP is different from Apache.

    As for the access logs, those write to /usr/local/apache/domlogs rather than /home/username and we symlink them in /home/username or create backups in /home/username/logs location.
     
Loading...

Share This Page