Thursday, 21 July 2011

How to install postgresql


Steps given below :-

*Not:- C-Panel requires Postgresql 7.3.x or later. 7.2.x will not work.

 
<Step 1>.

Upgrade to cPanel 7.4.0 build 45 or later,

--Step 1a --(If you do not have 7.2.x or earlier installed skip this step)

Login to a root shell via ssh or the console,

If you have Postgres 7.2.x installed, backup your databases using pg_dumpall or some other method,

Move the postgres data directory somewhere else. ie,

mv /var/lib/pgsql /var/lib/pgsql.old

---------------------------------------------------------------------------
<Step 2>.

Login to a root shell via ssh or the console and run,

/scripts/installpostgres


--Step 2a-- (skip this step if you are not upgrading from postgres 7.2 or earlier)

Restore your sql dump created with pg_dumpall or by some other method using psql or some other method



---------------------------------------------------------------------------
<Step 3>

Login to Web Host Manager & choose "Postgres Config" under Server Setup,

Set a postgres password to anything of your choosing, You should avoid using any non-alpha numeric charaters as these cause problems.


---------------------------------------------------------------------------
<Step 4>.

Use the "Postgres Config" option in WHM to install a postgres pg_hba.conf file, You can skip this step if you would like to setup your pg_hba.conf file manually, cPanel should work fine with md5 passwords or plaintext  passwords.

---------------------------------------------------------------------------


<Step 5>.

Login to cPanel and click on Postgres .. Enjoy!
 
 
******************************************--------------------------****************************************

Tuesday, 19 July 2011

How To change IP in server

Note:- Hey Remember //You need to set RDNS for the IP then and then Only you can proceed further//.

***********---------------------------------------------------------------***********

If you are in the danger of getting your main server IP block by SpamCop because you had a few anoying spamers abusing your server, then you could simply change your exim mailserver IP to avoid the effect of your main IP beeing blacklisted.

--Below there are some simple steps of changing your exim IP:---

Inside both incoming & outgoing exim mail server you will need to add an interface :-
( So just edit )

pico /etc/exim_outgoing.conf

and

pico /etc/exim.conf

find
remote_smtp:
driver = smtp

& add interface = ip.you.want.to.use


***********---------------------------------------------------------------***********

Example is as shown below:-

remote_smtp:
driver = smtp
interface = 22.22.22.22

***********---------------------------------------------------------------***********

IP needs to be on server in order for this to work, hopefully this will help.
BTW: Just a reminder - If there is an exim update when you upgrade your cpanel server you will need to re-enter the interface again.




---------------------***********************************-------------------------

Friday, 8 July 2011

Steps to install IP Table

This are some important steps for install (IP) tables:-


1.  Get the iptables tarball containing all the needed files.-

       - To get the latest version of iptables go to netfilter.org
       - Downloads are available at http://www.netfilter.org/downloads.html
       - The file should be named iptables-1.*.*.tar.bz2 where the asterisks represent the numbers of the       latest version.
       - Save this file to a temporary directory, we will use /tmp in this example.


 2. Open a terminal window.



 3. Change your directory to where you saved iptables by typing :-

      # cd /tmp



4. Uncompress the archive to the /usr/src directory by typing :-

      # tar -xvjf ./iptables-1.*.*.tar.bz2 -C /usr/src

      where the asterisks represent the version number of the file you downloaded,



5. Change to the directory it created (typically iptables-1.*.*), by typing :-

      # cd /usr/src/iptables-1.*.*



6. Using the kernel directories above, type :-

      # /bin/sh -c make



7. To finish the install, type :-

      # /bin/sh -c make install


- Iptables should now be installed, You can test the installation as described in the beginning of this section to see if it is working.

- If the above install steps seemed to execute without any error, but typing:-

# iptables -V

- Brings up an error, it is possible that the program did'n install itself to the sbin directory, To fix this type the following command from the iptables-1.*.* directory:

ComputerName:~# cp ./iptables /sbin

----------------------******************-------------------------

Sunday, 19 June 2011

How to install spam log.


///** Following are the steps to install Spam_log   **/// :--

-------------************----************--------------
 1>  Login to your server & su - to root.



 2> Turn off exim while we do this so it doesn't freak out :-

#/etc/init.d/exim stop



 3> Backup your original /usr/sbin/sendmail file, On systems using Exim MTA, the sendmail file is just basically a pointer to Exim itself :-

#mv /usr/sbin/sendmail /usr/sbin/sendmail.hidden



4> 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);



 5> Change the new sendmail permissions :-

#chmod +x /usr/sbin/sendmail



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



7> Start Exim up again :-

#/etc/init.d/exim start



8> 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

Sample Log Output

Mon Apr 11 07:12:21 EDT 2005 - /home/username/public_html/directory/subdirectory - nobody x 99 99 Nobody / /sbin/nologin

Log Rotation Details :-
Your spam_log file isn't set to be rotated so it might get to be very large quickly, Keep an eye on it and consider adding it to your logrotation.

#pico /etc/logrotate.conf

FIND :-

/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}

**// ADD BELOW //** :-

# SPAM LOG rotation
/var/log/spam_log {
monthly
create 0777 root root
rotate 1
}

Saturday, 11 June 2011

Step to install YUM


[Note] - Please first Download the .tar source & Set it up it is not hard read the read-me file in it.

**Just use this scripts given below ** :--

As root,
cd ~
mkdir setups
cd setups
tar -xvzf yum-2.0.7.tar.gz
cd yum-2.0.7
./configure
make
make install


Thursday, 9 June 2011

How To Transfer Account Manually


----//  To transfer an account using shell is as follows  //------ :-

----------------------------------------------------------------------

1)-Commands to run on the "Old Server".

/scripts/pkgacct (user name)

Change permmissions to 755.

Change owner to nobody.nobody.

move tar file to /usr/local/apache/htdocs

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

2)-Commands to run on "New Server".


---------------------------------***************---------------------------------------

Sunday, 5 June 2011

Max connection to MySql


**To set Max-connections for mysql just add this following lines :-

-----------------------
max-connections=150

below

#old_passwords=1
---------------------

Saturday, 4 June 2011

How to install Mytop


//** To Install Mytop Fire this Command on the Server  **// :--
 
*******************-----------*******************


tar -zxvf mytop-1.4.tar.gz

cd mytop-1.4

perl Makefile.PL

make

make test

make install

*******************----------***********************

*Note :- To Access MyTop Fire is this command on the sever :-

[root@mss ~]#mytop

*******************----------***********************

Thursday, 2 June 2011

Path of Httpd for individual user.


< Its so simple just fire this command on server > :-
 
 
****---------------------------------------------****

Path of Individual Httpd Files :-

[root@fs5 /usr/local/apache/conf/sites/

*************----------------------**************

Wednesday, 1 June 2011

Server replied 110 can't open SMTP Stream

**[ If you get following kind of Error ]:--

---------
Error display on the screen :-

Connection timed out
Server replied: 110 Can't open SMTP stream.

---------

1>
 
  I found the config for cpanel's SM:-

/usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php

---------

2>

  Just changed:-

$useSendmail = false;

to:-

$useSendmail = true;

[Around line 33]

*Note :-(This will probably get written over with the next cpanel update, but it at least helps get my users sending mail again.

That's it try out this will resolve your problem)

******************************---------******************************