Dedicated Server Support

Tips on Linux, FreeBSD, Windows Dedicated Server.

Saturday, February 25, 2006

K-Rate Installation

Today Installed K-Rate - Picture Rating Script on
 
 
K-Rate allows members to sign up, upload images and get them rated by other members or visitors. But that is not all. Members create their profiles by answering the signup questions about members personality, likes/dislikes, interests and hobbies which other members can view afterwards. Members can also express themselves by posting in their own blogs, exchange thoughts in forums, talk in chat rooms and contact each other privately using private messaging system.
 
You can find more details about the script at
 
 

Friday, February 24, 2006

Can't locate DBI.pm in @INC Perl Script Error

Today after FreeBSD server upgrade with portupgrade and freebsd-update, i started getting following error on a CGI script that use MySQL database.


Can't locate DBI.pm in @INC
(@INC contains: /usr/local/flashcp/
/usr/local/lib/perl5/5.8.8/BSDPAN
/usr/local/lib/perl5/site_perl/5.8.8/mach
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl/5.8.7
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.8/mach
/usr/local/lib/perl5/5.8.8 .)
at /home/free/cgi-bin/index.cgi line 8.
BEGIN failed--compilation aborted



This error is due to Perl module DBI is missing, to install it, i loged in to server and run cpan, cpanel allow you to install Perl modules.


server22# cpan
cpan> install DBI
Running install for module DBI
Running make for T/TI/TIMB/DBI-1.50.tar.gz
LWP not available
Fetching with Net::FTP:
DBI-1.50.tar.gz
CPAN: Digest::MD5 loaded ok
LWP not available
Fetching with Net::FTP:

FreeBSD: Registering installation in the package database
Appending installation info to /usr/local/lib/perl5/5.8.8/mach/perllocal.pod
/usr/bin/make install -- OK


cpan> exit
Terminal does not support GetHistory.
Lockfile removed.
server22#



after installation type "exit" to exit cpan shell. AFter installing DBI, i refreshed the CGI script, the error is gone, now i start getting different error


install_driver(mysql) failed:
Can't locate DBD/mysql.pm in @INC
(@INC contains: /usr/local/flashcp/
/usr/local/lib/perl5/5.8.8/BSDPAN
/usr/local/lib/perl5/site_perl/5.8.8/mach
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl/5.8.7
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.8/mach
/usr/local/lib/perl5/5.8.8 .) at (eval 8) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Proxy, Sponge.
at /home/free/cgi-bin/index.cgi line 16



To fix the problem, need to install DBD::mysql module, so back to cpan

install DBD::mysql did not worked, this is because it try to connect MySQL database for testing, but MySQL login with out password is disabled in the server. So we have to do force install


server22# cpan
Terminal does not support AddHistory.


cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support available (try 'install Bundle::CPAN')


cpan> force install DBD::mysql

/usr/bin/make install -- OK

cpan> exit
Terminal does not support GetHistory.
Lockfile removed.
server22#



After installing DBD::mysql the perl script start working.

Installing phpMyAdmin for multiple servers

Today i installed phpMyAdmin on
 
 
So that all clients hosted on different servers can use this to manage their MySQL Database.
 
Linux and FreeBSD servers have cpanel control panel which have its own phpMyAdmin installed. On Windows servers we have HELM control panel, which do not have a phpMyAdmin installed. So far clients install their own copy of phpMyAdmin as only few use MySQL on Windows server. Having a phpMyAdmin that allow connection to any server will allow anyone to manage MySQL anywhere on internet.
 
This is done with few simple change in config.inc.php file
 
OPEN
 
config.inc.php
 
FIND
 
$cfg['PmaAbsoluteUri'] = '';
 
REPLACE WITH
 
$cfg['PmaAbsoluteUri'] = 'http://phpmyadmin.hosthat.com/';
 
FIND
 
$cfg['blowfish_secret'] = '';
 
REPLACE WITH
 
$cfg['blowfish_secret'] = 'GoodBoy';
 
FIND
 
$cfg['Servers'][$i]['auth_type']     = 'config';
 
REPLACE WITH
 
$cfg['Servers'][$i]['auth_type']     = 'cookie';
 
FIND
 
$cfg['AllowArbitraryServer']    = FALSE;
 
REPLACE WITH
 
$cfg['AllowArbitraryServer']    = TRUE;
 
 
Thats all, now phpMyAdmin will allow you to connect to any server.

Thursday, February 23, 2006

Using portsnap to upgrade FreeBSD ports tree

I was running cvsup as cronjob daily to update FreeBSD ports tree.

Today i installed portsnap on FreeBSD 5.4 server.

portsnap is more efficient way of updating ports tree. portsnap is part of base system on FreeBSD 6.

With portsnap, you only update files that are changed. So you can update your ports tree much faster than with cvsup.

