changing the default email server wide (cpanel compatable)

replace :blackhole: :fail: — /etc/valiases/*
replace :blackhole :fail: — /etc/valiases/*
replace blackhole: :fail: — /etc/valiases/*
replace blackhole :fail: — /etc/valiases/*
replace ” fail:” ” :fail:” — /etc/valiases/*
replace /dev/null :fail: — /etc/valiases/*
cd /etc/valiases/
grep fail * | grep -v ” :fail:”

Getting started with the CentOS 4.4 Single Server CD

Centos

Recently I needed to set up a server with all the usual server components — Web, mail, and file sharing. It needed to be rock-solid and reliable. I didn’t want to download 4GB of software from the Net, so I turned to CentOS’ Single Server CD.

CentOS, which stands for Community ENTerprise Operating System, is an enterprise-focused Linux distribution built from the freely available sources (under the GPL and similar licenses) from Red Hat. CentOS 4 is based on Red Hat Enterprise Linux 4 and supports the x86 (i586 and i686), x86_64 (AMD64 and Intel EMT64), IA64, Alpha, and S390 and S390x architectures.

The Single Server CD contains most of the items required for a basic server set up, but without a GUI. It’s great for those who want a functional install quickly. Also, since there is no memory-hungry GUI, you can run a basic server with just 128MB of RAM, though of course you will need more if you need to deploy large databases.

Centos Server Installation

Installing Single Server CD is straightforward, especially if you have installed other Linux distributions. You need to download the Single Server CD from a local mirror, burn it to a disc, and boot your server from that CD.

Even though the Single Server CD doesn’t contain a GUI, the installation process uses a graphical interface, which means it’s easy to install. Follow the on-screen instructions and the install should be effortless. Tip: If your server doesn’t contain any other data and you are happy to have all the disks reformatted, use the “automatically partition” option when it comes to the Disk Partitioning Setup, as this will save you lots of time.

I suggest disabling SELinux and turning off the firewall, especially if your server is secure inside your local LAN. You can change the firewall settings later if you like with the system-config-securitylevel command.

You can safely choose to install the default software packages. This will give you a basic CentOS system with Web, mail, and FTP servers, DNS, and Windows file sharing via Samba. On a modern machine you should be able to have the server installed in less than 20 minutes.

Not all the packages on the CD are installed. For instance, if you require PostgreSQL, you’ll have to install it later from the disc. To install PostgreSQL, mount the CD-ROM (mount /media/cdrom) and use yum to install the client libraries and the server:

yum localinstall /media/cdrom/CentOS/RPMS/postgresql-7*
yum localinstall /media/cdrom/CentOS/RPMS/postgresql-server-7*

PHP 5 and MySQL 5

The strength of CentOS is its reliability and stability. It is built around proven packages and doesn’t rely on bleeding-edge software. However, there is a disadvantage to this, namely that some of the newest software isn’t installed. The most critical omissions, in my opinion, are PHP 5 and MySQL 5, but these packages are available through the CentOS Plus Repository.

By default CentOS 4.4 comes with PHP 4.3.9. To upgrade to PHP 5, make sure your server is connected to the Internet and run the command:

yum –enablerepo=centosplus upgrade php*

The same goes for MySQL. The default in CentOS 4.4 is MySQL 4.1.20. To upgrade to 5, use the following commands:

yum –enablerepo=centosplus upgrade mysql*
yum –enablerepo=centosplus install mysql-server-5*

Simple administration

Since CentOS 4.4 Single Server CD doesn’t come with a GUI, you need to do all your configuration via the command line. Here are few keys commands and files to help you configure your server.

To start and stop a service use:

service XYZ start
service XYZ stop

Where XYZ is the service name, e.g. postgresql.

To configure the networking run:

netconfig

To configure a printer run:

system-config-printer

By default there are several system services that are not started at boot time, including the Web server and the MySQL server. To ensure that the essential services are started at boot time, run the following commands:

chkconfig –levels 235 httpd on
chkconfig –levels 235 mysql on
chkconfig –levels 235 smb on
chkconfig –levels 235 vsftpd on

If you need POP3 and IMAP services, you need to configure the dovecot daemon. By default, the dovecot daemon provides only IMAP services. If you also want POP3 you must edit /etc/dovecot.conf and put in the line:

protocols = imap imaps pop3 pop3s

Dovecot isn’t started by default either (but is installed as one of the standard packages). To make sure it is started at boot time, type:

chkconfig –levels 235 dovecot on

Once you have everything configured correctly, reboot, not because Linux needs it, but just to be sure that everything comes up and runs as expected.

Conclusion
CentOS is a reliable and robust Linux distribution, and the Single Server CD version is close to perfect for anyone looking for a simple but yet functional server distribution without having to download four or five CDs from the net.

How to set up Centos a 4.4 (4.x) Server

This is a detailed description about how to set up a CentOS 4.4 based server that offers all services needed by ISPs and hosters (web server (SSL-capable), mail server (with SMTP-AUTH and TLS!), DNS server, FTP server, MySQL server, POP3/IMAP, Quota, Firewall, etc.). This tutorial is written for the 32-bit version of CentOS 4.4, but should apply to the 64-bit version with very little modifications as well.

It will use the following software:
Web Server: Apache 2.0.x
Database Server: MySQL 4.1
Mail Server: Postfix (easier to configure than sendmail; has a shorter history of security holes than sendmail)
DNS Server: BIND9 (chrooted!)
FTP Server: proftpd
POP3/IMAP server: dovecot
Webalizer for web site statistics
In the end you should have a system that works reliably.

This is not the only way of setting up such a system. There are many ways of achieving this goal but this is a common way. Requirements

To install such a system you will need the following: Download the 4 CentOS 4.4 CD iso images from a mirror near you (the list of mirrors can be found here: http://www.centos.org/modules/tinycontent/index.php?id=13). You can also find it and other Centos versions at Download Spot You will need a internet connection.

 

 
1 Install Centos Boot from your CentOS 4.4 CD
(CD 1).
Centos
It can take a long time to test the installation media so we skip this
test here: Centos
The welcome screen of the CentOS installer appears. Click on Next: Centos
Choose your language next: Centos
Select your keyboard layout:Centos
We want to install a server so we choose Server here:Centos
Next we do the partitioning. Select Automatically partition unless you
are a advanced user. This will give you a small /boot partition and a
large / partition which is fine for our purposes (I use 1 gig for / 1
gig for /temp 8 gigs for /usr 8 gigs for /var 2 gigs for SWAP and split
the rest with /home and /backup:Centos
I’m installing CentOS 4.4 on a fresh system, so I answer Yes
to the question Would you like to initialize this drive, erasing ALL DATA.Centos
Select Remove all partitions on this system.Centos
We want to remove all Linux partitions, so we answer Yes to the following
question:Centos
The installer presents you an overview of our new partitions. Click
on Next:Centos
Now the boot loader GRUB will be installed. You can leave the default
settings unchanged and click on Next:Centos
On to the network settings. The default setting here is to configure
the network interfaces with DHCP, but we are installing a server, so static
IP addresses are not a bad idea… Click on the Edit button at the top
right. In the window that pops up uncheck Configure using DHCP and give
your network card a static IP address (in this tutorial I’m using the
IP address 192.168.0.100 for demonstration purposes):CentosCentos
Set the hostname manually, e.g. dwhs500.dwhs.net, and enter a gateway
(e.g. 192.168.0.1) and up to three DNS servers (e.g. 145.253.2.75, 193.174.32.18,
and 194.25.0.60) Contact your data center, isp, or set up dns servers
for this:Centos
The default firewall does more harm then good. I would disable it completely
and bypass the warning. There is much better after market firewalls like
csf for free.Centos
Click on Proceed:Centos
Select the default language for the system and add further languages,
if necessary:Centos
Choose your time zone:Centos
Give root a password (do not lose this VERY IMPORTANT):Centos
Now we are to select the package groups we want to install. Select Editors,
Text Based Internet, Server Configuration Tools, Web Server, Mail Server,
DNS Name Server, FTP Server, MySQL Database, Development Tools, Administration
Tools and System Tools and click on Next:Centos
The installer tells you which CDs it will need to install the selected
packagesCentosCentos
The installation begins. This will take a few minutes:Centos
Finally, the installation is complete, and you can remove your CD from
the computer and reboot it:Centos

 

Linux just got sexy

sexy linux

Introduction to Linux

linux

Some of my readers today will be aware of a beautiful operating system that goes by the name of Linux. For those who are not already familiar, here is a brief introduction: Linux is a free open-source alternative to Windows and Macintosh. Based off of Unix, Linus Torvalds laid the framework for the kernel many years ago and then made the source code open to all. He still works on the kernel today, but he’s not alone; millions of programmers around the world work to improve Linux with their free time. They’ve worked hard to bring Linux to maturity, and as of the past couple years, it has reached a mature stage where the average computer user is more than capable of using it. In other words, you no longer need to know how a computer works or how to program in order for Linux to be useful to you.

So why am I bringing up this topic? Quite frankly, there aren’t enough Linux users accessing TechwareLabs, and I believe this needs to change.

Whether it’s because you’ve never heard of Linux, have an interest, or tried it years ago when it was still young and was disappointed, one thing is certain: you’re missing out. I’ll be elaborating further into Linux in future articles, but for now, here is a nice introduction.
What do you mean by open-source?

The source code is freely available on the internet per the GPL license. You are more than welcome to view the code, edit it, and republish a new product (assuming you know a thing or two about programming). The only catch is that you have to release your product under the very same GPL license.

This approach to software truly throws the concept of “proprietary” out the window, and is no doubt confusing to anybody who is business-minded. It’s a foreign concept for many as to why one would develop a product and not claim intellectual property rights. The Linux community, in general (though there are exceptions), does not seek to gain profit. Rather, they put their time into Linux for pride and the occasional “thank you.”
There are companies that sell Linux, though.

This is partially true. They’re still licensed under the GPL, which means they are required to release the source code to the general public. What companies such as Red Hat and Novell are doing is not selling the operating system, but rather they are selling support, primarily for servers. Even so, you can use their products for free. Red Hat Enterprise Linux has fees attached to it, but Red Hat sponsors an open-source community around Fedora, which is the free alternative, developed by programmers in their spare time. Similarly for Novell SUSE Linux Enterprise, there is a free alternative in openSUSE.
Windows works fine. Why should I use something else?

Here, we get to the heart of the matter. Why switch, you ask? What’s the point? Simply put, Linux is faster, more stable and above all, easier to use. The speed is due to higher efficiency in storing/retrieving information. The issue of stability isn’t even questioned by [knowledgeable] die-hard Windows fans. Ultimately, the most controversial claim I’ve made is that it’s easier to use.

This is where the argument rages on within the desktop market. There are many long-time Windows users who try Linux, and are scared off, upon which they claim that Linux is hard to use. The fact is, Linux is different, but I would argue that this is a good thing. There is definitely a learning curve, as there always is when you try something new, but the more you just play around with Linux, the more you’ll find it is simply better.
How is it better? What makes it easier?

Everything is better organized. For starters, you know that little program on Windows, Add/Remove Programs? Raise your hand if you’ve ever actually “added” a program using it.

I see a few hands from people who have via a NT system or something similar, but other than that, it is unlikely you’ve used Add/Remove for anything other than “remove” (though Vista does allow for the user to download programs directly from Microsoft, a feature suspiciously appearing long after Linux started doing the exact same thing). In Linux, this little program is called the “package manager”, and this is where you both add AND remove your programs. Everything that’s currently installed, as well as everything you’re able to install from the supplied servers appears in an easy-to-use catalog. For the most part, everything you need is right there in one place. Want to install an office suite? How about an IM program? Or how about a game? Just go to the respective section and choose the program you want. Check the boxes for everything you want to change (install/uninstall) and push the appropriate button to update your system (specifics will differ depending on the package manager used by the distribution).

Linux Communications Suite Enters Beta

 linux outlook

Unison is offering a unified communications suite of e-mail, messaging and VoIP as an alternative to Exchange and Outlook.

Software developer Unison has launched what it claims is the world’s first fully-unified communications suite based on Linux.

Announced at CeBIT, the suite (also simply called Unison) combines IP telephony, e-mail and instant messaging with diary, address book and presence capabilities, all in a single Linux server. It is available free as a public beta.

“You can get all these elements separately on Linux, but this is the first time they have all been in one server,” said Rurik Bradbury, Unison’s chief marketing officer. Other unified communications (UC) schemes, such as Microsoft’s Office Communications Server (OCS) can require three or more servers to do the same thing, he added.

“If you’re reasonably familiar with Linux, you can deploy Unison in a couple of hours, and have a complete system running for a company of perhaps 50 or 60 people in half a day,” he said.

The server software works with a Unison client program for Windows PCs. This provides a genuine alternative to Microsoft’s combination of Exchange and Outlook, Bradbury claimed.

“We’re amazed no-one has done this before — build both a client and a server. Others have either one or the other,” he said. He added that a Linux version of the client will come later this year.

Unison is aimed at 20- to 300-seat organizations, but the US-based company plans to add server clustering in the future to support more. It is partly based on open source technology, such as Thunderbird for email and Jabber for instant messaging, and partly developed by Unison’s own programmers.

The software is initially offered as a free beta version but is already fit for use, Bradbury claimed.

“It is almost finished — it is relatively stable software,” he said, joking that he uses commercial software that’s less robust.

Once the beta program is complete there will be a free “community” version for up to 20 users, and per-user or perpetual licences will be sold for larger systems, although pricing for those is not yet fixed.

Linux Powers The Spiderwick Chronicles

Linux Powers The Spiderwick Chronicles

A Linux-based production pipeline is a perfect choice for a major motion picture like The Spiderwick Chronicles, with its many goblins and magical creatures. Hollywood has been the realm of Linux since 1997, when the movie Titanic proved that Linux can do big computer graphics jobs like rendering a sinking ocean liner. With an industry tradition of using UNIX-based operating systems for high-computation jobs, and due to the better, faster, cheaper nature of Linux, every major effects or animation movie today is produced using Linux. Visual effects facilities ILM and Tippett Studio each created visual effects for Spiderwick. Having multiple effects houses work on the same movie became common after 2003 when The Matrix Reloaded used a dozen effects houses.

Tippett Studio: Linux on Macintosh Desktops

The idea of switching Mac desktops to Linux is new in the film industry. The film industry routinely uses Macs running OS X for specialized tasks, such as art department concept artwork generated using Adobe Photoshop, picture editing with Final Cut Pro and sound editing with ProTools. When you scale past a few systems, the advantages of Linux for graphics become apparent, and Linux graphics PC desktops are the norm. The television series South Park is a notable exception, with Mac OS X desktops running Maya with a Linux renderfarm.

During the production of Spiderwick, Tippett Studio switched to Fedora Linux running on Macintosh desktops. “We currently have 119 Intel-based Apple Mac Pro workstations running Linux”, says Tippett Computer Graphics Supervisor Russell Darling. “We decided to go with Apple hardware running Linux for our primary artist workstations on The Spiderwick Chronicles, although it might have been considered a risky endeavor for a show in production. We initially had some problems with sound on Maya and a few other minor issues, but they were resolved. We got a patch from Autodesk that took care of everything.” Commercial Linux software vendors work closely with film studio clients.

Tippett chose Linux on Mac for many reasons. “There’s the ability to run multiple operating systems, including Linux, OS X and Windows”, says Darling, and he continues, “The systems are fast! That makes for more productive artists. The hardware is quiet and energy-efficient. It’s cost-effective, with a good cost per rendermark [a renderfarm performance benchmark]. It’s standardized hardware. And, there’s a good support plan. Although the majority of our workstations run Linux, we have a handful of other systems running to support specific software. We use the ability to boot in to other operating systems, but the ultimate goal is to move to a simultaneous multi-OS solution, such as Parallels.”

To beat traditional alternatives, the Apple Mac Pro workstations had to meet a specific set of Tippett requirements. They had to run Fedora FC4 and XFS. They also had to run tools that Tippett uses, such as Maya with sound and in-house and third-party plugins (MEL scripts), Apple Shake with in-house and third-party plugins, SyFlex, cMuscle, RealFlow, JET, Flipper, rtTools and cineSpace. Internally developed software uses Python, Perl and C/C++. The platform must render frames identical to existing hardware. And, it has to support necessary peripherals, especially tablets.

ILM: Mulgarath, Thimbletack, the Griffin, the Sprites and Stray Sod

“The important thing with a fantasy genre is referencing nature”, says ILM Art Director Christian Alzmann. “The Byron plumage is based on a red-tailed hawk. We’re always drawing reference from nature. I did the early design of the Sprites with a bee next to them for scale, with two bees flying in formation. Mulgarath is part man, part bull, part goat, part trees. The warthog is a mean aggressive character, so we got pointy with him. And, he’s a lot more distorted. We also use scale cues, such as a Chiquita banana sticker or Pepsi bottle cap.”

“The Griffin has hair plus feathers and was rendered at 8k [images 8k pixels wide] to get detail”, says ILM Animation Supervisor Tim Harrington. To achieve that level of detail meant 25- to 30-hour renders.

Spiderwick took 215 artists and 15 months”, says ILM Visual Effects Supervisor Tim Alexander. “It has 341 shots, 30 minutes, with 224 3-D shots.”

Industrial Light & Magic occupies the 865,000 square-foot Letterman Digital Arts Center on the 23-acre San Francisco Presidio campus. Its data network has more than 300 10GB ports and 1,500 1GB ports, with fibre to every artist’s desktop. There are 600 miles of cable throughout the four buildings on the campus. A 13,500 square-foot data center houses a Linux renderfarm with 3,000 AMD processors and more than 100TB of storage. Proprietary render management tools add Linux desktop workstations to the renderfarm pool after hours, expanding the processing capacity to more than 5,000 processors.

Tippett Studio: Hogsqueal, the Troll, Red Cap and His Army of Goblins and Bull Goblins

As Creature Supervisor for The Spiderwick Chronicles, visual effects pioneer Phil Tippett oversaw the design and development of the film’s fantasy characters. “Phil Tippett was on set with me every day”, says Director Mark Waters. “We were working on Charlotte’s Web when Mark Canton gave us the script”, says Tippett Studio Visual Effects Supervisor Joel Friesch. “When we saw the creatures, we had to do it. It’s based on real creatures, not fantasy. We wanted Hogsqueal. We created a bull goblin marquette [a detailed statuette] that gave Mark something he could hold. The bull goblin is based on toads. We brought in real toads and photographed them. We created movies good for the animators, showing how the eyes move and the throat. We created a test scene with a goblin scratching the back of his leg. That took one month of modeling and one month of animation.”

Linux Powers The Spiderwick Chronicles

Figure 1. Tippett Studio’s proprietary Creature Manager is used to maintain a library of creatures and animation cycles. The tool allows an artist to select and preview animation by pressing the larger creature button, then selecting a combination of an appropriate physical appearance for that creature from a predefined library and placing any number of selected creatures into a Maya scene.

Hand animation is a challenging laborious process. “One guy does blocking, like moving chess pieces”, says Tippett Studio Animation Supervisor Todd Labonte. “You get it approved. We watch it over and over. You can go blind. We play it back in mirror image in our player or play it backward.” Labonte demonstrates playing back a scene of goblins invading the house, shown in their Flipper playback software, which can display a mirror image or play in reverse to help catch animation inconsistencies. Flipper is used to view both QuickTime and image frame sequences of DPX, EXR or TIFF with synchronized AIF audio. Flipper predates commercial Linux flipbooks, such as FrameCycler. At older studios, like Tippett, it’s common to find proprietary Linux tools created before commercial options were available. Tippett has a team of eight Linux programmers to maintain and develop tools.

Linux Powers The Spiderwick Chronicles

Figure 2. Flipper is Tippett Studio’s proprietary flipbook image viewing tool. It allows an artist to view a series of individual image files as a continuous sequence. It also can be synchronized with audio, which is important for character animation. The artist can view the audio waveform to help with lip synchronization, as seen in the lower part of the screenshot. The tool also has a number of image and pixel comparison and analysis features, as seen in the dialog on the upper left. Post-camera moves can be previewed with Flipper before they are actually applied in the composite stage.

“Creature Picklist is a GUI-based Maya plugin for creatures that allows animators to see visual representations of character, which they can select for their scene”, says Darling. “In the case of Spiderwick, ‘Goblin kits’ were created as combinations of variants and blendshapes. We have shots that have more than 100 goblins. That’s too many to animate using traditional methods. The numbers are also too small to make a commercial crowd system, such as Massive, a viable solution. We developed our own system called Swarm. For the Spiderwick shots, we instanced around 150 goblins and managed animation clip data to animate them as particles.”

Linux Powers The Spiderwick Chronicles

Figure 3. Tippett Studio’s Picklist allows an animator to select creature variants from a library of different combinations of paint schemes and body parts.

Adobe To Port AIR To Linux

linux adobe

“Up until now, Adobe hasn’t done much in terms of porting its applications to Linux, as its only product to have recieved any kind of Linux implementation is Flash. This may be about to change because the company has announced a Linux port of AIR, its web application development software. No definite release date is mentioned in the interview with Adobe CTO Kevin Lynch, just a vague ‘later this year.’”

Find and Replace script for Linux

 screensaver

Shell Script to Recursively Search and Replace on Linux

Save the file in the directory you want to search and call it replace.

—->>>do not add this line

#!/bin/bash
# This script will search and replace all regular files for a string
# supplied by the user and replace it with another string.
#
#
function usage {
echo “”
echo “Search/replace script revised by dwhs.net and ezliuxadmin.com”
echo “”
echo “Not enough parameters provided.”
echo “Usage: ./$0 searchstring replacestring”
echo “Remember to escape any special characters in the searchstring or the replacestring”
echo “”
}

#check for required parameters
if  [ ${#1} -gt 0  ]  &&  [ ${#2} -gt 0  ];
then
for f in `find  -type f`;
do
if grep -q $1 $f;
then
cp $f $f.bak
echo “The string $1 will be replaced with $2 in $f”
sed s/$1/$2/g < $f.bak > $f
rm $f.bak
fi
done

else
#print usage informamtion
usage
fi

—->>>do not add this line

When you add the script make the permissions to 755

Then run the command string to set the variables.

./replace oldtext newtext

Linux Kernel Source Code Screensaver

 screensaver

On Ubuntu, here’s how you install the phosphor screensaver:

sudo apt-get install xscreensaver-data-extra

Next we need to make sure that the Linux source code is installed on our system. Chances are your kernel source code will be installed in the /usr/src directory. If it’s not installed there, check with whoever maintains your distribution of Linux to find out where they keep it. Here’s how to install the source package on Ubuntu:

cd /usr/src
sudo apt-get install linux-source
sudo tar -xpjf linux-source-2.6.22.tar.bz2
sudo ln -sf linux-source-2.6.22 linux-source

Now, we need to feed the source code into phosphor. It was quite simple to write a command to fetch the code: cat `find /usr/src/linux-source/ -name ‘*.c’` The problem was it was giving me the same code in exactly the same order every time. I needed a way to get the find command to give me the files in a completely random order so that the screensaver was different every time. After extensive research, I discovered that find does not have an option for this. I could not find any command line utility for doing this either. So, I wrote one myself. It’s really simple and I plan on expanding it in the future, but it works perfectly for this project. It’s called Argument Shuffle. Just follow the instructions on that page for installing it.

Now we’re ready to put it all together. Go into your screensaver preferences, and go into the phosphor setup. You can set up the speed, scale and fade settings however you like. The important part is the “text program” box. Here’s the command:

cat `find /usr/src/linux-source/ -name ‘*.c’ | argshuf`

Note the backquotes! That command will find all of the files in the Linux kernel source directory which end in .c, and it will then pick one of those files at random and dump its contents into phosphor. This command is pretty tweakable, if you want to mess around with it. If you want to display .c files and .h files, then change it to: cat `find /usr/src/linux-source/ -name ‘*.c’ -or -name ‘*.h’ | argshuf`. If you wanted to display only .c files that are bigger than 100k, change it to: cat `find /usr/src/linux-source/ -name ‘*.c’ -size +100k | argshuf`. You get the idea. Read more about find if you want to do something specific. Enjoy!

Here are a few screenshots: