This sounds like more the first case rather than the second case (so no need for C programming
)
All/any changes made in the web admin GUI can also be done in the command line by editing the configuration files.
First of all, apologies for the wall of text. I tried to lay out the steps needed to be done, but hopefully the steps are clear enough.
First, I suggest making a backup of all your configuration files (as this is scripting, we don't want to accidentally delete all your settings
)
Changes that need to be made:
** These first three steps should be do-able in ~4-5 lines of script. It's basically all 'mkdir' calls.
1. Create a vhost root. Normally, this is a subdirectory inside your lsws install
e.g.
2. Inside the vhost root, you may want to create an html sub directory and a logs subdirectory depending on your preferred settings.
3. Create a vhost conf directory. Normally, this is a subdirectory inside your conf directory
e.g.
Code:
lsws/conf/vhosts/Example/
for the Example virtual host
** The next three steps are for creating a virtual host.
4. Try creating your sample virtual host via web gui using the directories you just created
So, setting your vhost root to
vhost document root to
Code:
$SERVER_ROOT/Example/html
etc.
5. Check out the conf file that was created for your virtual host. You should be able to use this as a template file for your script.
6. Also check out the virtualHost entry for your newly created virtual host in
Code:
lsws/conf/httpd_config.conf
. This can be used as a template for your script to append to the file.
** The next three steps are for creating a listener and mapping it to the above virtual host.
7. In the gui, create a sample listener. After creating the listener and saving it, remember to add a vhost map to map the listener to the vhost created above.
8. Restart the server and make sure that the listener and vhost work.
9. Check out the listener entry for your newly created listener in
Code:
lsws/conf/httpd_config.conf
This can be used as a template for your script to append to the file.
At the end of the above steps, you should have:
- 1 new vhost root directory with a logs directory and a html directory and anything else that you may need.
- 1 new vhost conf directory.
- 1 new conf file in the above vhost conf directory.
- 2 new entries in your httpd_config.conf file.
As mentioned above, creating the directories is simply a few mkdir calls.
You can use the vhost conf file as a template to create a new conf file for each additional operator's virtual host.
You can also use the entries in the server conf file to append to the server conf file for your operators.
In the end, this should be do-able without too many lines of script, obviously depending on how complex you want to make it and how much error checking you want to do.
Hope this helps! Again, sorry for the wall of text, do let me know if you have any questions about this.