cd /usr/ports/sysutils/portsnap
make install clean
rehash

Will install portsnap.

First step is fetch port snapshot, this is done with command

# portsnap fetch

After fetching, you need to extract it if you are doing this first timr

# portsnap extract

After the initial installation, you don't have to extract, just update, so only changed files get overwritten.

# portsnap update

That is whenever you need to update ports, just run

# /usr/local/sbin/portsnap fetch
# /usr/local/sbin/portsnap update

To automate the port upgrading i created a shell script


/root/utils/portsup.sh


server14# cat /root/utils/portsup.sh
#!/bin/sh


/usr/local/sbin/portsnap fetch
/usr/local/sbin/portsnap update


server14#


chmod it 755, so that the script can be executed

server14# chmod 755 /root/utils/portsup.sh


and add it to cronjob

server14# crontab -l
0 3 * * * /root/utils/portsup.sh
server14#



That is portsnap will update ports tree everyday at 3 AM.

Newer version of portsnap support

# portsnap fetch update

server14# portsnap fetch
Fetching public key... done.
Fetching snapshot tag... done.
Fetching snapshot metadata... done.
Fetching snapshot generated at Thu Feb 23 03:09:19 UTC 2006:
f4b0454e7bce8a4decdb9190e22b8325a966e92005df5f100% of 39 MB 1079 kBps 00m00s
Extracting snapshot... done.
Verifying snapshot integrity... done.
Fetching snapshot tag... done.
Fetching snapshot metadata... done.
Updating from Thu Feb 23 03:09:19 UTC 2006 to Thu Feb 23 22:45:24 UTC 2006.
Fetching 4 metadata patches... done.
Applying metadata patches... done.
Fetching 0 metadata files... done.
Fetching 1542 patches.....10 ....1540. done.
Applying patches... done.
Fetching 0 new ports or files... done.
server14#

Deleting Mail Enable Bad Mail from Windows 2000 Server

On Windows Server, most of the log files, you have to delete it yourself.

On my windows server, i have to delete Mail Enable log files as they grow and take up GB's of web space.

Today on Windows 2000 server, i found not much space left even after deleting all Log files, so i checked Mail Enable Bad Mail Folder at

c:\program files\mail enable\bad mail\

This folder contains lot of files with extension .MAI and a folder "messages". Bad mails are mails that can't delivered by Mail Enable mail server due to invalid recipient email address. All these .MAI files are not actual email, its just info about actual emails, real emails are in messages folder. So you can delete all these files. To clean up Bad Mail, do to DOS mode as Windows Explorer will not respond if you have lot of files in the folder, infect the server i am doing this got 5 GB of files in bad mail folder.

cd \
cd "Program Files"
cd "Mail Enable"
cd "Bad Mail"
del *.mai
cd messages
del *.mai

You need to specify directory name within quoted if there is a space within the folder name. This is vaid for all version of DOS and Windows 2000. IF you are in Windows 2003, it can understand directory name with space.

In Windows 2003, you can simply do

cd \
cd program files\mail enable\bad mail\
del *.mai
cd messages
del *.mai


See screenshot of cleaning Bad Mail on Windows 2000. Click on Image to Enlarge.


Free Image Hosting by www.NetFreeHost.com

Wednesday, February 22, 2006

CPanel Server Shared IP and Default Page

In Cpanel server, if you access the main shared IP in browser, you will see default Cpanel Page.
 
If you change the main shared IP to a new one and host a web site with that IP, you will find the first web site you hosted on the shared IP when you visit the IP. For a shared web hosting this is not good as the IP host many web sites and if a client access his IP on browser, he will see another web site, its better to show default cpanel page that says "There is no website configured at this address."
 
To do this, you have to edit httpd.conf file.
 
# vi /usr/local/apache/conf/httpd.conf
 
In the find find first real (you will see first entry commented, find next entry) entry of
 
NameVirtualHost
 
This will look like
 
NameVirtualHost 69.72.153.17:80
 
<VirtualHost 69.72.153.17>
BytesLog domlogs/host.yourdomain.com-bytes_log
ServerName host.yourdomain.com
DocumentRoot /usr/local/apache/htdocs
</VirtualHost>
 
If you have two other shared IP and need to make them show cpanel default page, you have to do following
 
 
NameVirtualHost 22.77.28.99:80
 
<VirtualHost 22.77.28.99>
DocumentRoot /usr/local/apache/htdocs
</VirtualHost>
 
NameVirtualHost 22.77.28.100:80
 
<VirtualHost 22.77.28.100>
DocumentRoot /usr/local/apache/htdocs
</VirtualHost>

Now this will be the first virtual host, so when you access the site, it will show these virtual hosts, which points (DocumentRoot) to default cpanel page.

Installing FreeBSD 6 on Local Web Server

Today i am install FreeBSD 6 on local developement web server.
 
