Some of my websites hosted on a VPS started behaving erratically a few days back. WP based websites resulted in killed sessions. Magento ones simply stopped working prompting “500 Internal Server” error. Pinging server IP yielded desired results though. Static pages were also fine.
Tech support guys of the server hosting company were clueless. Finally, fixed the issue myself realising the culprit was unprecedented creation of session files due to some bot attacks. Server’s inode usage had exceeded the limit and hence file creation failed even though there was enough disk space left on the server.
For a ready reckoner listing some essential Unix commands for system admins responsible for monitoring and maintenance of server.
Command | Usage | Description |
---|---|---|
df | df | See how much free disk space |
du | du -b subdir | Estimate disk usage of directory in Bytes |
alias | alias lls=”ls -alF” | Create new command “lls” for long format of ls |
xhost | xhost + threat.tjhsst.edu xhost – | Permit window to display from x-window program from threat Allow no x-window access from other systems |
fold | fold -s file1 | lpr | Fold or break long lines at 60 characters and send to printer |
tar | tar -cf subdir.tar subdir tar -xvf subdir.tar | Create an archive called subdir.tar of a directory Extract files from an archive file |
ghostview (gv) | gv filename.ps | View a Postscript file |
ping (traceroute) | ping threat.tjhsst.edu traceroute www.yahoo.com | See if machine is alive Print data path to a machine |
top | top | Print system usage and top resource hogs |
logout (exit) | logout or exit | How to quit a UNIX shell. |
grep <str><files> | grep “bad word” * | Find which files contain a certain word |
chmod <opt> <file> | chmod 644 *.html chmod 755 file.exe | Change file permissions read only Change file permissions to executable |
passwd | passwd | Change passwd |
ps <opt> | ps aux ps aux | grep dhyatt | List all running processes by #ID List process #ID’s running by dhyatt |
kill <opt> <ID> | kill -9 8453 | Kill process with ID #8453 |
gcc (g++) <source> | gcc file.c -o file g++ fil2.cpp -o fil2 | Compile a program written in C Compile a program written in C++ |
gzip <file> | gzip bigfile gunzip bigfile.gz | Compress file Uncompress file |
mail (pine) | mail me@tjhsst.edu < file1 pine | Send file1 by email to someone Read mail using pine |
telnet <host> ssh <host> | telnet vortex.tjhsst.edu ssh -l dhyatt jazz.tjhsst.edu | Open a connection to vortex Open a secure connection to jazz as user dhyatt |
ftp <host> ncftp <host/directory> | ftp station1.tjhsst.edu ncftp metalab.unc.edu | Upload or Download files to station1 Connect to archives at UNC |