Linux
Webmin Notes

These are notes I have gathered from using Webmin, my favourite application to manage Linux installations.

Starting Webmin

If Webmin fails to start try:

/etc/init.d/webmin start
 
Using Apache on Ubuntu

These are a few notes I have made whilst using Apache 2 on Ubuntu.

Starting the Apache Server

At a terminal session, enter the following:

sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
or
sudo /etc/init.d/apache2 restart
 
Recover from Shutdown during Ubunto Upgrade

(from http://serverfault.com/questions/8540/recover-from-shutdown-during-ubuntu-distribution-upgrade, viewed June 2011)

I have a computer which was unexpectedly shut down during a distribution upgrade (Ubuntu 8.10 -> 9.04). It now won't finish booting - various X errors, then it goes to the login screen but won't allow logins. I have a backup of it and the /home data is all still OK on the drive so it's no emergancy, but a complete rebuild is still an annoying and time consuming process.

The upgrade was recovered using something like this:
sudo dpkg --configure -a
sudo apt-get update
sudo dpkg --configure -a
sudo dpkg --configure -a --abort-after=99999
sudo apt-get dist-upgrade
sudo apt-get -f install
sudo apt-get dist-upgrade
 
DNS Caching for Linux using dnsmasq

This is an article about an alternative to DNS on Ubuntu.

"...My DSL service providers DNS server seems to be little slow, they have two servers it takes little time (some time upto 2 seconds) to resolve a domain name, once domain resolved, browsing speed remains the same, what should I do to improve DNS performance?...."

The answer is use a DNS proxy i.e. Dnsmasq. It is a a lightweight, easy to configure DNS forwarder and optional DHCP server. Dnsmasq is targeted at home networks using NAT and connected to the internet via a modem, cable-modem or ADSL connection but would be a good choice for any small network where low resource use and ease of configuration are important. The main use of the DNS proxy is to increase speed. Generally all computer send their request to ISP's DNS servers. But with DNS proxy request are cached. It stands between your local system and firewall server. Here is our sample network setup, 192.168.1.1-3 are all desktop system, 192.168.1.254 is our Linux firewall server:

Laptop | Desktop --> Linux Server --> ADSL Modem/Router
                   Firewall
192.168.1.1         192.168.1.254 -> Dynamic or
192.168.1.2                          Static IP assign
192.168.1.3                          by ISP

Login to your Linux firewall server and install Dnsmasq .

Step # 1 : Install Dnsmasq (Debian Linux)

# apt-get install dnsmasq

Fedora/Redhat/Centos user, use yum command to install dnsmasq:

# yum install dnsmasq

RedHat Linux user use rpm/up2date command to install it:

# up2date -i dnsmasq

Step # 2 Configure Dnsmasq

To be frank you don't have to change a single line in /etc/dnsmasq.conf. However you need to setup 127.0.0.1 as dns server name in /etc/resolve.conf file:

# vi /etc/resolve.conf

nameserver 127.0.0.1
nameserver 202.54.10.1
nameserver 202.54.20.1

Replace 202.54.10.1/202.54.20.1 with your actual ISP DNS server IPS. The dnsmasq should read the list of ISP nameservers from the automatically /etc/resolv.conf. You should list 127.0.0.1 as the first nameserver address in /etc/resolv.conf. So local desktop clients always gets cached queries.

Step # 3 Restart/start Dnsmasq

# /etc/init.d/dnsmasq start

Step # 4 Update DNS server IPS for all desktop systems

Point your windows XP or Linux Desktop client to IP of Linux firewall server i.e. 192.168.1.254 (see above network diagram)

It is easy to use Dnsmasq rather than setting up caching BIND server. But hold on it has some cool usage too. You can add domains which you want to force to specific IP address. For example, doubleclick.net displays ugly adds on many sites, just send this server it to our 127.0.0.1 (i.e. your local server ). Just open a file /etc/dnsmasq.conf and add following line to it:
address=/doubleclick.net/127.0.0.1

Restart Dnsmasq and make sure you runs local webserver at 127.0.0.1 with some default page. Read the Dnsmasq man page and docs for more information.

 
Restoring Backup PC

BackupPC is an application that runs on a Linux platform and is accessable from any computer on the network using any web browser. It will back up any PC and folders that are required. Space is saved by compression and reusing files already backed up from other machines.

Ideally the backup files should be kept on an external Linux formatted partition.

Migrating or Reinstalling BackupPC

For my system the pool is located on a USB external drive. I needed to upgrade from Fedora to Ubuntu with BackupPC keeping the same pool.

The steps:

  1. Install backuppc on the new server.
  2. Mount the storage on the same position/path.
    1. Be sure that the "backuppc" UID and GID (Group and User IDs) are the same as for the old server. I had to change them manually. This is important to me because my NFS kept the file permissions and ownership of the files.
  3. In /etc/backuppc:
    • I reconfigured the config.pl based on the old one. I didn't copied directly the old one.
    • Reconfigured the hosts file based on the old one.
    • Copied the "servers.pl" files from the old server to the new one.
    • Copied the ht* files from the old server to the new one.
  4. Change the configuration of apache2 as the documentation explains.
  5. Stop the backuppc daemon on the old server and unmount the NFS pool storage.
  6. Start the backuppc daemon on the new server.
  7. Test the backup and restore manually. Check the configuration.
  8. Test the automatic backup during night, or whenever you have yours scheduled.
(from http://permalink.gmane.org/gmane.comp.sysutils.backup.backuppc.general/25246)
 


facebookjoinCopyright © 2010 Rinet IT. All rights reserved. Admin.
Powered by Joomla! Design based on Splash template by BUYHTTP. Open Source Matters