I was using FreeBSd 5.2 on local server. Today take backup of home directory and mysql data and installed FreeBSD 6. After installation home directory and MySQL restored. Now i have to install Apache, MySQL, etc...
 
FreeBSD 6 CD was brought from an ebay seller. For some reason, CD 2 is not working, so i have to install packages from internet.
 
I copied /usr/ports/distfiles from old FreeBSD installation to new FreeBSD 6 installation. This is the folder where packages downloaded from internet stored. I am able to install Apache21 from ports using the fine in /usr/ports/distfines folder. Other ports i tried to install like samba started downloading from internet as required files are not available in the folder.
 
Installing samba to share it with Windows failed to install, may be due to ports not updated. Now i am install cvsup-without-gui and going to update ports.

Monday, February 20, 2006

Free Web Hosting From Microsoft.com

After Yahoo, Google, now its time for Microsoft.com to offer Free Web Hosting.
Microsoft announced beta version of Free Web Hosting to Microsoft Office Live Basic users.


Easy-to-use Web site design tool


Get started fast with our easy-to-use Site Designer tool. Don't worry — it was designed with the small-business owner in mind, so you can quickly create your own Web site.

Free domain name and hosting

Select your own domain name (for example, www.northwindtraders.com) and let Microsoft keep your Web site up and running.

5 personalized e-mail accounts

Access your company e-mail using your personalized domain name (for example, jsmith@northwindtraders.com).

Storage and data transfer

More than enough space to promote every aspect of your business and plenty of bandwidth to allow lots of customers to visit your site.

Web site traffic analysis and reporting tools

View the success of your Web site with reporting that lets you see how often people visit your site, what pages they visit the most, and their system and browser information.

Support

Our online support pages are here to answer questions and help you get started by providing quick responses to your most frequent questions. One-on-one e-mail support is also available to address other questions.

Sunday, February 19, 2006

Installing newsgroup server - INN

I have subscribed to few newsgroups and reading them with Outlook express. I was using Free News server provided by Aioe.org for reading news. For last several days, it stoped working. There is no message at all.
 
I made a search on google and in newsgroup alt.free.newsservers for Free NNTP servers. I can't find any free public server, most of the links are for paid service.
 
So i tried to install one myself, so i can use it with out paying. Some of the servers have lot of free space, so installing a NNTP server may not take much space.
 
I found INN, by ISC
 
 
This is available in FreeBSD ports. So i installed it with
 
# cd /usr/ports/news/inn-stable
# make
# make install
# make clean
 
Now the INN is installed on the server, it say
 
 
===> SECURITY REPORT:
      This port has installed the following binaries which execute with
      increased privileges.
/usr/local/news/bin/startinnfeed
/usr/local/news/bin/auth/passwd/ckpasswd
/usr/local/news/bin/inndstart
 
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/news/bin/auth/passwd/radius
/usr/local/news/bin/innd
/usr/local/news/bin/nnrpd
 
      This port has installed the following startup scripts which may cause
      these network services to be started at boot time.
/usr/local/etc/rc.d/innd.sh
 
      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.
 
      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.isc.org/products/INN/
 
What is ramining is configuring INN and get it working. Need to find more information before doing this, untill then i disabled INN from starting with
 
mv /usr/local/etc/rc.d/innd.sh /root
 
Check back later to see if i get INN working on my server, may be i will start a Free Newsgroup server or a deejanews clone if it won't use up lot of system resources and newsgroup spam problems :-)

SYN_RECV DDoS attack on CentOS Server

Last few days a server is getting too many SYN_RECV attacks.
 
I tried to stop it with APF antidos and mod_evasive.
 
It stoped the attack. But today it started again, may be with more strength, there was more than 1500 SYN_REC requests, Apache stoped working.
 
Today i banned few attacker IP's with APF firewall.
 
netstat will show the number of connections each IP's have. Ban IP's with too many SYN_REC will help if attack is not spoofed.
 
# netstat -n -p | grep SYN_REC | awk '{print $5}' | awk -F: '{print $1}'
 
To block an IP with APF Firewall, use
 
# apf -d IPADDRESS
 
 

GUI-less Windows Server

Microsoft is going to introduce new version of GUI Less Windows for Web Servers. This will save memory and cpu time used by GUI, that never get used in a web server. Many love Linux servers as it is easy to manage services through command line. Windows servers are already as stable as Linux servers, with introduction of GUI-Less Windows for web servers will increase market share of Microsoft Windows on Web.

"We are making the server ‘compose-able’ at three different levels in Windows Server 'Longhorn,'" wrote Mark Aggar, senior product planner for Windows Server".

Source: Microsoft Windows Server Bog

Saturday, February 18, 2006

Chating with Gmail

Gmail is popular email service provided by www.google.com
 
