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.

cPanel domain parking and documentroot path in httpd.conf

Discussion in 'cPanel Developers' started by kukimuki, Nov 9, 2011.

  1. kukimuki

    kukimuki Registered

    Joined:
    Nov 9, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello!

    Before the last few cPanel updates domain parking function did not change an accounts documentRoot folder to default in the httpd.conf

    My question is if there is a workaround to prevent the domain parking function to overwrite/modify the documentRoot variable?

    If not then is there a way to change the Pre VirtualHost via API?
    Or is there a way to run a script server side after the park domain function is run (similar to postwwwacct for example)?

    Appreciate the help!
     
  2. sirdopes

    sirdopes Well-Known Member
    PartnerNOC

    Joined:
    Sep 25, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    I don't think I understand what you are wanting to change. When you park a domain on another domain, it should not change the document root to something else. You can use the custom event handler to do something after a domain is parked. I can provide an example just not sure what you are wanting to do.
     
  3. kukimuki

    kukimuki Registered

    Joined:
    Nov 9, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi!


    Thank you for your reply.


    Yes I know that it should not change anything but in fact after an update (somewhere in the near past) it started to change it.


    For example if in the httpd.conf file I have changed the documentroot variable from /home/user/public_html to /home/user2/user/ it will change it back to /home/user/public_html


    So to make it clear – before the update it worked like this:
    - The httpd file had in it DocumentRoot /home/user2/user
    - Park a domain on top of it
    - The httpd file still had DocumentRoot /home/user2/user in it


    Now:
    - The httpd file had in it DocumentRoot /home/user2/user
    - Park a domain on top of it
    - The httpd file has DocumentRoot /home/user/public_html in it
     
  4. sirdopes

    sirdopes Well-Known Member
    PartnerNOC

    Joined:
    Sep 25, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    The httpd.conf will get overwritten. If you are wanting to specify a different document root for a domain, it needs to be changed in the userdata file. It is located at /var/cpanel/userdata/<user>/<domain>. Cpanel uses this file to rebuild the httpd.conf. This file needs to be updated with the document root that you want to use.
     
  5. kukimuki

    kukimuki Registered

    Joined:
    Nov 9, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Yes, well my original question was what was done to change this. We have been using custom built script to overwrite the documentroot for years.


    And if this is now the way it should be then is there a way to edit the Pre VirtualHost via API?
     
  6. morissette

    morissette Well-Known Member

    Joined:
    May 24, 2009
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Austin, TX
    cPanel Access Level:
    Root Administrator
    There is no API function for that feature, you will have to open the userdata file and edit it with your script
     
  7. morissette

    morissette Well-Known Member

    Joined:
    May 24, 2009
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Austin, TX
    cPanel Access Level:
    Root Administrator
    <<< freelance programmer - PM for quotes :)
     
Loading...

Share This Page