Aug 7, 2008
If you want to change your Linux hostname and you’re running Fedora or Red Hat, the steps are listed below.
echo 'some.host.com' > /proc/sys/kernel/hostname
This is for non-DHCP nodes.
Add your name to /etc/sysconfig/network
If you’re node gets an IP address from a DHCP server then you can set:
in the /etc/sysconfig/network-scripts/ifcfg-eth0 file (or whatever your primary device is).
You can also add your hostname to your /etc/hosts file
10.1.1.10 some.host.com some
Aug 6, 2008
If you need to script a password change you have two main options:
- Write a script that interacts with the command line and executes passwd
- Use the usermod command
Option one is a bit of a mess and option two requires an encrypted version of the password. At first, we couldn’t figure out how to encrypt the password but then we realized that you could use the Perl crypt function.
An example of number two:
usermod -p `perl -e 'print crypt("test", "salt")'` root;
That’s all there is to it!
Aug 4, 2008
Cronolog is a handy file rotation tool for Apache.
To create daily log files, add something like this to your httpd.conf file.
CustomLog "|/usr/local/sbin/cronolog /var/log/httpd/%Y/%m/%d/access.log" combinedio
Installation is simply:
configure && make && make install