WHM Tutorials


Hello,
PHP and Apache are not being able to track which users are sending out mail through the PHP mail function from the nobody user causing leaks in formmail scripts and malicious users to spam from your server without you knowing who or where.

Monitiring exim_mainlog doesn’t exactly help, you see th email going out but you can’t track from which user or script is sending it. This is a quick and dirty way to get around the nobody spam problem on your Linux server.

If you check out your PHP.ini file you’ll notice that your mail program is set to: /usr/sbin/sendmail and 99.99% of PHP scripts will just use the built in mail(); function for PHP - so everything will go through /usr/sbin/sendmail
Requirements:

We assume you’re using Apache 1.3x, PHP 4.3x and Exim. This may work on other systems but we’re only tested it on a
Cpanel/WHM Red Hat Enterprise system.

Step 1:

Login to your server with root.

Step 2:
Turn off exim before proceeding
service exim stop

Step 3:
Take the Backup of  your original /usr/sbin/sendmail file

mv /usr/sbin/sendmail /usr/sbin/sendmail_bak

Step 4:

You need to  Create the spam monitoring script for the new sendmail.
pico /usr/sbin/sendmail

Paste in the following:

#!/usr/local/bin/perl

# use strict;
use Env;
my $date = `date`;
chomp $date;
open (INFO, “>>/var/log/spam_log”) || die “Failed to open file ::$!”;
my $uid = $>;
my @info = getpwuid($uid);
if($REMOTE_ADDR) {
print INFO “$date - $REMOTE_ADDR ran $SCRIPT_NAME at $SERVER_NAME n”;
}
else {

print INFO “$date - $PWD -  @infon”;

}
my $mailprog = ‘/usr/sbin/sendmail.hidden’;
foreach  (@ARGV) {
$arg=”$arg” . ” $_”;
}

open (MAIL,”|$mailprog $arg”) || die “cannot open $mailprog: $!n”;
while (<STDIN> ) {
print MAIL;
}
close (INFO);
close (MAIL);

save and close

Step 5:
Now change the new sendmail permissions
chmod a+x /usr/sbin/sendmail

Step 6:

Create a new log file to keep a history of all mail going out of the server using web scripts
touch /var/log/spam_log

chmod 0777 /var/log/spam_log

Step 7:
Start Exim up again.
/etc/init.d/exim start

Step 8:
You can Monitor your spam_log file for spam, try using any formmail or script that uses a mail function - a message board, a contact script.
tail - f /var/log/spam_log

Reference taken from : webhostgear.com

Hello,

ImageMagick is a software used  to create, edit, and compose bitmap images. Using ImageMagick we can read, convert and write images in a variety of formats including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. ImageMagick is used to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.

ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand (C)

How to install ImageMagick On Linux server:

wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz

tar -zxvf ImageMagick*.tar.gz
cd ImageMagick*

./configure

make

make install

You can verify the installation with command :

which convert

Regards,

Tuks

Hello,

To get the apache version on linux server we have to use following command.

# /usr/local/apache/bin/httpd -v

To get the php version on linux server we have to use following command.

#php -v

you can get the php modules install on server with command #php -m
To get the mysql version on linux server we have to use following command.

#mysql -v

How to install and configure the CSF (configserver) firewall.

CSF can be used on a wide range of Linux systems, including those running cPanel. Following are the steps to install and configure the CSF.

Installation is quite straightforward:

rm -fv csf.tgz

wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

If you would like to disable APF+BFD (which you will need to do if you have
them installed otherwise they will conflict horribly):

sh disable_apf_bfd.sh

