If you create a subdomain name, a folder with that subdomains name is created. So this option is already present.the ability to create a new folder for the subdomain or point to an existing folder.
I wonder if it's needed:
If you create a subdomain name, a folder with that subdomains name is created. So this option is already present.
If dmacleo (and you) ment something else, I think you have to clarify what you exactly mean.
I have asked before and people seem to not care but if average user wants to create a subdomain and point to an existing folder for whatever reason he wants the server admin should not have to get involved and add to the custom httpd.conf.
people here may not like cpanel but at least there an average user can do this (its needed for cdn usage) on their own. during the creation of the subdomain the choice of folder is shown (defaults to sub name) and user can either leave as is or point to existing.
and the present method to do this, to be blunt, sucks.
not trying to ruffle any feathers but come on, why should a server admin need to be involved for this?
+1 to this. We would like subdomains to be placed in a directory on this path: /home/USERNAME/subdomains or on this path: /home/USERNAME/domains/subdomains
But we also need a way to automatically convert all existing subdomains to the new path.
We do not like to have subdomains placed inside public_html directory for it's top level domain. That only causes trouble for .htaccess files, and confusion for customers.
cd /usr/local/directadmin/data/templates
mkdir -p custom
cp -p virtual_host2*sub.conf custom/
cd custom
perl -pi -e 's#`HOME`/domains/`DOMAIN`/private_html#`HOME`/domains/`DOMAIN`/subdomains/`SUB`/private_html#' virtual_host2_secure_sub.conf
perl -pi -e 's#`HOME`/domains/`DOMAIN`/public_html/`SUB`/cgi-bin/#`HOME`/domains/`DOMAIN`/subdomains/`SUB`/public_html/cgi-bin/#' virtual_host2_secure_sub.conf
perl -pi -e 's#\|DOCROOT\|/\|SUB\|#\|DOCROOT\|#' virtual_host2_secure_sub.conf
perl -pi -e 's#`HOME`/domains/`DOMAIN`/public_html#`HOME`/domains/`DOMAIN`/subdomains/`SUB`/public_html#' virtual_host2_sub.conf
perl -pi -e 's#`DOCROOT`/`SUB`/cgi-bin/#`DOCROOT`/cgi-bin/#' virtual_host2_sub.conf
perl -pi -e 's#\|DOCROOT\|/\|SUB\|#\|DOCROOT\|#' virtual_host2_sub.conf
#!/bin/sh
mkdir -p /home/$username/domains/$domain/subdomains/$subdomain
chown $username:$username /home/$username/domains/$domain/subdomains
chown $username:$username /home/$username/domains/$domain/subdomains/$subdomain
mv -f /home/$username/domains/$domain/public_html/$subdomain /home/$username/domains/$domain/subdomains/$subdomain/public_html
mv -f /home/$username/domains/$domain/private_html/$subdomain /home/$username/domains/$domain/subdomains/$subdomain/private_html
exit 0;
#!/bin/sh
USERSDIR=/usr/local/directadmin/data/users
for USER in `ls ${USERSDIR}`; do
{
for DOMAIN in `cat ${USERSDIR}/${USER}/domains.list`; do
{
for SUB in `cat ${USERSDIR}/${USER}/domains/${DOMAIN}.subdomains`; do
{
NEWDIR=/home/${USER}/domains/${DOMAIN}/subdomains/${SUB}
OLDDIR_PUBLIC=/home/${USER}/domains/${DOMAIN}/public_html/${SUB}
OLDDIR_PRIVATE=/home/${USER}/domains/${DOMAIN}/public_html/${SUB}
mkdir -p ${NEWDIR}
chown ${USER}:${USER} /home/${USER}/domains/${DOMAIN}/subdomains
chown ${USER}:${USER} ${NEWDIR}
if [ -d ${OLDDIR_PUBLIC} ]; then
echo "Moving ${OLDDIR_PUBLIC} to ${NEWDIR}/public_html..."
mv -f ${OLDDIR_PUBLIC} ${NEWDIR}/public_html/
fi
if [ -d ${OLDDIR_PRIVATE} ]; then
echo "Moving ${OLDDIR_PRIVATE} to ${NEWDIR}/private_html..."
mv -f ${OLDDIR_PUBLIC} ${NEWDIR}/private_html/
fi
}
done;
}
done;
}
done;
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d
#!/bin/sh
rm -rf /home/$username/domains/$domain/subdomains/$subdomain
exit 0;