Just more ramblings of another IT Guy

Category Archives: Handy Linux Commands

n00b linux commands

Commands to edit iptables

  To view the current rules and also view the rule ID use the following: iptables -L -n –line-numbers                      or iptables -nL -v –line-numbers   To delete a rule use: iptables -D INPUT X  (where x is the ID … Continue reading

Force complete website to HTTPS

` The below can be added to the httpd.conf file for best performance as the whole site is being redirected to https (can also be added to a .htaccess file). The result is that when a client connects to the … Continue reading

Copy file permissions from one file to another!!!

As the subject says the following can be used to copy the permission settings from one file to another   chmod –reference <reference-file> <target-file>   Example: chmod –reference <tobecopied.txt> <destination.txt>

Output Apache access_log via syslog

While I have not had the opportunity to test this yet Terry Burton of http://blog.terryburton.co.uk has a very simple solution to the issue of getting the Apache access_logs to be set via syslog. By default Apache only seems to support … Continue reading

Linux log tail

A very handy command to use when debugging apache issues is the “tail -f” command. This will display continually output the last lines of each specified log file.   i.e. “tail -f /var/log/https/access_log”

Linux networking

Add default gateway in /etc/sysconfig/network i.e. “GATEWAY=” Restart the neowkring service using /etc/init.d/network restart