Archive for the ‘Linux’ Category

How to mount an .iso image file?

Monday, August 25th, 2008

$ sudo mount -o loop /path/to/feisty-desktop-i386.iso /tmp/ubuntu-livecd

How to Find and Replace a String on the command line?

Monday, August 25th, 2008

This command will replace all instances of ‘replaceme’ with ‘newstring’ in files ‘*.php’ on /home/mysite/httpdocs.

find /home/mysite/httpdocs -name '*.php' | xargs replace 'replaceme' 'newstring' --

How to Refresh my DNS cached record?

Sunday, August 24th, 2008
  1. Use OpenDNS free services by adding 208.67.222.222 and 208.67.220.220 on your /etc/resolv.conf.
  2. Go to http://www.opendns.com/support/cache/ then enter the website address.

How to list all users on a Linux machine?

Saturday, August 16th, 2008

 cat /etc/passwd | cut -d":" -f1

Multiple SSL Certificate on Single IP

Wednesday, August 6th, 2008

Follow the links:

Virtual host examples from Apache website.

http://httpd.apache.org/docs/2.0/vhosts/examples.html

Turns out that it is possible to have multiple VirtualHosts on port 80 (Default http), but because of a limitation of SSL, we can’t have multiple VirtualHosts on port 443 (Default https).
I solved the problem as follows. I created the two VirtualHosts on port 80, one on port 443 and one on port 444.

Shared IP, multiple vhosts and multiple SSL certificates on Apache

The process is only 2 steps and involves modifying your Apache configuration.
1.  Create virtual hosts “map file”.
2.  Modify existing SSL vhost.

Caveat: The SSL certificate used will be common to all SSL vhosts.

Hosting multiple SSL vhosts on a single IP/Port/Certificate with Apache2

The following article discusses the following:
Basics Of Virtual Hosts, Name-Based Virtual Hosts, IP-Based Virtual Hosts, Configuring IP Aliasing, Virtual Hosts with IPs, Multiple Instances of Apache, Example for name based virtual hosts, Example for IP based virtual hosts.

Creating Name Based and IP Based Virtual hosts in Apache

How to Unzip a .gz File

Monday, July 28th, 2008

$ gzip -d compressed_file.gz

Free Secondary DNS and Online DNS Tools

Saturday, July 26th, 2008

These free tools have been designed to validate and check the health of your public DNS servers.

How is my DNS

Network Tools

Free Secondary DNS for your domains. If your looking for another DNS to put your domain in, this is for you. Providing additional secondary servers can greatly improve the reliability and accessibility of your domain. Should your primary DNS become unavailable due to network problems, your secondary DNS entries come into play, the more DNS servers you have, the greater the resilience to errors.

Free Secondary DNS

How to setup a primary nameservers on a dedicated server

Friday, July 25th, 2008

Here are the steps:

  1. Locate named.conf and go to that folder.
  2. Add DNS entries for your nameserver.
  3. Edit the pri.yourname.com file for the domain you are adding nameservers for.
    Add these two lines at the bottom of the file:
    ns1 IN A 10.10.10.10 (replace with your nameserver IP)
    ns2 IN A 10.10.10.10
    By the way, you can host your website and nameservers on the same IP.

  4. Reload the nameserver daemon.
    $ sudo /etc/init.d/bind9 reload
  5. Ping the nameservers, and they should resolve to the correct IP.
    If they do not, edit /etc/resolv.conf and add the following line above all other lines beginning with “nameserver”, add:
    nameserver 127.0.0.1
  6. Go to your registrar of your domain name, and register the nameservers to point to the your nameserver IP.

Keeping the Root Hints Current

Friday, July 25th, 2008

To keep the root hints file current, use the following command.

$ dig @a.root-servers.net . ns > db.cache

How to check your DNS configuration and zone files

Friday, July 25th, 2008

If you are running BIND 9, you have handy new tools to help maintain your nameserver files: named-checkconf and named-checkzone. These tools reside in /usr/sbin or /usr/local/sbin.

named-checkconf checks the configuration file for syntax errors.
$ /usr/sbin/named-checkconf zonename db.local
zone zonename/IN: loaded serial 1
OK

named-checkzone checks a zone file for syntax errors.
$ /usr/sbin/named-checkzone zonename pri.108.10.20.in-addr.arpa
zone zonename/IN: loaded serial 2004071902
OK