Recently Gmail.com added chat feature to Gmail. That is you can chat with any one with a Gmail account instantly with out any additional software like Yahoo Messenger or MSN Messenger. Its great cool feature. I am sure this will be going to a hit very soon.
 
When you are loged in to Gmail account, your status is set to online. Anyone can contact you easily. Its great as no software need to be installed, just login to gmail with any browser. I have tested with with Internet Explorer and FireFox, both worked fine.
 
Chat with Gmail is a good reson for sending gmail invites to your friends. Gmail also allow you to send email from your own domain name. So just forward all emails to Gmail and use it for sending emails. Gmail have very good spam filtering. I only get few spam mails in my gmail account compared to Yahoo Mail.

Plesk Server open_basedir Restriction Error

On a Plesk server, when client run a PHP script that need pear, got following error
 
Warning: main(): open_basedir restriction in effect.
File(/usr/share/ pear/DB.php) is not within the allowed path(s):
(/var/www/vhosts/ gstacks.com/httpdocs:/tmp) in
/var/www/vhosts/ gstacks.com/httpdocs/ cpadmin/db_connect.php on line 9
 
The problem is open_basedir value do not allow accessing pear. open_basedir is used to secure the server, limit each sites within the sites folder. If this is disabled, a PHP script running in one site can access files in other site.
 
Since this was a dedicated server, only host the clients own sites, its ok to disable open_basedir.
 
In Plesk server, Apache configuration for each site are stored in its own file and included in httpd.conf. In Cpanel server, all sites virtual host information is stored in file httpd.conf itself. Recently i have found on a cpanel server, a new folder "sites" in /usr/local/apache/conf folder, which have configuration of each web sites, it seems Cpanel is also going in this direction. This will help when deleting a web site, creating a web site, the program don't have to perate in big httpd.conf file.
 
In Plesk each web sites configuration is stored in
 
/var/www/vhosts/domain.extn/conf/httpd.include
 
File. To remove open_basedir restriction, i edited the file and commented out the line for open_basedir.
 
 
<IfModule sapi_apache2.c>
php_admin_flag engine on
# php_admin_value open_basedir "/var/www/vhosts/ stacks.com/httpdocs:/tmp"
</IfModule>
 
Now restart Apache with
 
service httpd restart
 
After restart, the site will work fine.

Thursday, February 16, 2006

Creating Favicon with PhotoShop

Photoshop by default do not allow saving files with .ico extension.
 
With "ICO (Windows Icon) Format" plug in, you will be able to save images with .ico extension.
 
You can download the plugin from
 
 
After downloading, unzip it, copy the file ICOFormat.8bi to folder
 
C:\Program Files\Adobe\Adobe Photoshop CS2\Plug-Ins\File Formats
 
Now close photoshop if its already open. Start photoshop, now you will see .ico format in save as menu.
 
To create favicon, you need to create an image of size 16 * 16 pixel. Then save it in .ico format.
 

Bind init script in FreeBSD Cpanel Server

On FreeBSD 5.4 Cpanel Server, i found the BIND init scripts are not working properly.

There was two init scripts at

/etc/init.d/named
/usr/local/etc/rc.d/020named.sh

Both the scripts are not able to start or stop bind. Both have same content, it seems these scripts are for Cpanel Linux servers, but copied to FreeBSD servers.

I can stop bind with command

# rndc stop

But rndc start do not work.

I can restart named with cpanel script available at

# /scripts/restartsrv_named

Its working fine.

At last found

/etc/rc.d/named

working properly.

server20# /etc/rc.d/named
Usage: /etc/rc.d/named [fastforceone](start stop restart rcvar reload status poll)
server20#

# /etc/rc.d/named stop
# /etc/rc.d/named start

I have removed the two init scripts that are not working properly


server20# mkdir /root/backup
server20# mv /etc/init.d/named /root/backup
server20# mv /usr/local/etc/rc.d/020named.sh /root/backup

Tuesday, February 14, 2006

Gossamer Threads Adds ScriptInstallation.in as Script Installation Provider

Gossamer Threads provides various useful CGI scripts written in Perl. Some of the popular products are
 
Gossamer Links
 
This is a search engine friendly Link directory. Gossamer Links is the perfect software solution to manage any type of directory. While designed to manage links, Gossamer Links is ideal for a wide range of tasks such as Image Galleries, Press Releases, Yellowpages, Company Directories, or any other categorized database.
 
Gossamer Mail
 
If you've seen Hotmail™ or Yahoo!Mail™, then you already know what Gossamer Mail is all about. It includes all the features you'd expect to find in a quality web based email system like:
  • user customizable folders
  • full MIME support for sending/receiving of attachments
  • global and user-based email filters
  • address book and nickname support
  • supports sending/viewing of html mail
  • advertisements can be added to all outgoing mail
 
There are many more usefull scripts available, check
 
 
 
