cPanel domain parking and documentroot path in httpd.conf

kukimuki

Registered
Nov 9, 2011
3
0
51
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!
 

sirdopes

Well-Known Member
PartnerNOC
Sep 25, 2007
141
0
66
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.
 

kukimuki

Registered
Nov 9, 2011
3
0
51
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
 

sirdopes

Well-Known Member
PartnerNOC
Sep 25, 2007
141
0
66
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.
 

kukimuki

Registered
Nov 9, 2011
3
0
51
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?