Hide Apache, PHP and Bind Versions



To Check Apache Version:

By default, Apache will send version and modules information like mod_php, mod_perl, mod_ssl in every HTTP header.

If you want to view Apache web server version and sofware of a remote server, follow this procedure.

# telnet example.com 80

Trying example.com...
Connected to example.com.
Escape character is ‘^]'.
HEAD / HTTP/1.0 <- after this press 2 times ENTER


HTTP/1.1 200 OK
Date: Sun, 07 Oct 2012 12:57:57 GMT
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 JRun/4.0
Last-Modified: Tue, 03 Jan 2012 11:41:16 GMT
Connection: close
Content-Type: text/html; charset=UTF-8
Connection closed by foreign host.

In the above example it is showing all the details about your web server and php this is not recommended for security reasons.We need to hide this information with the following procedure.


To Hide Apache Information:


To hide the information, add the following two apache directives in Apache configuration file, (httpd.conf or apache2.conf)

ServerTokens ProductOnly

ServerSignature Off

# /etc/init.d/httpd restart

Now the output for apache header looks like below

Server: Apache


To Hide PHP Version Details

Locate php.ini  loaded in the server.

Change the following option in php.ini

expose_php On

to

expose_php Off

# /etc/init.d/httpd restart


To Hide BIND Version


You can check the Bind version of a server by using the following command.

# dig +short @XXX.XXX.XXX.XXX -c CH -t txt version.bind
    "9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.4"

To hide your version of bind, change the version value in named.conf as like the following.
You can give any string for the version.

options {
directory "/var/named";
version "We Just Hide It";
};

# dig +short @XXX.XXX.XXX.XXX -c CH -t txt version.bind
   "We Just Hide It"

Coldfusion9 Installation on CentOS Server



Coldfusion Installation on CentOS Server


Must be Check/Done Before Proceeding Installation:


1. # yum update
   -Update your CentOS server before proceeding installation.

2. Disable SELinux if it is already enabled.

3. # yum install libstdc++.so.5
    -To install the required libstdc++.so.5 C++ Library

4. # which httpd
    /usr/sbin/httpd
    httpd must be installed. It is needed the location of httpd binary file for the installation of coldfusion.

5. # uname -m
   -Check the architecture of the OS, whether it is 64 bit or 32 bit.

6. Note down the serial number if you have one or install the trial version.



Installation:



1. # cd /usr/local/src

   Download the correct 64/32 bit version of Coldfusion9 as per the OS architecure.
   You can follow the the URL given below to check the versions.

   # wget http://download.macromedia.com/pub/coldfusion/cf9_installer/ColdFusion_9_WWEJ_linux.bin
   -Download the 32 bit version

   # wget http://download.macromedia.com/pub/coldfusion/cf9_installer/ColdFusion_9_WWEJ_linux64.bin
   -Download the 64 bit version

2. # chmod +x ColdFusion_9_WWEJ_linux*.bin
   -To give executable permission to the downloaded installation binary file.

3.  For the 32-bit installation
    # ./coldfusion_9_WWEJ_linux.bin

    For the 64-bit installation
    # ./coldfusion_9_WWEJ_linux64.bin

4. Installation process will ask you somany questions. Select the options as you want to customize. The questions are as like the following.


DO YOU ACCEPT THE TERMS OF THIS LICENSE AGREEMENT? (Y/N): Y

====================================================
Install Type
------------

If you do not have a serial number, select either 30-day trial or Developer
Edition.

->1- Install new version of Adobe ColdFusion 9 with a serial number
2- 30-day trial
3- Developer Edition

Installation Choice: 1

Serial Number: XXXX-XXXX-XXXX-XXXX-XXXX-XXXX

====================================================
Installer Configuration
-----------------------

What kind of installation do you want?

->1- Server configuration
2- Enterprise Multiserver configuration
3- J2EE configuration (EAR file)
4- J2EE configuration (WAR file)

Choose one of the following options:: 1

====================================================
Is Adobe ColdFusion 9 (Server Configuration) Installed?
-------------------------------------------------------

You cannot install the server configuration of Adobe ColdFusion 9 if it is already installed on this computer.

Is there already a server configuration of Adobe ColdFusion 9 installed?

1- Yes
->2- No

ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:: 2

====================================================
Subcomponent installation
-------------------------

The following options are available for installation.

An option marked with "[X]" in front will be installed and an option with "[ ]"
will not. Choosing an option will toggle it on or off

[X] 1) ColdFusion 9 Documentation
[X] 2) ColdFusion 9 Solr Services
[X] 3) ColdFusion 9 Search Services
[X] 4) Start ColdFusion on system init

5) Continue with installation

Select an option: 5

====================================================
Choose Install Folder
---------------------

Select the directory where you want to install Adobe ColdFusion 9.

