Linux Server Hacks: 100 Industrial-Strength Tips and Tools
Format: PDF / Kindle (mobi) / ePub
A competent system administrator knows that a Linux server is a high performance system for routing large amounts of information through a network connection. Setting up and maintaining a Linux server requires understanding not only the hardware, but the ins and outs of the Linux operating system along with its supporting cast of utilities as well as layers of applications software. There's basic documentation online but there's a lot beyond the basics you have to know, and this only comes from people with hands-on, real-world experience. This kind of "know how" is what we sought to capture in Linux Server Hacks.Linux Server Hacks is a collection of 100 industrial-strength hacks, providing tips and tools that solve practical problems for Linux system administrators. Every hack can be read in just a few minutes but will save hours of searching for the right answer. Some of the hacks are subtle, many of them are non-obvious, and all of them demonstrate the power and flexibility of a Linux system. You'll find hacks devoted to tuning the Linux kernel to make your system run more efficiently, as well as using CVS or RCS to track the revision to system files. You'll learn alternative ways to do backups, how to use system monitoring tools to track system performance and a variety of secure networking solutions. Linux Server Hacks also helps you manage large-scale Web installations running Apache, MySQL, and other open source tools that are typically part of a Linux system.O'Reilly's new Hacks Series proudly reclaims the term "hacking" for the good guys. Hackers use their ingenuity to solve interesting problems. Rob Flickenger is an experienced system administrator, having managed the systems for O'Reilly Network for several years. (He's also into community wireless networking and he's written a book on that subject for O'Reilly.) Rob has also collected the best ideas and tools from a number of other highly skilled contributors.Written for users who already understand the basics, Linux Server Hacks is built upon the expertise of people who really know what they're doing.
such as rsync. With the cost of disk space at an all-time low, having a locally cached copy of your data makes sense: not only will the single point of failure be eliminated, but the files will be served much faster from the local disk than they could be from network storage. It is very straightforward to add an rsync job to cron on each of the web servers, containing something like this: rsync -ae ssh master.machine.com:/usr/local/apache/htdocs/ \ /usr/local/apache/htdocs/ Assuming that you
password authentication to speed up and automate logins When you’re an admin on more than a few machines, being able to navigate quickly to a shell on any given server is critical. Having to type “ssh my.server.com” (followed by a password) is not only tedious, but it breaks one’s concentration. Suddenly having to shift from “where’s the problem?” to “getting there” and back to “what’s all this, then?” has led more than one admin to premature senility. It promotes the digital equivalent of “why
/var/spool/mysqldump/randomdb.20020901.gz | extract-table Users > ~/ Users.dump Now you can restore your Users table with a simple: # mysql randomdb -e "drop table Users" # mysql randomdb < ~/Users.dump MySQL Server Tuning Try these practical steps to help make your MySQL server run as efficiently as it can Many Linux administrators find themselves suddenly the “DBA in residence” when there is nobody else willing (or able) to take on the job. Many people specialize in tuning and
Unix crypt format, or mysql’s PASSWORD( ) function. Be warned that if you’re using mod_sql’s logging facilities, that the password may be exposed in plain text, so keep those logs private. The SQLAuthTypes line as specified won’t allow blank passwords; if you need that functionality, also include the empty keyword. The SQLMinUserGID and SQLMinUserUID specify the minimum group and user id that proftpd will permit on login. It’s a good idea to make this greater than zero (to prohibit root logins)
Replication in MySQL82.1. See also: 83. Restoring a Single Table from a Large MySQL Dump 84. MySQL Server Tuning84.1. See also: 85. Using proftpd with a mysql Authentication Source85.1. See also: 86. Optimizing glibc, linuxthreads, and the Kernel for a Super MySQL Server86.1. Step 1: Build glib 86.2. Step 2: The Kernel 86.3. Step 3: Build a New MySQL 86.4. Step 4: Expand the Maximum Filehandles at Boot 87. Apache Toolbox87.1. See Also: 88. Display the Full Filename in