www.ScriptInstallation.In is listed as Installation Provider at
 
 
 

Bacula - Network Remove Backup

Bacula is a set of computer programs that permit you (or the system administrator) to manage backup, recovery, and verification of computer data across a network of computers of different kinds.

Bacula is relatively easy to use and efficient, while offering many advanced storage management features that make it easy to find and recover lost or damaged files.

Most of the Bacula source code has been released under a slightly modified version of the GPL version 2 license.

Bacula works on both windows, linux and FreeBSD, find more at

http://sourceforge.net/projects/bacula

Monday, February 13, 2006

Affiliate Link Masker

Affiliate Link Masker is a windows based software that can protect your affiliate links. A great way to stops you from losing your hard earned affiliate commission. No HTML coding! Just click 'Generate Code' and Instant affiliate link masker does the rest for you. Instant affiliate link masker puts more money in your bank account and NOT somebody elses!

Affiliate Link Masker Makes sure you get credit for your affiliate referrals. Quickly create your masked affiliate link in less than 5 minutes. No coding involved, Instant Affiliate Link Masker automatically creates your affiliate web page for you.

Affiliate Link Masker is easy to use, just download, unzip and run!

For more details, visit

http://affiliatelinkmasker.bizhat.com/


Get it for Only $6 Now !!

Cpanel Error - Can't locate DBD/mysql.pm

On restoring a site on new cpanel server, got following error

Error while connecting to MySQL. Failover enacted. install_driver(mysql) failed: Can’t locate DBD/mysql.pm in @INC(@INC contains: /usr/lib/perl5/ 5.8.7/ i686-linux/usr/lib/perl5/ 5.8.7 /usr/lib/perl5/ site_perl/ 5.8.7/i686-linux /usr/lib/perl5/ site_perl/5.8.7 / usr/lib/perl5/site_perl/ 5.8.5 /usr/lib/perl5/site_perl/ 5.8.4/usr/lib/perl5/site_perl/ 5.8.3 /usr/lib/perl5 /site_perl/5.8.2 /usr/lib/perl5/ site_perl/5.8.1 /usr/lib/perl5/ site_perl/5.8.0 /usr/lib/perl5/ site_perl ./scripts /scripts /scripts /scripts /scripts/scripts /scripts /scripts) at (eval 32) line 3.Perhaps the DBD::mysql perl module hasn’tbeen fully installed,

The problem is due to Perl module DBD::mysql mising.

This can be downloaded from cpan.org

To install it, unzip it, then cd to the source folder, then run

# perl MakeFile.pl
# make
# make install

Or you can do it with cpan command

# perl -MCPAN -e shell
cpan> install Bundle::DBD::mysql
cpan> install Bundle::DBI

cpan> exit
#

Or with

# perl -MCPAN -e 'force install DBD::mysql'

Recent version of new cpanel server have many Perl related errors, this can be fixed by reinstalling perl from Cpanel site. Installation is easy, just download perl from

http://layer2.cpanel.net/perl587installer.tar.gz

Then unzip it

# tar -zxvf perl587installer.tar.gz

Change to the folder and follow the instructions in INSTALL file.

Sunday, February 12, 2006

Cleaning MailEnable Mail Que

 
MailEnable is one of the popular Email Servers for Windows. This is widely used with Windows Server as HELM control panel support it and MailEnable Standard is Free.
 
MailEnable Standard do not come with a Web Mail program. You have to use some Free POP3 Email Reading script for webmail. Many use UebiMiau! Mail available at
 
 
Also MailEnable Standard do not allow email virus filtering. MailEnable professional cost $199, allow integration of many popular Antivirus softwares and have built in WebMail.
 
Running a shared Windows Hosting server, some times, users will SPAM the server or they get too many SPAM or bounced emails and you may need to clear email Que. If its too big, you can't do it with MailEnable interface or through Windows Explorer (Explorer hangs as too many files in the folder), so only solution will be Command Prompt.
 
I have written a simple batch file to delete mails in Que. To use it, just create a fine with name "del_mail_q.cmd" and paste following content. Double click the file to clean MailEnable Mail Que.
 
 
net stop mesmtpcs
del "c:\Program Files\Mail Enable\Queues\SMTP\Outgoing\*.mai"
del "c:\Program Files\Mail Enable\Queues\SMTP\Outgoing\messages\*.mai"
net start mesmtpcs
 
 

Few SEO Tips

 
Meta Tag

When you make a web page, always include Meta Tags - keywords and description.

Give a Link to Google

Link other web sites, search engines like a link back. So give a link back, also search engines will love you link to quality web sites. Putting link to sites like google.com, yahoo.com, msn.com will help.

KeyWords in H1

Include keywords in <h1> Tag. Serach engine will give special weight for words in <h1> tag.

www.seo-rank.com

 

