Adding vhosts by creating a file?

#1
I could swear I read somewhere that with the 4.0 release you could add vhosts to templates by creating a file on the filesystem - but I can't find it again or any other details about it.

Have I lost my mind, or has this been implemented? I've been writing my own control panel for my non profit - and have left the addon domain till last in the hopes that I'd be ready to upgrade to 4.0 about the time I started work on it.

If this has been implemented can you provide me a link to some additional documentation? Will a reload be required to activate the new vhosts? If so, is there any way to reload that by an unprivledged user?
 

raphidae

Well-Known Member
#3
Perhaps my solution on adding vhosts using xsh is of use: http://obhasa.mediamonks.net/newhost.sh.txt

It could easily be adapted to write a seperate config file for each vhost instead of adding vhosts to a template.

As to your reloading question: lsws needs to be reloaded, I believe this does not interrupt service. You can use sudo to let unprivileged user 'user' reload lsws by adding to sudoers:

Cmnd_Alias LSWS = /opt/lsws/bin/lswsctrl restart
user ALL = (root) NOPASSWD: LSWS
Or you could cron a script that checks for the existence of a file (i.e. 'request_lsws_restart') in users home directories and restarts lsws and deletes the file if present (make sure it is a file! otherwise an user could make it a symlink to /etc/passwd :)).
 
Last edited:
Top