That’s it. You can then configure csf and lfd in WHM, or edit the files
directly in /etc/csf/*

csf is preconfigured to work on a cPanel server with all the standard cPanel
ports open. It also auto-configures your SSH port if it’s non-standard on
installation.

To configure CSF modify the config files in /etc/csf/ - or if you are running WHM you can modify the CSF settings in WHM itself.

You should ensure that kernel logging daemon (klogd) is enabled. Typically, VPS
servers have this disabled and you should check /etc/init.d/syslog and make
sure that any klogd lines are not commented out. If you change the file,
remember to restart syslog.

See the readme.txt file for more information.

Uninstallation
==============
Removing csf and lfd is even more simple:

cd /etc/csf
sh uninstall.sh

How do I change my Name Servers?

1) First login to your account.

2)  Go to ‘My Domains’.

3) Select your domain and scroll down to ‘Name Servers’.
Here you can add or delete your name servers.

4) Press ‘Save Settings’ to save the changes.

Note: Please keep in mind that all Nameserver changes my take up to 48 hours to take effect.

Scripts that can be installed by Fantastico De Luxe:

The following scripts can be auto-installed using Fantastico De Luxe. Installation procedure takes seconds and can be performed by novices without the need for setting up MySQL databases, downloading files, changing file permissions or other tasks usually associated with advanced installations:
Look for this icon Fantastico De Luxe Auto-Installer in the cPanel interface to enter the Fantastico De Luxe section.

Blogs:
b2evolution (0.9.2)
Nucleus (3.23)
pMachine Free (2.3)
WordPress (2.0.4)

Portals/CMS:
Drupal (4.7.4)
Geeklog (1.4.0sr5-1)
Joomla! (1.0.11)
Mambo Open Source (4.6.1)
PHP-Nuke (7.8)
phpWCMS (1.1-RC4 Rev. A)
phpWebSite (0.10.2)
Post-Nuke (0.762) (visit site)
Siteframe (3.2.2)
Typo3 (4.0.2)
Xoops (2.0.15)

Customer Support:
Crafty Syntax Live Help (2.12.9)
Help Center Live (2.1.2)
osTicket (1.3.1)
PHP Support Tickets (1.9)
Support Logic Helpdesk (1.2)
Support Services Manager (1.0b)

Discussion Boards:
phpBB2 (2.0.21)
SMF (1.0.8)

E-Commerce:
CubeCart (3.0.13)
OS Commerce (2.2 MS2 (051113))
Zen Cart (1.3.5)

FAQ:
FAQMasterFlex (1.1)

Guestbooks:
ViPER Guestbook (X1.1)

Hosting Billing:
AccountLab Plus (2.7 r4) (Commercial, needs license)
phpCOIN (1.2.4)

Image Galleries:
4images Gallery (1.7.3)
Coppermine Photo Gallery (1.4.9)
Gallery (2.1.2)

Mailing List:
PHPlist (2.10.2)

Polls and Surveys:
Advanced Poll (2.03)
phpESP (1.7.5)
PHPSurveyor (1.0)

Project Management:
PHProjekt (5.1)
dotProject (2.0.4)

Site Builders:
Soholaunch Pro Edition (4.9 r14) (Commercial, needs license)
Templates Express

Wiki:
PhpWiki (1.2.10)
TikiWiki (1.9.4)

Other Scripts:
Dew-NewPHPLinks (2.0.1.0b SEF w/Thumbshots)
Moodle (1.6.3)
Noah’s Classifieds (1.3)
Open-Realty (2.3.4)
phpAdsNew (2.0.8)
PHPauction (2.1)
phpFormGenerator (2.09c)
WebCalendar (1.0.4)

cPanel:

cPanel (control panel) is a graphical website management tool. The software, which is proprietary, runs on most widely used Linux distributions, and FreeBSD. It is designed for use by commercial web hosting services, so the company does not offer a reduced-cost personal use license. cPanel gives you more control to access and manage your web site. You have the ability to manage all aspects of e-mail, files, FTP, CGI scripts, and web site statistics. The cPanel software is distributed by Darkorb Communications Inc., doing business as cPanel Inc.

WHM (Web Host Manager):

WHM is a graphical tool used to manage all of the websites hosted in a web server. It is a web-based tool used by server administrators and resellers to manage hosting accounts on a web server. It is usually used in conjunction with cPanel, a tool used by clients to manage their account. WHM listens to port 2086 by default. The most common WHM is cPanel.

Fantastico:

Fantastico is an amazing cPanel/PHP based Web application. cPanel Fantastico is the leading autoinstaller for cPanel Dedicated Servers. It integrates with your cPanel Dedicated Servers
and gives you and your web-hosting customers the ability to install multiple instances (*) of any of these scripts:
- in add-on domains and in sub domains
- in top level directories (root of main domain and/or any add-on domain/sub domain)
- translate the English language file and give your clients auto-installation in their own language
- create Features Sets so different users have different set of available scripts
- get notifications when users install/remove applications
- have a complete overview over the installations performed by your users
- Display a warning when logged in using root or reseller password. You can’t proceed to install in these cases.

cPanel Flash Tutorials

Addon domain -:
An addon domain allows you to reach a subdomain when entering the name of the addon domain into a browser.

For example, if domain2.com is an addon domain on sub.domain.com, going to http://www.domain2.com in a browser will bring up sub.domain.com (domain.com/sub).

Parked domains -:
A parked domain allows you to reach your domain when entering the name of the parked domain into a browser.

For example, if domain2.com is parked on domain.com, going to http://www.domain2.com in a browser will bring up domain.com.
Redirects -:
Redirects allow you to make a specific web page redirect to another page and display the contents of that page. This way you can make a page with a long URL accessible by a page which has a shorter and easier to remember URL.

For example: Since http://www.domain.com/new/data/access.html is hard to remember, you can make http://www.domain.com/access.html redirect to the other URL.

MySQL
=======

How to take a Backup
==> mysqldump databasename > backup.sql

How to Restore Mysql Backup
==>> mysql databasename > /scripts/pkgacct

After that it will create cpmove-username.tar

How to copy this backup on another server:
===>> scp cpmove-username.tar root@anotherservername.com:/home

How to restore this backup on another server:
====>> #/scripts/restorepkg username

How to Install cPanel and WHM
=======================
Fiorst verify IP address for license through : http://verify.cpanel.net

After that go to http://cpanel.net
Click on Download
Click on Layer1
Copy link ocation of layer
wget complate path of link location
chmod 755 latest
./latest

CGI and Perl
==========
Any cgi and perl file having 755 permission

Securioty URL
=============

Named Configurations:
===============
/var/named/domian.com.db

/etc/named.conf ==>>

runlevel is a state, or mode, that is defined by the services listed in the directory /etc/rc.d/rc.d, where is the number of the runlevel.

Red Hat Linux uses  runlevels:

0 — Halt

1 — Single-user mode

2 — Not used (user-definable)

3 — Full multi-user mode

4 — Not used (user-definable)

5 — Full multi-user mode (with an X-based login screen)

6 — Reboot

If you use a text login screen, you are operating in runlevel 3. If you use a graphical login screen, you are operating in runlevel 5.

The default runlevel can be changed by modifying the /etc/inittab file, which contains a line near the top of the file similar to the following:

id:5:initdefault:

Change the number in this line to the desired runlevel. The change will not take effect until you reboot the system.

To change the runlevel immediately, use the command telinit followed by the runlevel number. You must be root to use this command

Next Page »