Web server in one line of bash
31–40 of 69 posts
Re: Web server in one line of bash
#32Re: Web server in one line of bash
#33while true; sudo /usr/sbin/apachectl start; break; done;
Re: Web server in one line of bash
#34Re: Web server in one line of bash
#35You can actually write a web server in pure bash, with no netcat, using /dev/tcp (bash magic). https://www.gnu.org/software/bash/manual/html_node/Redirecti... http://www.linuxjournal.com/content/more-using-bashs-built-d...
Re: Web server in one line of bash
#36$ busybox httpd Works even in an initramfs, and in some embedded systems. Serves up the current directory, and you can even have CGI scripts in cgi-bin.
Thanks! I'd forgotten about busybox, but that's often how your home router is doing things. * Side note: if it is, make sure your router manufacturer provides the GPL source release.
Re: Web server in one line of bash
#37Re: Web server in one line of bash
#38Re: Web server in one line of bash
#39That's not a one-line script. That's a multi-line script with the linebreaks removed.
Re: Web server in one line of bash
#40netcat is the most handy service I have seen on Linux. Any more like this?