• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

conf, skel, and subdomains

A

ArchStanton

Guest
How to create a vhost.conf file in the skel directory for subdomains?

I'm creating a bunch of subdomains that I would like to be able to include php files from the parent domain. Of course open_basedir restriction is a problem. I am going to try using the skeletons to add a conf directory with a vhost.conf file to overcome this problem. Will the skel files work with the subdomains?

Does the @domain_name@ refer to the parent domain, or the subdomain? How would I create a conf file that would accomplish the following:

Code:
<Directory  /home/httpd/vhosts/domain.com/subdomains/sub_name/httpdocs>

        php_admin_value open_basedir "/home/httpd/vhosts/domain.com/httpdocs:/home/httpd/vhosts/domain.com/subdomains/sub_name/httpdocs:/tmp"

</Directory>

The following obviously would not work, but does anyone know something similar to this that would?

Code:
<Directory  /home/httpd/vhosts/@domain_name@/subdomains/@sub_domain_name@/httpdocs>

        php_admin_value open_basedir "/home/httpd/vhosts/@domain_name@/httpdocs:/home/httpd/vhosts/@domain_name@/subdomains/@sub_domain_name@/httpdocs:/tmp"

</Directory>
 
Another thought. Somewhere is the template or script used to create the httpd.include files for each domain. Is there any way to edit these?
 
Does anyone even have a clue if I'm on the right track?
 
Did you find and answer to this question yet? I am interested in exactly how I can use the skel directory. I thought I read somewhere that the conf directory would be removed automatically for security reasons but someone would have to confirm this for this to be a legitimate comment ;)
 
Originally posted by Charles Coleman
Did you find and answer to this question yet? I am interested in exactly how I can use the skel directory. I thought I read somewhere that the conf directory would be removed automatically for security reasons but someone would have to confirm this for this to be a legitimate comment ;)

Never got an answer from anyone on this. I eventually gave up.

My solution, which may or may not help anyone, much like this forum, was this: instead of trying to include the files from another directory, I used PHP's FTP functions to transfer the files from the server to itself. The owners of the site can run the script whenever they create a new sub-domain. I also have the script create symbolit links to files that don't need to be executed, like images and css.

If you think this might be helpful to you, I can dig up some example code.
 
Hey, check out this thread thread... I'm sure you already know about this but you may not have thought of doing it quite this way.
 
Back
Top