Directory:

Default Install Folder: /opt/coldfusion9

ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT
:

====================================================
Earlier Versions of Adobe ColdFusion installed?
-----------------------------------------------

If you installed an earlier version of ColdFusion on this computer, you can migrate your settings to Adobe ColdFusion 9.

Is there an earlier version of ColdFusion installed on this computer (for example, ColdFusion 6 or ColdFusion MX 7)?

1- Yes
->2- No

ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT::

====================================================
Configure Web Servers
---------------------

Please configure your web server(s). If you do not configure a web server the
built-in web server will be used on port 8500 or the next available port.

1- Add Web Server Configuration
->2- Continue with installation

Choice: 1

****************************************************

->1- Apache
2- Sun ONE Web Server (iPlanet)
3- Cancel

What kind of web server are you configuring: 1

What directory contains your Apache configuration file (httpd.conf)? (For
example, on Red Hat Linux it could be located in the /etc/httpd/conf
directory if you installed from an rpm, or for SuSe Linux, it could be in
/etc/apache2)

Directory: /etc/httpd/conf

****************************************************

Where is the Apache program binary file? (For example, on Red Hat Linux it
could be /usr/sbin/httpd if you installed from an rpm, or for SuSE Linux it
could be located at /usr/sbin/httpd2) If you have more than one instance of
Apache on your computer, enter the binary file location for the Apache web
server that will use ColdFusion. (Note: this is not the Apache start and
stop script.)

File: /usr/sbin/httpd

****************************************************

Where is the control file that you use to start and stop the Apache web
server? (For example, this could be /etc/init.d/httpd on Red Hat Linux if
you installed from an rpm, /usr/sbin/apache2ctl on SuSe Linux, or it could
be /usr/local/apache/bin/apachectl on hand-compiled versions.)

File: /etc/init.d/httpd

****************************************************

Please configure your web server(s). If you do not configure a web server the
built-in web server will be used on port 8500 or the next available port.

1- Add Web Server Configuration
2- Remove Web Server Configuration
3- Edit:Apache : /etc/httpd/conf
->4- Continue with installation

Choice: 4

====================================================
Choose Adobe ColdFusion 9 Administrator Location
------------------------------------------------

Select the location of the web root for Adobe ColdFusion 9. This is where the installer places the Adobe ColdFusion 9 Administrator.

This directory must be the web root for one of the websites to be configured for use with Adobe ColdFusion 9.

Directory: (DEFAULT: /var/www/html):

====================================================
Runtime User
------------

Enter the name of the runtime user. This user must already exist on the system.

User Name: (DEFAULT: nobody):

====================================================
Configure ColdFusion with OpenOffice
------------------------------------

Configuring OpenOffice installation with ColdFusion will enable Office documents to be processing using OpenOffice. If OpenOffice is not configured ColdFusion will not be able to convert some Microsoft Office Documents to PDF. Check the documentation for more details.

1- Configure ColdFusion with local Openoffice installation
->2- Skip

ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT::

====================================================
Administrator Password
----------------------

Enter the password that you will use to restrict access to the ColdFusion
Administrator.

This field is required.

Password: ********
Confirm Password: ********

====================================================
Enable RDS
----------

The ColdFusion Remote Development Service (RDS) lets developers using Adobe
tools remotely connect to this server for development purposes. RDS is required
for Line Debugging, Report Builder, and Dreamweaver Extensions.

If this is a production server, Adobe recommends that you disable RDS.
Note, however, that disabling RDS also disables debugging, the directory
browsing applets in the ColdFusion Administrator and some of the functionality
in the Report Builder.

Enable RDS (Y/N): Y
Password: *******
Confirm Password: ********

====================================================
Installation Confirmation
-------------------------

Installation Type:
Server configuration

Licensing:
Enterprise edition
Serial Number: XXXX-XXXX-XXXX-XXXX-XXXX-XXXX

Installation Directories:
Product: /opt/coldfusion9
Web root: /var/www/html

Server Information:
Web Server: Apache (/etc/httpd/conf)
Port:
Search Services: installed
ColdFusion Solr Search Services: installed
Documentation: installed
RDS: enabled

Disk Space Information (for Installation Target):
Required: 992,437,542 bytes
Available: 110,094,069,760 bytes

PRESS <ENTER> TO CONTINUE:

====================================================
Installing...
-------------

[==================]

====================================================
Installation Complete
---------------------

You have successfully completed the first step in installing Adobe ColdFusion





5. # cd /opt/coldfusion9/bin
   # ./coldfusion start
   # ./coldfusion stop
   -To start/stop coldfusion on the server.

6. To access the adminstrator panel, use the following link.
   http://[machinename]/CFIDE/administrator
   Enter the administrator password you have given during the installation.


Note:-

Kloxo Brute Force Protection




