Archive

Archive for the ‘linux’ Category

MBRFix – Removing Linux from Dual Boot

March 3rd, 2007 rupert Comments off

You have a dual boot notebook with Linux + XP, no floppy and just lazy using the Windows XP CD to do a fixmbr. Use the ‘mbrfix’ from http://www.ambience.sk/fdisk-master-boot-record-windows-linux-lilo-fixmbr.php. Run this utility to wipe out GRUB or LILO from the mbr and restore the Windows Boot loader into MBR. Sweet.

Categories: linux Tags:

Installing a qmail server

February 1st, 2007 rupert Comments off

Its been almost two years now since I installed a mail server. Nevertheless, qmail still rocks as qmailtoaster becomes more convenient to install. I also tried the install on a fresh CentOS4.4 machines, and it works like a charm.

--------------------------------------------------------------------
EZ QmailToaster Fresh Install on CentOS 4.3
Nick Hemmesch <nick @ndhsoft.com> June 08, 2006
--------------------------------------------------------------------
 
CentOS 4.3: This test install was performed on an
P4 3Ghz with 2GB ram on an Intel m/b. 
 
--------------------------------------------------------------------
This tutorial is for CentOS 4.3 (cnt40) i386 
 
To install CentOS 4.3 x86_64, replace cnt40 with cnt4064
 
To install Fedora Core 4 &amp; 5, change download path from centos to
fedora &amp; cnt40 to fdr40, fdr4064, fdr50 or fdr5064 per your distro
--------------------------------------------------------------------
 
Notes:
 
You must have either a local dns server or a local caching name
server. If you need a caching namserver, we will add one in Step 8.
 
Be sure to replace "your-domain.com" with your real domain name,
and "your.fqdn.com" with your server's "Fully Qualified Domain Name".
 
--------------------------------------------------------------------
1. Download CentOS 4.3 CD iso's or the DVD iso.
--------------------------------------------------------------------
 
  Burn iso's to CD, or DVD if you downloded a DVD iso
 
  Boot with your CD 1 or the DVD
 
--------------------------------------------------------------------
2. CentOS Installation (This is the configuration of my test box):
--------------------------------------------------------------------
 
  Splash Page: <enter> to install in graphical mode  
 
  CD Found window: Choose "Skip" to bypass media test  
 
  Welcome to CentOS: Click "Next"
 
  Language Selection: Select your language &amp; Click "Next"
 
  Keyboard Configuration: Select language type &amp; Click "Next"
 
  Installation Type: Select "Server" &amp; Click "Next"
 
  Disk Partitioning Setup: Select "Automatically Partition &amp; Click "Next"
 
      Warning: Click "Yes"
 
  Automatic Partitioning: Select "Remove all partitions" &amp; Click "Next"
 
      Warning: Click "Yes"
 
  Disk Setup: Click "Next"
 
  Boot Loader Configuration: Click "Next"
 
  Network Configuration: Click "Edit"
 
      Edit Interface eth0: Deselect "Configure using DHCP"
 
      Select "Activate on boot"
 
      Enter your "IP Address" &amp; "Netmask"
 
      Click "OK
 
      Set the hostname:
 
          Deselect "automatically via DHCP"
 
          Select "manually" &amp; enter your "fully qualified domain name"
 
      Miscellaneous Settings:
 
          Gateway: enter IP address of your gateway
 
          Primary DNS: enter IP address of primary dns server
 
          Secondary DNS: enter IP address of secondary dns server
 
      Click "Next"
 
  Firewall Configuration:
 
      Select "No firewall"
 
      Select "Disabled" mode for SELinux
 
      Click "Next"
 
          Warning - No Firewall: Click "Proceed"
 
  Additional Language Support" Click "Next"
 
  Time Zone Selection: Select your time zone &amp; Click "Next"
 
  Set Root Password: Enter your root password twice &amp; Click "Next"
 
