cPanel Issues


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

For installing the SSL certificate you need to have a dedicated IP Address, and make sure that your domain is registred domain name and resolving perfectly

Step 1: You need to generate CSR (certificate signing request ) from your webhost nameger. which required following information.

———————————–
- Host to make cert for:
- Country(2 letter Abbreviation):
- State:
- City:
- Company Name:
- Company Division:
- Email:
- Password:
———————————–
Also please create webmaster@yourdomain.com (replace yourdomain.com with the domain that you want the SSL certificate to be setup for) and provide us with its password so we can complete the installation process.

After CSR generation you will get the CSR and RSA key

step 2: With the help of RSA key you need to purchase SSL certificate from any of SSL provider such as COMODO ,instant SSL

step 3: Once you got the SSL cerificate then you need to provide that certificate to hosting provider so the hosting provider will install SSL cerificate from WHM >> SSL/TLS >> Install a SSL Certificate and Setup the Domain option.

To stop other sites directly linking to your images and media files and stealing your bandwidth You need to add following code in your .htaccess file

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com(/)?.*$ [NC]
RewriteRule .*.(gif|jpg|jpeg|bmp|wmv)$ http://www.domain.com/image.jpg [R,NC]

Note: replace your website with domain.com

cPanel Hosting FAQ’s

1. How to activate or install Zend Optimizer?

Ans: To activate or install Zend Optimizer run /scripts/installzendopt from the command line as root.

2. How to import data into MySQL?

Ans: From command line you can import data into MySQL.

You will need to import data from the command line into MySQL. The way you will do this depends on the type and format of the sata you wish to import.

You can view the MySQL manuals below:

Version 4.1

dev.mysql.com/doc/refman/4.1/en/index.html

Version 5.0

dev.mysql.com/doc/refman/5.0/en/index.html

Version 5.1

dev.mysql.com/doc/refman/5.1/en/index.html

3. I’ve already installed Tomcat but how do I install Servlets on an account?

Ans: To install Servlets go through the following steps:

In WHM go to WHM -> Account Functions -> Install Servlets.

Select an account/domain you wish to have Servlets installed upon and apply the settings.

4. How to turn off anonymous FTP?

Ans: Turn off anonymous FTP : Under the FTP menu in X3, go to ‘Anonymous FTP and make sure the boxes next to the following options are turned off:

Allow anonymous access to ftp://ftp.domain.com

Allow anonymous uploads to ftp://ftp.domain.com/incoming

5. I am resident in the UK but forms etc on my websites are showing USA time and not GMT.

Ans: It means that your site is hosted on a US server and not UK server. The forms on your page are using the time on the server (US Server) that your site is on. Edit the code in the form to show the time zone you wish to use.

View WebHosting UK cPanel Hosting and cPanel Tutorials

Overview

HotLink protection prevents other websites from directly linking to files (as specified below) on your website. Other sites will still be able to link to any file type that you don’t specify below (ie. html files). You can use hotlink protection to keep other sites from linking to your images, videos, and other files. If another site links directly to your images or other files, they will be using your bandwidth to display those files rather than theirs.

Enabling Hotlink Protection:

To enable Hotlink protection follow the steps mentioned below

Step 1. To access Hotlink Protection, click on the icon above the words Hotlink Protection on the main screen of your cPanel interface.

Step 2. Enter the names of sites that you wish to access your files in the first field which already contains the names of your site(s).

Step 3. Enter the file types that you wish to let those sites access by entering their extensions in the blank field next to Extensions to allow (seperate by commas):

Step 4. Enter the URL you wish to redirect links to that are not allowed in the blank field next to ?Url to Redirect to:

Step 5. If you wish to allow the sites you have entered to directly request files (view images or videos by typing their url into a browser), click on the box next to Allow direct requests

Step 6. Click on Activate to enable Hotlink Protection.

Disabling hotlink protection:

If you no longer wish to use Hotlink Protection on your site, you can disable it with the Hotlink Protection Menu.

Step 1: To access Hotlink Protection, click on the icon above the words Hotlink Protection on the main screen of your cPanel interface.

Step 2: Scroll down to the bottom of the menu, and click on Disable.

Dont worry about converting to MailDir on server …follow this ….

A) /scripts/convert2maildir

choose option 1.. Backup all mail folders on this server
3.. Start maildir conversion process

B) /scripts/courierup –force

C) /scripts/eximup –force

D) /scripts/upcp –force

E) /scripts/convert2maildir

choose option 3… to convert partially converted mail accounts

Cheers …

You need to check the permissions for binaries there, it should be none other than 755.

=========
/bin/tar
/bin/gzip
=========

Next Page »