On 26/03/16 16:21, Chris Green wrote:
What's the neatest/easiest way to fire up the web server on demand? I don't really want to run it all the time. Ideally also I'd prefer not to run Apache as it's total overkill for what I'm doing. I tried PHP's built-in web server ("php -S localhost:80") and it works fine for me, the home LAN can't be accessed from outside so security should be OK.
I suppose the modern equivalent of inetd would do what I want but I'm a bit worried about how easy it might be (or not).
I'm sort of tempted to say why bother ? if there are no requests hitting it then the PHP isn't executed, so you have one thread of Apache (or whatever) sleeping. Unless you are running it on hardware from the previous century you really won't notice the difference between it running or not.
Plus if it's not hardened for security do you really want it to autostart on a request when you are using your laptop in an internet cafe ?
Either run it all the time or just have some scripts linked to menu/desktop buttons to quick launch or kill it I say.