LOW COST JAVA PHP MYSQL CGI PERL
HOSTING SERVICE
LINUX WINDOWS CPANEL WHM PLESK
HOSTING PACKAGES
ECOMMERCE HOSTING ASP JSP MSSQL
FRONTPAGE HOSTING
CPANEL WHM RESELLER DEDICATED
SERVER WEB HOSTING

Archive for Server Security

mod_security error while uploading file.

If you are not able to upload the file and getting the mod_security related errors like as per below

mod_security: Access denied with code 406. Error processing request body: Multipart: invalid part header (missing colon): Submit Query\\x0d\\x0a [hostname “www.graphicireland.com”] [uri “/woodprint/upload.php”]

then simply add following command in your .htaccess file that will fix your issue.

————————–
SecFilterEngine Off
SecFilterScanPOST Off
————————–
That should solve your problem.

Comments Bookmark on del.icio.us

Upgrading the Kernel on Live Servers

The following steps are to upgrade the kernel on live dedicated servers.1. Check current version of kernel on server using the command ‘uname -a,’ if
it’s 2.4 then download latest release for 2.4, please do not download the 2.6
kernel.
You can download the kernel from http://www.kernel.org/pub/linux/kernel/v2.6/.
If it’s 2.4 then you can check for the latest stable release at http://www.kernel.org

2. wget kernel in /usr/local/src
3. untar it using tar -zxvf linux-2.x-xxxx
4. cd linux-2.x-x
5. make clean
6. make mrproper
7. If the kernel is 2.4 then copy the current version of the config file from
/boot/config-’uname-r’ as .config in /usr/local/src/linux-2.x-xx, if
the kernel is 2.6 then you do not need to make .config in the current directory.
8. Run ‘make menuconfig’, select and check if all required modules are selected,
also make sure that your kernel supports multiple cpu
you can check it and select from processor type, if it displays support
for more then 2 kernel then you do not need to modify anything there.
9. Save the configuration and exit.
10. Run ‘make modules’ if the kernel is 2.4, then you need to run ‘make dep’ before running
‘make modules’.
11. ‘make modules_install’
12. ‘make’
13. If the kernel version is 2.4 then you will need to run ‘make bzImage’ and then ‘make install’, you
can directly run ‘make install’ if the kernel is version 2.6
14. Now, open the bootloader and modify the default kernel accordingly:
grubby –bootloader-probe if it displays grub then edit /etc/grub.conf,
if it’s lilo then you will need to edit lilo.conf and make the compiled kernel the default kernel.
15. If your boot loader is lilo then you need to run one more command:
/sbin/lilo which will update lilo
16. Now, reboot the server.

Comments Bookmark on del.icio.us

Configuring APF Firewall

cd /usr/local/src
wget http://rfxnetworks.com/downloads/apf-current.tar.gz
tar -zxf apf-current.tar.gz
cd apf-0.*
./install.shNow edit config file

vi /etc/apf/conf.apf
Scroll down to the “Common ingress (inbound) TCP ports section. At this point you need to find the correct configuration for your control panel.

IG_TCP_CPORTS=”20,21,22,25,26,53,80,110,143,443,465,993,995,2082,2083,2086,2087,2095,2096″
IG_UDP_CPORTS=”21,53,873″

EGF=”1″
EG_TCP_CPORTS=”21,22,25,26,27,37,43,53,80,110,113,443,465,873,2089″
EG_UDP_CPORTS=”20,21,37,53,873″

save the file
start apf
apf -s

If everything still works then edit the config file and turn dev mode off. Make sure you can start a new ssh session before changing dev mode off. If you are kicked out you need to go back and look at what caused the problem!
DEVEL_MODE=”0″

restart APF
apf -r

Comments Bookmark on del.icio.us

Stop phpbb worms with mod_security

Greetings members,If you would like to make sure that your PHPBB boards, or any other script for that matter don’t get injected then you can use the following code (the code must be places in the .htaccess file in the root of your site):#spam bots SetEnvIfNoCase User-Agent “^EmailSiphon” bad_bot SetEnvIfNoCase User-Agent “^EmailWolf” bad_bot SetEnvIfNoCase User-Agent “^ExtractorPro” bad_bot SetEnvIfNoCase User-Agent “^CherryPicker” bad_bot SetEnvIfNoCase User-Agent “^NICErsPRO” bad_bot SetEnvIfNoCase User-Agent “^Teleport” bad_bot SetEnvIfNoCase User-Agent “^EmailCollector” bad_bot #plagarism bot SetEnvIfNoCase User-Agent “^TurnitinBot” bad_bot #IP bot SetEnvIfNoCase User-Agent “^NPBot” bad_bot #Worm sign SetEnvIfNoCase User-Agent “^LWP::Simple” bad_bot SetEnvIfNoCase User-Agent “^lwp-trivial” bad_bot SetEnvIfNoCase User-Agent “^lwp” bad_bot SetEnvIfNoCase User-Agent “^LWP” bad_bot #Worm sign Order Allow,Deny Allow from all Deny from env=bad_bot