As like cPHulk Brute Force Protection in cPanel, Kloxo has also a Brute Force Protection named Lxguard.


Error Log of FTP access at the time of Block

libwrap refused connection to ftp (libwrap=pure-ftpd) from xx.xx.xx.xx
FAIL: ftp libwrap from=xx.xx.xx.xx


You can check the IP block as follows.

1.  Login as admin user in Kloxo.

2. Security >> Lxguard >> Connections >>

3. You can see a search bar there. You can search for the IP xx.xx.xx.xx  there.

4. You can select the IP by marking it and you can enter the button Remove to remove the IP block.

There is also an option for a whitelist the IP.

cPanel - Install ImageMagick


First of all check whether there is a cPanel script for installing ImageMagick available in the server or not. If yes,

# /scripts/installimagemagick
   -This will install ImageMagick automatically.


If not, follow the steps given below to install ImageMagick.

Install ImageMagick

1. # cd /usr/local/src/

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

3. # tar -xzvf ImageMagick.tar.gz
         -To download the ImageMagick setup compressed file and extract it.

4. # cd ImageMagick-*
    # ./configure
    # make
        -To configure and make ImageMagick from the source.

5. # make install
        -To install ImageMagick if the make process is successfully completed.

6. # make check
         -It will check the installation of ImageMagick. If  the installation completed successfully check will give a positive result.

7. # php -m | grep imagick
        -To check whether the  imagick module is loaded or not.

8. # /etc/init.d/httpd restart


Bind ImageMagick Into PHP

For your new ImageMagick installation to work with your web php scripts, you now need to bind it into PHP. To do this, just follow the steps below.

1. Login to WHM and navigate to the “Module Installers” option under “Software” in the left hand menu

2. On the following page, select the “Manage” link beside the PHP Pecl language option

3. Enter imagick into the “Install a PHP Pecl” field and then click the install button.

4. # /etc/init.d/httpd restart

Note 1:- Put a php info page and verify whether ' imagick ' is loaded or not.

<?php phpinfo(); ?>


Note 2:- You can install other php modules using Module Installers. The list of available php modules which can be installed using this cpanel feature is in the following url. There is no need to run easyapache to install those modules listed in this.
http://pecl.php.net/package-stats.php

cPanel AwStat error - ('/home/{user}/tmp/awstats/awstats.{domain.com}.conf' file, web server or permissions) may be wrong.



Error:

Error: LogFile parameter is not defined in config / domain file
('/home/{user}/tmp/awstats/awstats.{domain.com}.conf' file, web server or permissions) may be wrong.
See AWStats documentation in 'docs' directory for informations on how to setup awstats.

Initial Checking:-

# ls -ld /home/{user}/tmp
    -Permission should be 700.

# cat /home/{user}/tmp/awstats/awstats.{domain.com}.conf
    -In some cases this file will be empty, it will cause the above error. This file must contain awstat configration.

Solution:

Usually the above error means one of the following ...

1. The /home/{user}/tmp doesn't have the correct permissions, you can fix this withthe following command.
     
 # chmod 700 /home/{user}/tmp
    -For one user

 # chmod 700 /home/*/tmp
    -For all users in the server.

2. The account has exceeded their disk quota and the awstats.domain.com.conf file cannot be created/updated.
      The stats will not run until the disk quota has been increased for the affected accounts.
You also might have to wait up to 24 hours for logs to run again, or you can force logs to run.

To run the webstats for one account:

 # /scripts/runweblogs {user}

To run the webstats for all accounts in the server.

 # /scripts/runlogsnow


 # cat /home/{user}/tmp/awstats/awstats.{domain.com}.conf
    -Check whether this file is emty or not. The file must contain the configration of awstat. If it is empty there will be some other issues.


Table is marked as crashed and should be repaired(Errno=145)



Error

Table <db/table_name> is marked as crashed and should be repaired(Errno=145)

Solution

1. Login to the user's cPanel account which have database error problem.

2. Enter into user's phpMyAdmin.

3. Select the database which has the above problem. The table name and database name will be specified in the error itself.

4. After enter into the database, select the SQL tab.

5. Issue the following SQL command by giving the correct table name and execute by clicking GO.
   REPAIR TABLE <table_name>;

6. Just access the url you are having the problem and verify the result.

How to reset An Account Password in Plesk?




1. Login to Plesk admin panel, https://<IP or domain>:8443

2. Click on 'Domains' option in 'Hosting Services'.

3. Search for the domain you want to change login password. (Let it be example.com)

4. Login to Control Panel of the selected domain.

5. Select Account >> My Profile >> General

6. You can see the account name and an option to change password in 'Panel Preferences' in 'General' tab.

7. Enter a strong password there and Click on OK button to make the changes in effect.

8. Verify user name and password using the given link, https://example.com:8443