FAQ: How to set up atomatic Linux reboot if kernel panic occurs?

Question: How can I get my Linux server rebooted/restarted automatically if it caught a kernel panic? Answer: As you might know, kernel panic is an action taken by an operating system upon detecting an internal fatal error from which it cannot safely recover; the term is largely specific to Unix and Unix-like systems (it’s a wiki’s description). By default Linux wouldn’t not reboot after panic occurs, but the following option […]

Read more →

 

FAQ: How to disable directory browsing in apache/httpd?

Question: How can I disable building of directory index in apache/httpd? In other words, how to prevent users from seeing the contents of published directories? Answer: Actually you are totally right that you wish to disable this feature. One of the “must do’s” on setting a secure apache web server is to disable directory browsing. Usually apache comes with this feature enabled but its always a good idea to get it […]

Read more →

 

FAQ: How to select fastest APT server in Debian

Question: I want to select APT repository server/mirror that is fastest for my location. How can I do it in Debian? Answer: You can use application named as “netselect-apt” to get new sources.list file with fastest APT mirror. Install this application by command “sudo aptitude install netselect-apt” and run it in accordance with Debian distribution you use (Debian Etch in our example): sudo netselect-apt -n etch -o /etc/apt/sources.list sudo apt-get […]

Read more →

 

FAQ: How to unload NIC driver (clear ifconfig counters)?

Question: I want to reset counters in /proc/net/dev (also shown in ifconfig output as RX and TX bytes) and thus I have to unload network interface driver. How to do it? Answer: There are two commands in Linux CLI coming by default which would help to unload drivers: rmmod and modprobe. First of all it is necessary to find what kernel module controls certain NIC and then unload that module. […]

Read more →

 

FAQ: Iptables rules on timely basis

Question: How can I restrict/allow access to certain service on timely basis with iptables? For example restrict access to SSH between 7:00 pm – 8:00 am on weekdays? Answer: You are welcome to use iptables patch-o-matic extension (pom or p-o-m) that allows you to match a packet based on its arrival or departure (for locally generated packets) timestamp. The syntax is the following: iptables RULE -m time –timestart TIME –timestop […]

Read more →