--------------------------------------------------------------------
3. Package Group Selection - Select ONLY the following groups:
--------------------------------------------------------------------
 
  Server Configuration Tools: Select
 
  Web Server: Select
 
      Click "Details" and add php-mysql plus the defaults
 
  DNS Name Server: Select
 
  FTP Server: Select
 
  MySQL Database: Select
 
      Click "Details" and add mysql-bench, mysql-server plus the defaults
 
  Development Tools: Select
 
      Click "Details" and add expect to the defaults
 
  Administration Tools: Select
 
  System Tools: Select
 
      Click "Details" and add mrtg to the defaults
 
  Click "Next"
 
  About to Install: Click "Next"
 
      Required Install Media: verify and click "Continue"
 
  Installing Packages: Click "Next" &amp; watch the install
 
  After installation: remove your media &amp; Click "Reboot"
 
--------------------------------------------------------------------
4. After reboot, login as root:
--------------------------------------------------------------------
 
  mkdir -p /usr/src/qtms-install
 
  cd /usr/src/qtms-install
 
  This example is CentOS 4.3 i386 so the qmailtoaster switch is cnt40 
 
--------------------------------------------------------------------
5. Prepare to Install QmailToaster:
--------------------------------------------------------------------
 
  wget http://www.qmailtoaster.com/centos/cnt40/cnt40-deps.sh
 
      sh cnt40-deps.sh
 
  wget http://www.qmailtoaster.com/centos/cnt40/cnt40-perl.sh
 
      sh cnt40-perl.sh
 
  wget http://www.qmailtoaster.com/centos/cnt40/cnt40-svcs.sh
 
  wget http://www.qmailtoaster.com/centos/cnt40/firewall.sh
 
      nano -w cnt40-svcs.sh
 
      edit MYSQLPW=your-mysql-password
 
      ctl-o and enter to save
 
      ctl-x to exit
 
      nano -w firewall.sh
 
      edit MYIP="your-IP-address"
 
      ctl-o and enter to save
 
      ctl-x to exit
 
      sh cnt40-svcs.sh
 
  === NOTE ===
 
  This script turns on or off all necessary services. Then the script sets
  up your mysql root account, creates and grants privileges for your vpopmail
  mysql account, makes a symlink so your krb5 is read properly, edits your
  php.ini, sets inittab to start at runlevel 3, and sets up your firewall.
 
  Note: You might see some service errors while the script runs,
  don't worry about them.
 
  ============
 
  Update all your packages:
 
      yum -y update
 
  REBOOT
 
--------------------------------------------------------------------
6. Get QmailToaster Packages:
--------------------------------------------------------------------
 
  cd /usr/src/qtms-install
 
  wget http://www.qmailtoaster.com/info/current-download-script.sh
 
      sh current-download-script.sh
 
  This script downloads all necessary packages into you current
  directory (should be /usr/src/qtms-install/).
 
--------------------------------------------------------------------
7. Install QmailToaster Packages:
--------------------------------------------------------------------
 
  wget http://www.qmailtoaster.com/centos/cnt40/cnt40-install-script.sh
 
      sh cnt40-install-script.sh
 
  Check your services:
 
      setup: Select Services
 
          See that the following services are selected: acpid anacron
 
          atd autofs cpuspeed crond djbdns freshclam haldaemon httpd
 
          iptables kudzu messagebus mysqld network ntpd qmail rawdevices
 
          smartd sshd syslog xinet
 
          Also: irqbalance (w/dual processors) xfs (w/xwindows)
 
