Chipster.org Posted July 25, 2023 Report Share Posted July 25, 2023 I have Uniform Server running quite well from a USB key. Starting it using the "UniController BOTH" syntax generates Windows Firewall alerts. (Which would be a pain in the fanny for our users who lack computer skills...) I've looked at using UniService, but it requires the user to select the services to install. Can all of this be done from a command line via a batch file? Alternatively, since I note that Windows Firewall alerts don't pop up on subsequent starts, I'm wondering about making the firewall rules in advance so users are not prompted. Is this possible? How are these rules set (or generated) in US? What parameters would I need to define to create rules from an elevated batch file? Thanks! -- Cliff Quote Link to comment Share on other sites More sharing options...
Twinky Posted March 5 Report Share Posted March 5 Can't comment on automating the firewall, I don't think windows allows this easily as you'd have all the trojans etc adding their own firewall rules.. However, apache, mysql and even filezilla can indeed be controlled as services (including installing and uninstalling) via a batch file. On the command line you need to CD into the apache / mysql folders and with apache; "apache -k install" BUT uniformserver often renames apache to httpd_z.exe for reasons unknown that they are unwilling to answer. It will still install if you use "httpd_z.exe -k install" but you will not be able to use the -k restart command - which instructs all oif the listening child threads to reload their configurations from the main configuration files (eg, if you create a new virtual host instead of restarting apache and causing downtime you can just run "apache -k restart" and all the threads will read the config files again - instantly enabling any new virtual hosts you've created while all other activities -user browsing or downloads - to continue without disturbance). Unfortunately though, apache is hardcoded internally to only work with it's official name when using the restart command - so if it's installed as Apache2.2 for example, the restart command will work. If it's installed as ApacheS1 (which is how uniformserver installs it as a service when the exe is called httpd_z.exe) then the restart command will not work - the service must be installed as Apache<version>. This indicates that apache is hard coded with the version number internally and will only work with that. With mysql, installation is all over the place. Some versions allow -install, others have to be one manually via the service controller on the command line - sc.exe Last night I was moving my two US installs from one server to another. The older one I had no problems getting mysql installed and running - it just does it. When I went to install MariaDB, I had hell. Nothing works, --defaults-file was ignored... the only thing that would work for installing it was "sc.exe MariaDB binPath=<path> MariaDB" - note the extra reference to MariaDB which shows in the windows service controller. For whatever reason, that works and somehow it knows where to find the right config file and use it (no idea how). FileZilla FTP server also has a slightly quirky install too - can't remember what but this is what I eventually managed to crack it with (in a batch file but you can run these commands one at a time on the command line): "filezilla server" /install auto sc start "filezilla server" Note that you do need auto on that first line - I couldn't get /install to work without it from memory (been a few years). In the days of Apache 1.3 I did come up with my own WAMP setup similar to uniformserver and I had everything scripted from batch files - it was beautiful - but then apache2 came out and I couldn't be bothered to go through it all again so switched to US. US is great but it does have quirks in its configuration and setup - as mentioned the renaming of apache.exe to httpd_z.exe for no apparent reason which breaks an apache fundamental of being able to reload configurations without downtime. Then there are variables all over the place that make no sense - eg AP_PORT - you won't find it defined anywhere and yet somehow everything knows how to use that variable. As much as I love US, I do think that they've bloated it a bit. A good clean install of apache, mysql and php would be great but you can't download apache from apache.org anymore. What I will say is that from my point of view, you are right to want to control it via the command line. It gives you more flexibility and control than the tray utility program (which to be fair is designed reasonable well feature wise but it is rooted into all the config files in such a way that it's a pain). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.