kernel upgrading with up2date on RHEL Cpanel server

By default Cpanel servers do not allow kernel upgrading with up2date. This is to avoid important software like kernel get updated with out your knowledge.

up2date have pkgSkipList option which allow you to specify which packages do not update. On Cpanel servers, you will find pkgSkipList have following packages listed

kernel*; courier*; mysql*; spamassassin*; httpd*; perl; mysql*; php*; mod_ssl*;

Other than kernel, other softwares in the list are provided by cpanel, so installing OS provided version of these software will break Cpanel Server.

You need to upgrade kernel at times to keep your server secure. To do this, you need to remove kernel* from pkgSkipList

This can be done with command up2date --configure and on the prompt, you have to enter number corresponding to pkgSkipList to edit it values. Take a copy of existing values and enter new value, with out kernel*, to save just hit enter key. You will be back in command prompt.

# up2date --configure
0. debug No
1. useRhn Yes
2. rhnuuid 16742c3c-9744-11da-8231-00123f7395f8
3. isatty Yes
4. showAvailablePacka No
5. useNoSSLForPackage No
6. storageDir /var/spool/up2date
7. pkgSkipList ['courier*', 'mysql*', 'spamassassin*', 'httpd*', 'perl',
8. retrieveOnly No
9. noSSLServerURL http://rhn.ev1servers.net/XMLRPC
10. networkSetup Yes
11. networkRetries 5
12. pkgsToInstallNotUp ['kernel', 'kernel-modules', 'kernel-devel']
13. enableProxy No
14. noBootLoader No
15. proxyPassword
16. updateUp2date Yes
17. keepAfterInstall No
18. useGPG Yes
19. headerCacheSize 40
20. forceInstall No
21. systemIdPath /etc/sysconfig/rhn/systemid
22. retrieveSource No
23. enableRollbacks No
24. gpgKeyRing /etc/sysconfig/rhn/up2date-keyring.gpg
25. adminAddress ['root@localhost']
26. serverURL https://rhn.ev1servers.net/XMLRPC
27. fileSkipList []
28. versionOverride
29. sslCACert /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
30. noReplaceConfig Yes
31. enableProxyAuth No
32. disallowConfChange ['noReboot', 'sslCACert', 'useNoSSLForPackages', 'noSSLSe
33. headerFetchCount 10
34. proxyUser
35. removeSkipList ['kernel*']
36. httpProxy
37. noReboot No


Enter number of item to edit : 7

Attribute: pkgSkipList
Comment: A list of package names, optionally including wildcards, to skip
Current value: kernel*; courier*; mysql*; spamassassin*; httpd*; perl; mysql*; php*; mod_ssl*;
<>
New Value: courier*; mysql*; spamassassin*; httpd*; perl; mysql*; php*; mod_ssl*;


Now you can upgrade kernel with

up2date -u

# up2date -u

Fetching Obsoletes list for channel: rhel-x86_64-es-4...

Fetching Obsoletes list for channel: rhel-x86_64-es-4-extras...

Fetching rpm headers...
#################


Name Version Rel
-------------------

kernel 2.6.9 22.0.2.EL x86_64
kernel-smp 2.6.9 22.0.2.EL x86_64


Testing package set / solving RPM inter-dependencies...
###########
kernel-2.6.9-22.0.2.EL.x86_ ##########Done.
kernel-smp-2.6.9-22.0.2.EL. ########## Done.
Preparing ############ [100%]

Installing...
1:kernel-smp ########## [100%]
2:kernel #############[100%]
#


After doing this, you should verify /etc/grub.conf updated properly

# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda5
# initrd /initrd-version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux ES (2.6.9-22.0.2.EL)
root (hd0,0)
kernel /vmlinuz-2.6.9-22.0.2.EL ro root=/dev/sda5
initrd /initrd-2.6.9-22.0.2.EL.img
title Red Hat Enterprise Linux ES (2.6.9-22.0.2.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.6.9-22.0.2.ELsmp ro root=/dev/sda5
initrd /initrd-2.6.9-22.0.2.ELsmp.img
title Red Hat Enterprise Linux ES (2.6.9-22.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.6.9-22.ELsmp ro root=LABEL=/1
initrd /initrd-2.6.9-22.ELsmp.img
title Red Hat Enterprise Linux ES-up (2.6.9-22.EL)
root (hd0,0)
kernel /vmlinuz-2.6.9-22.EL ro root=LABEL=/1
initrd /initrd-2.6.9-22.EL.img
#


The default=1, will boot the second entry in the grub. First entry is 0. When u upgrade kernel, it will be added to top of grub.conf, in this upgrade, you will see two entry, first is normal kernel (position 0) and second is SMP kernel (position 1), we use default=1 as this is Intel(R) Pentium(R) 4 CPU 3.00GHz CPU and is HT, so two virtual CPU's.

Saturday, February 11, 2006

Free Antivirus for Windows 2003 server

There are few Free Antivirus software available for Windows, most are for Windows Home Users Only. Since Windows 2003 is server OS, most of these free Antivirus software do not run on Windows 2003. I use Windows 2003 on my desktop, i like it much better than Windows 2000 Pro. I don't like Windows XP bacuse of its colors, i have installed it two times, but uninstalled it, found i can make it look like Windows 2003 by select classic theme, but i like using Windows 2003 on desktop.

ClamAV is a Free Antivirus software available for Linux and FreeBSD. Most of the Cpanel servers have this default as it can easily installed through Cpanel Addons.

Good news for Windows 2003 users is ClamAV is now ported to Windows, its free to use.

http://www.clamwin.com/

I may wait some more time to get it more stable, by this time, mail servers will add support for this Free Antivirus.

Installing mod_security in Plesk server

Today i installed mod_security on a Plesk server, it is easy in cpanel box, but in Plesk, found there is no apxs in path. So i have run a find

[root@plesk tmp]# find / -name apxs
/usr/local/psa/admin/bin/apxs
[root@plesk tmp]#

But this apxs is of Apache used by Plesk. Plesk runs its own Apache as it run as privelaged user.

apxs is not installed for Apache used by websites hosted on plesk server. This can be installed by installing httpd-devel package. So installed it with up2date

[root@plesk httpd]# up2date -i httpd-devel
Fetching Obsoletes list for channel: rhel-i386-es-3...
Fetching Obsoletes list for channel: rhel-i386-es-3-extras...
Fetching Obsoletes list for channel: rhel-i386-es-3-devsuite...
Fetching rpm headers...############

Name Version Rel---------------
----httpd-devel 2.0.46 56.ent i386
Testing package set / solving RPM inter-dependencies...

########################################
httpd-devel-2.0.46-56.ent.i
##########################
Done.Preparing
#############################
############## [100%]
Installing... 1:httpd-devel #######

##################################
## [100%]
[root@plesk httpd]#

After doing this, mod_security got installed as usual.

This was Apache 2 server. So

# cd

Now download latest version of mod_security from

http://www.modsecurity.org/

# tar -zxvf modsecurity-apache-1.9.2.tar.gz
# cd modsecurity-apache-1.9.2
# cd apache2
# apxs -cia mod_security.c

Now added mod_security rule to httpd.conf

Restarted apache and mod_security installation is finished.

root can't change file permission

On RHEL 3 Plesk server, i tried to edit file

/root/.bashrc

But i can't edit it. vi editor says, file is ready only and use w! to write, but that also not worked. So i exited vi, tried changing permission of the file.


# whoami
root
# ls -l .bashrc
-rw-r--r-- 1 root root 176 Aug 23 1995
.bashrc
# chmod 744 .bashrc
chmod: changing permissions of `.bashrc':
Operation not permitted
#

On chmod, i get Operation not permitted error.

So i checked extended file permission with

# lsattr /root/.bashrc

It is found the file with i (IMMUTABLE) bit set.

# lsattr /root/.bashrc
----i-------- /root/.bashrc
#

This is removed by the command

# chattr -i /root/.bashrc

Now the file is editable.

Thursday, February 09, 2006

Upgrading MySQL 4 to 4.1 in FreeBSD Cpanel Server.

Today i upgraded MySQL to version 4.1 on FreeBSD Cpanel server (server28.hosthat.com)

With this version MySQL have some changes in the way it store user password. They doubled password storage space. To Upgrade MySQL on Cpanel Server, login to WHM as root.

Main >> Server Configuration >> Tweak Settings

Select MySQL 4.1 in the page.

After doing this, you have to upgrade MySQL through SSH, this can be done with command

/scripts/mysqlup

After doing this, lets upgrade Perl DBD::mysql module to work with new MySQL version. This can be done with

/scripts/perlinstaller --force Bundle::DBD::mysql

Now upgrade Apache with

/scripts/easyapache


MySQL Not Working After Upgrade

After the upgrade is over, i checked mysql is working with mysql command on command prompt. I got error, so check the MySQL start up script at

/usr/local/etc/rc.d/mysql-server.sh

On checking this file, it says i need to add following line to /etc/rc.conf

mysql_enable="YES"

I have added this line and restarted the server. Server reboot is needed as mysql_enable="YES" in /etc/rc.conf is used to set a variable, this is only set on boot time.

After reboot, MySQL start working fine.

In FreeBSD MySQL can be start with the init script

/usr/local/etc/rc.d/mysql-server.sh stop
/usr/local/etc/rc.d/mysql-server.sh start

Wednesday, February 08, 2006

Softbiz Ad Management PLUS script installation

Today i have installed Softbiz Ad Management PLUS on site.

http://www.stickpointer.com

The script written in PHP with MySQL database. Setting up is really easy, create a MySQL database, import data from db/SoftbizAdManagementPLUSScript.sql file, then edit two configuration files and put MySQL database details.

This script allow your visitors to signup and buy banner or text advertisement on your web site or network. It allow Impression based or PPC (Pay Per Click - like Google AdSense, but no content targeting).

If you just need banner management, no customer signup and payment solution, phpAdsNew will work great. I am currently using phpAdsNew.

My Second eBay Auction

Today i created eBay sales page for Script Installation Service.

First eBay auction was very simple text, with second ebay auction, i have more improved auction content and better layout. I have started with MS Word, then copied it to MS Front Page, i like Hand Coding for creating HTML pages, but for a quick Page, MS Front Page is ok.

Click here to check my second eBay Listing for script installation service.

Starting price for script installation service auction is $0.99, many auction start at $0.99 and goes high as more biders are interested in the service or product. I found an auction, that sells lot of web site content (targeted for AdSense website), starting price was $.99, so i bid at $2, and i am the top bidder now, auction will end after 7 hour. Have to wait and see if i will Win this.

ScriptInstallation.in is still under construction, sibi and geoji is working on new site design. Today created 2 pages, project is moving very slow.

Tuesday, February 07, 2006

bind init scripts on FreeBSD 5.4 Cpanel server

In FreeBSD 5.4 Cpanel server, i found none of the init scripts can start or stop bind. In the server, there is two named startup scripts

/etc/init.d/named
/usr/local/etc/rc.d/020named.sh

Both have same code, allow start and stop, no status like in Linux cpanel server.

Bind is working fine, so i tried to stop it with

/etc/init.d/named stop
/usr/local/etc/rc.d/020named.sh stop

Both can't stop bind. So i stoped it with command

# rndc stop

Named is stoped. I try to start named with

/etc/init.d/named start
/usr/local/etc/rc.d/020named.sh start

Both scripts can't start named. At last i start named with

/scripts/restartsrv_named

Restarting named through WHM is also working. But none of the init scripts are working.

Upgrade Linux Kernel

Today is last day for server - server2.hosthat.com

This is first Linux dedicated server i have taken, initially it was RedHat 7.3, later after a hacking, OS reinstalled to RedHat 9. As i am canceling the server, tried upgrading it to CentOS.

Rebuild rpm database

rpm -vv --rebuilddb

Install yum

rpm -ivh yum-2.0.3-0.fdr.1.rh90.noarch.rpm


Create /etc/yum.conf with following content


[main]
exclude=mod_ssl* httpd* perl mysql* php* #add this line for cpanel servers
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

[base]
name=CentOS-4.2 - Base
baseurl=http://beta.centos.org/centos/4.2/os/$basearch/
gpgcheck=1

#released updates
[update]
name=CentOS-4.2 - Updates
baseurl=http://beta.centos.org/centos/4.2/updates/$basearch/
gpgcheck=1

#packages used/produced in the build but not released
[addons]
name=CentOS-4.2 - Addons
baseurl=http://beta.centos.org/centos/4.2/addons/$basearch/
gpgcheck=1

#additional packages that may be useful
[extras]
name=CentOS-4.2 - Extras
baseurl=http://beta.centos.org/centos/4.2/extras/$basearch/
gpgcheck=1

#centosplus repo - updated packages that extend beyond rhel release versions
#run auto update with this repo enabled only if you know you want extended functonality
#[centosplus]
#name=CentOS-4.2 - CentOSplus
#baseurl=http://beta.centos.org/centos/4.2/centosplus/$basearch/
#gpgcheck=1

#packages in testing
#[testing]
#name=CentOS-4.2 - Testing
#baseurl=http://beta.centos.org/centos/4.2/testing/$basearch/
#gpgcheck=1


Now run

yum upgrade

yum update


And Upgrade Kernel

root@server2 [/etc]# yum upgrade kernel
Gathering header information file(s) from server(s)
Server: CentOS-3.4 - Addons
Server: CentOS-3.4 - Base
Server: CentOS-3.4 - Extras
Server: CentOS-3.4 - Updates
Finding updated packages
Downloading needed headers
Finding obsoleted packages
Resolving dependencies
Dependencies resolved
I will do the following:
[install: kernel 2.4.21-37.0.1.EL.i686]
Is this ok [y/N]: y
Getting kernel-2.4.21-37.0.1.EL.i686.rpm
Calculating available disk space - this could take a bit
kernel 100 % done 1/1
stdin: is not a tty
stdin: is not a tty
stdin: is not a tty
Kernel Updated/Installed, checking for bootloader
Lilo found - adding kernel to lilo and making it the default
Installed: kernel 2.4.21-37.0.1.EL.i686
Transaction(s) Complete
root@server2 [/etc]#