Comments Bookmark on del.icio.us

If IP address assigned to a server are missing from the drop down list in CREATE ACCOUNT.

1)
Check that the ip address is in ifconfig: 

root@[/]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0D:61:B5:AE:74
inet addr:69.93.237.209 Bcast:69.93.237.223 Mask:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:216786947 errors:0 dropped:0 overruns:0 frame:0
TX packets:292861708 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:1968126893 (1876.9 Mb) TX bytes:317887913 (303.1 Mb)

2)
Check the entry of ip address in /etc/ips

root@[/]# vi /etc/ips

69.93.237.209:255.255.255.224:69.93.237.223
69.93.237.210:255.255.255.224:69.93.237.223
69.93.237.211:255.255.255.224:69.93.237.223

The first column is the ipaddress assign to the server that you can see in “ifconfig” i.e. “inet addr:69.93.237.209″

The second column is the Mask:255.255.255.224.

The third column is the Brodcast:69.93.237.223.

3)
Check if the ips are listed in /etc/ipaddrpool

root@[/]# vi /etc/ipaddrpool

69.93.237.209
69.93.237.210
69.93.237.211
If the IP address not listed in any of above file, then add it and then you should be able to access it when you create a new account.

Comments Bookmark on del.icio.us

EACCELERATOR installation

Eaccelerator is a PHP accelerator/encoder/caching utility that is based
off of the old mmcache (which is no longer being maintained). What Eaccelerator does is: it caches your PHP scripts so that the database
is no longer being queried every time someone needs a script. This is
particularly useful for large forums, but pretty much anyone can benefit
from it. Since these scripts are cached, you’ll notice a decrease in
memory use and server load.Now, onto installing this!
______________________________

Installing Eaccelerator

1. First, you’ll want to SSH into your server as the root user. you should
be in the default directory now. If you’re not, type in cd ~

Now we’ll make the eaccelerator directory:

mkdir /ea/

cd /ea/

2. Now we’ll grab the files, and untar them:
Notice that it’s a tar.bz2 file, so we need to decompress it twice.

wget http://heanet.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.4-rc1.tar.bz2

bzip2 -d eaccelerator-0.9.4-rc1.tar.bz2

tar xvf eaccelerator-0.9.4-rc1.tar

3. Now that we’ve done that, let’s install Eaccelerator:
Note: in the following “export” command, you need to point that to where
PHP is installed. For most, it’s usually either “usr/” or “usr/local”, but
it may be something else.

cd eaccelerator-0.9.4-rc1/

export PHP_PREFIX=”/usr”

$PHP_PREFIX/bin/phpize

./configure –enable-eaccelerator=shared
–with-php-config=$PHP_PREFIX/bin/php-config

make

make install

4. It’s basically installed, now we need to edit the php.ini files to
include Eaccelerator. This is usually found in the /etc/ folder, but if
you can’t find it, run a “locate php.ini” (without quotes) to find it.
You can use pico or vi, it’s your choice:

cd ~

nano /etc/php.ini

—————————————————————————-
For a PHP extension install (most will probably want this)
—————————————————————————-

extension=”eaccelerator.so”
eaccelerator.shm_size=”16″
eaccelerator.cache_dir=”/tmp/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=””
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”0″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″

—————————————————————————-
For a Zend Extension install (only if you have Zend Optimizer installed, or
if you’re going to install it
—————————————————————————-

zend_extension=”/usr/lib/php4/eaccelerator.so”
eaccelerator.shm_size=”16″
eaccelerator.cache_dir=”/tmp/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=””
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”0″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″

cd ~

mkdir /tmp/eaccelerator/

chmod 0777 /tmp/eaccelerator/

5.After installed restart apache to check eaccelerator is installed.
service httpd restart

Open up your favorite FTP client and upload the eaccelerator.php and
eaccelerator_password.php files to any directory on your website.

Once that’s done, you can go to http://www.your-domain.com/path_to_s…ccelerator.php (of course,
replacing that with the path to the script) to see if it’s installed.

Now, we’ll probably want to add a password to prevent some mean user from
clearing the cached scripts or causing other bad stuff to happen. Navigate
to the eaccelerator_password file and set an administrator name and
password.

This doesn’t set the password, but it gives you a line of code to place in
your php.ini file (just below the eaccelerator part). Once you do this,
you need to log in to view the eaccelerator page.

cp /ea/eaccelerator-0.9.4-rc1/eaccelerator.php /usr/local/apache/htdocs/

Comments Bookmark on del.icio.us

« Previous entries · Next entries »