|
Guides All Guides and HOWTO's. |
|
Thread Tools | Display Modes |
|
|||
Automating the "vi /etc/httpd.conf", httpd -n, rcctl restart httpd" treadmill
According to Larry Wall, one of the virtues of a programmer is lazyness.
I think this also applies to a website administrator. So to avoid repetitive typing while editing, checking httpd.conf(5) and restarting the webserver I wrote the following simple script: Code:
#!/bin/sh DAEMON=httpd while true ; do vi "/etc/${DAEMON}.conf" ${DAEMON} -n && rcctl restart ${DAEMON} printf "Press <CNTRL-C to stop, any other key to re-edit /etc/${DAEMON}.conf : " ; read A done Code:
root@nedrag[~]./ehttpd.sh /etc/httpd.conf:33: syntax error /etc/httpd.conf:37: syntax error Press <CNTRL-C to stop, any other key to re-edit /etc/httpd.conf : configuration OK httpd(ok) httpd(ok) Press <CNTRL-C to stop, any other key to re-edit /etc/httpd.conf : ^C root@nedrag[~] The script could be extended or generalized to edit other configuration files, but you already guessed it: I am too lazy for that
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump Last edited by J65nko; 21st May 2021 at 05:19 AM. |
Tags |
httpd.conf |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to remove ".php" from urls in httpd? | billy_bazooka | OpenBSD Packages and Ports | 3 | 23rd January 2021 10:08 AM |
Difference between"arp info overwritten" and " duplicate IP address " | varag | OpenBSD Security | 1 | 6th April 2015 02:57 PM |
Where should I put my config? "rc.conf" or "rc.conf.local"? | fender0107401 | OpenBSD General | 2 | 2nd April 2012 02:53 AM |
Fixed "xinit" after _7 _8, "how" here in case anyones' "X" breaks... using "nvidia" | jb_daefo | Guides | 0 | 5th October 2009 09:31 PM |
can't start apache "httpd not running" | disappearedng | FreeBSD General | 5 | 22nd September 2008 10:18 PM |