--------------------------------------------------------------------
8. Add djbdns (if you don't want bind)
--------------------------------------------------------------------
 
  rpm -e --nodeps bind bind-chroot caching-nameserver
 
  rpmbuild --rebuild --with cnt40 djbdns*.src.rpm
 
  rpm -Uvh ../redhat/RPMS/i386/djbdns-localcache*.rpm
 
  echo "search your-domain.com" &gt; /etc/resolv.conf
  echo "nameserver 127.0.0.1" &gt;&gt; /etc/resolv.conf
 
  REBOOT
 
--------------------------------------------------------------------
9. Setup QmailToaster:
--------------------------------------------------------------------
 
  qmailctl stat
 
  (Should look somewhat like this)
 
      [root@gateway ~]# qmailctl stat
      authlib: up (pid 2425) 65 seconds
      clamd: up (pid 2425) 65 seconds
      imap4: up (pid 2421) 65 seconds
      imap4-ssl: up (pid 2423) 65 seconds
      pop3: up (pid 2414) 65 seconds
      pop3-ssl: up (pid 2409) 65 seconds
      send: up (pid 2416) 65 seconds
      smtp: up (pid 2418) 65 seconds
      spamd: up (pid 2407) 65 seconds
      authlib/log: up (pid 2417) 65 seconds
      clamd/log: up (pid 2417) 65 seconds
      imap4/log: up (pid 2422) 65 seconds
      imap4-ssl/log: up (pid 2424) 65 seconds
      pop3/log: up (pid 2415) 65 seconds
      pop3-ssl/log: up (pid 2413) 65 seconds
      send/log: up (pid 2420) 65 seconds
      smtp/log: up (pid 2419) 65 seconds
      spamd/log: up (pid 2408) 65 seconds
      [root@gateway ~]#
 
  Add a domain:
 
      /home/vpopmail/bin/vadddomain your-domain.com
<postmaster -password>
 
  Add a user:
 
      /home/vpopmail/bin/vadduser you@your-domain.com <your -password>
 
  Edit /etc/php.ini and set register_globals = On
 
      service httpd restart  
 
  Bring up your browser and go to:
 
      http://www.your-domain.com/admin-toaster/
 
        Username: admin
        Password: toaster
 
      Change your password . . . 
 
  Edit /etc/php.ini and set register_globals = Off
 
      service httpd restart  
 
  Check your mail server:
 
      http://www.your-domain.com/webmail
 
      login with your full email address and your password
 
      Send yourself an email - should show right away
 
      Send an email to yourself if you have another address
 
      Go to your other email account and reply to the message you sent
 
  If Isoqlog doesn't show right away, do this:
 
      sh /usr/share/toaster/isoqlog/bin/cron.sh
 
--------------------------------------------------------------------
10. Add domainkeys:
--------------------------------------------------------------------
 
  Make dir for yourdomain.com: 
 
      mkdir /var/qmail/control/domainkeys/your-domain.com 
 
  Make domainkey (Remove the "\"): 
 
      dknewkey /var/qmail/control/domainkeys/your-domain.com/private &gt; \
                                                         your-domain-dk.txt 
 
      chown root:qmail /var/qmail/control/domainkeys/your-domain.com/private
      chmod 444 /var/qmail/control/domainkeys/your-domain.com/private
 
  Make dns entry: 
 
      BIND - in the your-domain.com zone file (see yourdomain-dk.txt):
 
         private._domainkey IN TXT "k=rsa; p=MEwwDQY . . . to end of key"
            (NOTE QUOTATION MARKS MUST BE THERE) 
 
      DJBDNS - in /var/djbdns/tinydns/root/data (make from your-domain-dk.txt): 
 
        '_domainkey.your-domain.com:o=-; r=postmaster@your-domain.com
        'private._domainkey.your-domain.com:k=rsa; p=MEwwDQY . . . to end of key 
 
  Test your mailserver:
 
      http://domainkeys.sourceforge.net/policycheck.html
      http://domainkeys.sourceforge.net/selectorcheck.html
 
      In squirrelmail, send a test email, select View Full Header and you
      should find something like the following:
 
      ----------- snip ------------
      DomainKey-Status: good
      Received: by simscan 1.2.0 ppid: 22641, pid: 22644, t: 0.8416s
           scanners: clamav: 0.88.2/m:38/d:1476 spam: 3.1.1
      X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on ndh1.whatgives.org
      X-Spam-Level: *
      X-Spam-Status: No, score=1.6 required=5.0 tests=FROM_DOMAIN_NOVOWEL
           autolearn=no version=3.1.1
      Received: from unknown (HELO ns1.ndhsdns.com) (216.221.100.227)
           by ndh1.whatgives.org with (DHE-RSA-AES256-SHA encrypted) SMTP; 22 May 2006 20:03:36 -0000
      Received-SPF: pass (ndh1.whatgives.org: SPF record at ndhsdns.com designates 216.221.100.227 as permitted sender)
      Received: (qmail 28034 invoked by uid 89); 22 May 2006 20:03:36 -0000
      Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
      DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
           s=private; d=ndhsdns.com;
           b=XVKQZe446BXMnSoQKvgchf0DRx4v8YQYZn5KVLj5O8XYf7V1dX7ETaJ1VGWGp5Bf ;
      Received: from unknown (HELO www.ndhsdns.com) (127.0.0.1)
           by ns1.ndhsdns.com with SMTP; 22 May 2006 20:03:36 -0000
      ----------- snip ------------
 
--------------------------------------------------------------------
11. Logs for all packages except freshclam are at:
--------------------------------------------------------------------
 
  /var/log/qmail/*
 
  Freshclam is at /var/log/clamav
</your></postmaster></enter></nick>

Notes:
The only problem I stumbbled upon is when using vadddomain, as the mysql password was still set to “SsEeCcRrEeTt”. Edit these files before adding a domain. I dont use the web interface when adding a domain, i prefer it by command line.

[root@mail vpopmail]# find . | grep mysql
./etc/vpopmail.mysql.dist
./etc/vpopmail.mysql

After all the installs is completed, reboot and check if qmail is running.

Administrator links:
http://your-mail-server-ip/admin-toaster/ -> this is the main administration interface
http://your-mail-server-ip/qmailadmin/ -> administrative interface to manage accounts
http://your-mail-server-ip/webmail/ -> an email account interface

Categories: linux Tags: , ,

Preparing your linux machine

January 15th, 2007 rupert Comments off

1. For production servers, you need to install CentOS4.4 minimal.
- Create partitions as follow:
/boot – 100
swap – 2x as the memory, if the memory is 2GB, then your swap should be 4096MB
/ – assign the rest for root
/data – if needs be
- Choose GRUB as boot loader.
- Disable SELINUX
- Enable httpd, sshd
- Choose minimal

2. Get connected to your network. Modify your network as needed. Network configuration scripts are found in

/etc/sysconfig/network-scripts/

You should see at least the ff, depending on how many ethernet interfaces you have:

ifcfg-eth0
ifcfg-lo

Edit ifcfg-eth0:

DEVICE=eth0
BOOTPROTO=static
HWADDR=00:16:96:10:F3:2B
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.1.105
GATEWAY=192.168.1.1

3. Edit your hostname:

#vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rupert-linux

4. Edit your hosts:

# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 rupert-linux localhost.localdomain localhost
192.168.1.10 appserver
192.168.1.11 dbserver1
192.168.1.12 svnserver

Providing ip addreses on your hosts can make network access faster, depending on the routes.

5. Edit your path to reflect the ff:

#vi /etc/skel/.bash_profile
PATH=$PATH:$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin
export HTDOCS=/usr/local/apache2/htdocs
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/lib

cp -Rf /etc/skel/.bash_profile /home/rupert/
cp -Rf /etc/skel/.bash_profile /home/tan/
cp -Rf /etc/skel/.bash_profile /root/
6. Copy the centos packages into your harddisk, so you don’t need the CD’s later on. Reboot.

7. Install the ff rpms:

#install gcc
echo "installing gcc"
rpm -ivh cpp-3.4.6-3.i386.rpm
rpm -ivh glibc-kernheaders-2.4-9.1.98.EL.i386.rpm
rpm -ivh glibc-headers-2.3.4-2.25.i386.rpm
rpm -ivh glibc-devel-2.3.4-2.25.i386.rpm
rpm -ivh gcc-3.4.6-3.i386.rpm

echo “installing gcc++”
rpm -ivh compat-libstdc++-33-3.2.3-47.3
rpm -ivh compat-libstdc++-296-2.96-132.7.2
rpm -ivh libstdc++-3.4.6-3
rpm -ivh gcc-c++-3.4.6-3

#installing other utilies
rpm -ivh apr-0.9.4-24.5.c4.2.i386.rpm
rpm -ivh apr-util-0.9.4-21.i386.rpm
rpm -ivh neon-0.24.7-4.i386.rpm
rpm -ivh perl-URI-1.30-4.noarch.rpm
rpm -ivh umb-scheme-3.2-36.EL4.i386.rpm
rpm -ivh guile-1.6.4-14.i386.rpm
rpm -ivh swig-1.3.21-6.i386.rpm
rpm -ivh subversion-1.1.4-2.ent.i386.rpm
rpm -ivh perl-DBI-1.40-8.i386.rpm
rpm -ivh nmap-3.70-1.i386.rpm
rpm -ivh vim-common-6.3.046-0.40E.7.i386.rpm
rpm -ivh vim-enhanced-6.3.046-0.40E.7.i386.rpm
rpm -ivh binutils-2.15.92.0.2-21.i386.rpm
8. Disable unneeded services.

chkconfig bluetooth off
chkconfig cups off
chkconfig irda off
chkconfig isdn off
chkconfig netdump off
chkconfig netfs off
chkconfig nfs off
chkconfig nfslock off
chkconfig nscd off
chkconfig openibd off
chkconfig pand off
chkconfig pcmcia off
chkconfig portmap off
chkconfig rhnsd off
chkconfig rpcgssd off
chkconfig rpcidmapd off
chkconfig rpcsvcgssd off
chkconfig sendmail off
chkconfig syslog off
chkconfig xfs off
chkconfig xinetd off
chkconfig ypbind off
chkconfig yum off

Categories: linux Tags:

Dual Booting WindowsXP+CentOS4.4 on Compaq Presario V3000T

January 14th, 2007 rupert Comments off

I recently bought a Presario V3009T for Y6800=$871=P42,717. Specs are below:
- Core Duo T2050 1.60GHz
- 60 GB Hard Disk
- 512 MB PC4000 (I think) 533 MHz (tried installing a 400 MHZ 512 MB.. got a dreaded double beep.. means..it didnt worked obviously)
- Video: Intel 945GM Express Chipset
- Network:
LAN: Intel PRO/100 VE Network Connection
WIRELESS: Intel PRO/Wireless 3945ABG Network Connection

1. Chinese Windows XP Home was installed so I have to reinstall an English Version.

2. On Boot, press F10, Disable SATA Support.

3. Install Windows XP SlipStream. Leave at least 10GB partition for Linux. No need for QuickPlay, don’t create a 1 GB partition. Updated the drivers, update the chipset first, HDD, Network, etc.. Enable SATA Support. Install other drivers as needed.

4. To patch WGA, use WPatcherP5575987.zip. Follow steps on http://www.mydigitallife.info/2006/12/03/permanent-method-to-crack-wga-and-patch-windows-xp-inc-mce-or-2003-as-genuine

5. Create a restore point just in case any mishap happens. I named the restore point “FULLY FUNCTIONAL” on Jan 13, 2007.

6. Install CentOS4.4. Create three partitions /boot, swap, /.

7. Reboot. CentOS was installed successfully, however, audio was not detected. You would only get “Initializing hardware… network storage.. ” then system hangs..

8. Reboot and insert the CentOS4.4 Installer. Run “linux rescue” from the prompt.

9. Edit /etc/rc.d/sysinit to comment out AUDIO. Disable kudzu from startup “/etc/init.d/”.
#chkconfig kudzu off

10. Reboot.

I still need to get the adsl, wireless and usb-optical mouse working on CentOS. If this causes too much pain, might as well install FC5.

Categories: linux Tags: