Tuesday, November 16, 2010

How to install Joomala

Steps for Joomla Intallation:-

First wget the pachage

1) wget http://joomlacode.org/gf/download/frsrelease/6828/22537/Joomla_1.0.15-Stable-Full_Package.tar.gz

2) Change the ownership for Joomla package.

3) extact the package:-
tar -xzvf Joomla_1.0.15-Stable-Full_Package.tar.gz

4) Change the ownership of content,
  For exampal : chown tunerpar.tunerpar * -R

5) Open the site in browser
l
chmod 777 administrator/backups/
chmod 777 administrator/components/
chmod 777 administrator/language/
chmod 777 administrator/language/en-GB/
chmod 777 administrator/modules/
chmod 777 administrator/templates/
chmod 777 components/
chmod 777 images/
chmod 777 images/banners/
chmod 777 images/stories/
chmod 777 language/
chmod 777 language/en-GB/
chmod 777 language/pdf_fonts/
chmod 777 media/
chmod 777 modules/
chmod 777 plugins/
chmod 777 plugins/content/
chmod 777 plugins/editors/
chmod 777 plugins/editors-xtd/
chmod 777 plugins/search/
chmod 777 plugins/system/
chmod 777 plugins/user/
chmod 777 plugins/xmlrpc/
chmod 777 tmp/
chmod 777 templates/
chmod 777 Cache Directory /home/rsvpwebd/public_html/cache/
chmod 777 Cache Directory /home/rsvpwebd/public_html/administrator/cache/
chmod 777 tmp/
chmod 777 /home/rsvpwebd/public_html/cache/
chmod 777 administrator/backups/

6) Create configuration file,
touch configuration.php

7) Change the ownership for config file
chown tunerpar.tunerpar configuration.php

8) If php global setting is on then enter the code in .htaccess file
To tunn of the setting:-
php_flag register_globals off
To make writable session save path, Just put the following code in your .htaccess file:
php_value session.save_path '/tmp'

9) Make writable confi file
chmod 666 configuration.php

10) Add username "localhost"

11) create a database ,username and password and fill it in blank fields.

12) Insert email ID of user.

13) Save the admin login.

14) Click on view site and then rename the installation directory and refesh the browser,

THATS IT YOUR JOOMLA SITE IS READY TO USE.
------------------------------------------------------------------------------------------------

HOW TO COPY WEBSITE

HOW TO COPY WEBSITE FROM:- http://abc.com/ to abc1.com with database

Steps are as follows :-

.Open two shells ( one with abc.com and other abc1.com )

.then copy public_html of abc.com to abc1.com

.go to public_html folder of abc.com and hit the command 

.[root@server public_html of abc.com]# cp -R * /home/abc1/public_html

.Change the ownership of the files copied under public_html of abc1.com

.Then take backup of mysql datatbase of abc.com
.mysqldump abc_databasename > abc_databasename.sql   ( of abc.com)
.Create a new database and username under abc1.com ( add user to database, make a note of db name, user & password)
.then go to Shell and enter the following command:-
mysql -u abc1_user -ppassword abc1_databasename < abc_databasename.sql
Then go to the configuration file and do the changes accordingly.

And your site has been copied with database  to new site.

All Done.

Saturday, November 6, 2010

How to install DOS-Deflate

Just follow given instruction below:-

How to install:-

Installing DOS-Deflate is so simple.

Informations is as follows :-

When you run this Perl script it will then run an netstat command check how many times each IP is connected & if there are more then the number of connections you specified then it will automatically run a command in APF for the IP to be banned,

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

Login to your server as root.

Download the install script.
wget http://www.inetbase.com/scripts/ddos/install.sh

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

Run the installer.
sh install.sh

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

DOS-Deflate should now be installed

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

Please note that DOS-Deflate uses APF to ban IPs so you must have it installed for DOS-Deflate to work properly,

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

Customizing DOS-Deflate is very easy. You have to edit /usr/local/ddos/ddos.conf with your favorite editor for example:-


vi /usr/local/ddos/ddos.conf

Every setting is explained in the configuration file so I will not go over them as the explanations are quite easy to follow up:

Read also "How To Install Apf <advanced Policy Firewall>" if you haven't set up apf firewall in your box.

This way we can protecting ourself from ddos attack, Such attacks are so common nowadays, all website owners should look into protecting their sites from such attacks

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

Full Info of PHP

//To check php info of a domain enter the following code in a file in pulic_html of the domain //

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

<?phpinfo();?>

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

And then all the info will POP on your screen up to you .

Thursday, November 4, 2010

spamming from user by hidding domain name

Refer the solution given below:-

It seems that some user is spamming from your server,then for quick action clear the exim mail queue.

'rm -rf /var/spool/exim/input' 

It will do it, But you should investigate more & find the source script or domain & take actions so as to really help you out of this kind of issue.

**************************
Fire the below mentioned command at your command prompt to find the domain which is being used by spammers for spamming.

# exim -bpr | exiqsumm -c | head

And Then,

#exiqgrep -ir <domain> | xargs -n1 exim -Mrm

That should remove any Email that is in the queue that is waiting to be delivered to POP accounts at [domain].

Stats not working ?

If the Stats in the server are not working please follow the given instruction:-

WHM -> Server Configuration -> Tweak Settings ' Delete each domain's access logs after stats run ' must be unchecked ,After this it should work properly.

There are also some scripts available to fix this issue:- 

/scripts/updatenow

/scripts/updateuserdomains

/scripts/fixeverything

/scripts/upcp –force
******************************************************

Solution on MIME

Follow the Instruction  given below:-

If your web site is running on linux server and want to make it stream windows media,Then you have to do following steps:-


                                                     Step< 1 >
 
First, you have to configure mime type in apache web server to recognize the windows media file .asx .


                                                    Step< 2 >

Log on to linux server as a root, At the dollar prompt, type as following below

Change directory to etc folder
$ cd /etc

Edit mime.types file
$ vi mime.types


                                                   Step< 3 >

Then press i at your keyboard to enter text below You can place this text below any where in the file mime.types.

Application/x-mplayer2 asx m3u


                                                    Step< 4 >

Then press Esc key.


                                                   Step< 5 >
Then press Shift key and colon key, You will see, it appears at the bottom of the file.

Type as below at colon prompt to quit and save

:wq

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

How to fix the error "License File Expired"

To deal with such issue is very easy just follow given steps:-

First we need to check the license on http://verify.cpanel.net/ to ensure that it is still licensed
If it's not , Then please contact who you purchase the license from directly.

If it says it is valid, try the following commands as root via SSH:-

# rdate -s rdate.cpanel.net

# /usr/local/cpanel/cpkeyclt
-----------------------------------------------------------------------------------------------

What is Bad Blocks

Check out the following commands for BAD BLOCKS :-

Badblocks [options] device block-count.
    
    System administration command, Search device for bad blocks. You must specify the number of blocks on the device (block-count). e2fsck and mke2fs will invoke badblocks automatically when given the -c option.

Options:-

-b 
    blocksize

    Expect blocksize-byte blocks,

*************************************
-c   blocksize

    Test blocksize-byte blocks at a time. Default is 16,

 ************************************
-f

    Force a read/write or nondestructive write test on a mounted device. Use only when /etc/mtab incorrectly reports a device as mounted.

*************************************
-i file

    Skip test of known bad blocks listed in file.

 *************************************
-n

    Perform a nondestructive test by writing to each block & then reading back from it while preserving data,

*************************************
-o file

    Direct output to file,

*************************************
-p number

    Repeat search of device until no new bad blocks have been found in number passes, Default is 0.

*************************************
-s

    Show block numbers as they are checked,

*************************************
-t pattern

    Test blocks by reading and writing the specified pattern. You may specify pattern as a positive integer or as the word random, If you specifiy multiple patterns, badblocks will test all blocks with one pattern, and then test all blocks again with the next pattern. Read-only mode will accept only one pattern, It will not accept random.

*************************************
-v

    Verbose mode.

*************************************
-w

    Test by writing to each block and then reading back from it.

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

how t o Setting / customising Server Security

Fire the following command on the server :-


#system-config-securitylevel

 & also

/etc/sysconfig/selinux


Properly Rejected Invalid Emails

Just read the method given below to resolve this issue :-

Mail queue fill up with bounce messages to non-existant spammer email addresses, By default. If an email comes into your server addressed to an invalid recipient, Exim will accept the message from the delivering agent, and then generate a return email to them explaining that the address is invalid, With this little tweak, you can make exim tell the delivering agent,Tthat address is invalid at the time the message is being delivered.

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

Method <1>
. Open WHM and click on Exim Configuration Editor

. Click on the Switch to Advanced Mode button.
. Scroll down until you see the section on ACL's. You'll see three boxes. In the middle box, locate the section that reads - See Section A:
--------------------------------------------------------------------------------------------

Method <2> Recommended

. Login into SSH and su to root.

. pico /etc/exim.conf

. Ctrl + W and type in: accept  domains , Notice the two spaces. Look for something like this below.


Section A :-

accept  domains = +local_domains
accept  domains = +relay_domains
accept  hosts = +relay_hosts
accept  condition = ${perl{checkrelayhost}{$sender_host_address}}

Between

accept domains = +local_domains

&

accept domains = +relay_domains

add the following:

endpass
message = unknown user
verify = recipient

Make sure each line lines up,You might need to add two spaces before each line, The final section will look like this. :-

accept domains = +local_domains
endpass
message = unknown user
verify = recipient
accept domains = +relay_domains
accept hosts = +relay_hosts
accept condition = ${perl{checkrelayhost}{$sender_host_address}}

Scroll all the way to the bottom and click on Save.

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

Wednesday, November 3, 2010

Commands to open tcp or udp ports on the server

 Following commands use to open tcp or udp ports on the server:-

< Before using commands for opening the port,Please make sure the specific port is already opened & what is the use of that port >

You can verify the port with 

netstat -nap | grep : <port no>

(1)  You can open TCp port with.

iptables -A INPUT  -p tcp –dport <port no> -j ACCEPT
 ---------------------------------------------------------------------------------- 
(2) You can open UDP port with

iptables -A INPUT -p udp –sport <port no>  -j ACCEPT

after that
 ----------------------------------------------------------------------------------
(3) Service iptables save

and for flushhing iptables us

iptables -F 

 iptables -A INPUT -s 210.0.143.122 -j DROP

203.162.3.147

iptables -L

service iptables save
--------------------------------------------------------------------------------------
THATS IT YOU DONE 

How to register a domain with using extra IPS

Let's get started with following simple steps :-

1 >
       Login to your registrar panel (Godaddy, Enom, etc..).
2 > 
      Select the domain you want to use & find where you can 'Register New DNS',
3 >
      Put in ns1.yourdomain.com and ns2.yourdomain.com in the respective fields.
4 >
      Put in the IP addresses [either yours or the ones provided to you by your host]
5 >
      Hit the save or submit button.
    ** NOTE:- If you are a regular reseller the rest is done by your host on their end so notify them that you            .         have done your part, If you run a dedicated server, read on.
6 >
      Login to your WHM panel as "root",
7 >
      Go to 'Reseller Center', select 'mydomain.com'. Click on the 'Edit Domains/Privilages' icon.
8 >
      When the page loads scroll down & put in the new nameservers, in this case ns1.mydomain.com &  
          ns2.mydomain.com.
9 >
       Save them & scroll down to 'DNS Function' and select 'Edit DNS Zone'.
10 >
      You will notice that the new nameservers are now located in the top 2 text fields, Scroll all the way down 
          to where it says 'Add new A entries'.
11 > 
        In the first text field put in the nameserver & in the second empty text field put in the IP address. So, it 
          will look something like this:-

          ns1.mydomain.com 14400 IN A 1.1.1.1

          ns2.mydomain.com 14400 IN A 1.1.1.2
12  > 
         Click Save & you are done Enjoy.
-------------------------************************-----------------------------

Tuesday, November 2, 2010

How to Catch spammers on C-panel

**Just follow given steps :-



<Follow the steps given below to catch Spammers sending mails from scripts ( nobody emails )> :-

1> Edit /etc/exim.conf
 ------------------------------------------------------------------------
2>On the second line add :-

log_selector = +address_rewrite +all_parents +arguments +connection_reject +delay_delivery +delivery_size +dnslist_defer +incoming_interface +incoming_port +lost_incoming_connection +queue_run +received_sender +received_recipients +retry_defer +sender_on_delivery +size_reject +skip_delivery +smtp_confirmation +smtp_connection +smtp_protocol_error +smtp_syntax_error +subject +tls_cipher +tls_peerdn \

Make sure all that comes on a single line,
 ------------------------------------------------------------------------
3>Save and exit,
 ------------------------------------------------------------------------ 
4>Restart Exim,

A keep a watch on /var/log/exim_mainlog as you should be able to trace path to directory from which the spammer(s) is / are spamming,
 ------------------------------------------------------------------------

**If the spammer is not spamming using formmail scripts then go through following steps :-

1]> Get the message ID from the header of the spam, It should be in format like 1DWJj4-00042i-74 ( this is the most important step else all thats given below is crap ).

2 ]> grep exim_mainlog with the message ID, ( Ex : grep 1DWJj4-00042i-74 /var/log/exim_mainlog ).

3 ]> Check the time on which the spam was sent and also check all that is shown after grep,

4 ]> If you find out the domain name or path of the scripts from exim_mainlog then go ahead & suspend the spammer, else proceed to step 5.

5 ]> Use this message ID to check the original message or bounced message in /var/spool/exim/input/. You should see 2 files there, one with -D at end & one with -H at the end, 
( Ex : /var/spool/exim/input/4/1DWJj4-00042i-74-D & /var/spool/exim/input/4/1DWJj4-00042i-74-H ) This 2 files will have all the information that was sent in the spam message & if it was sent using mailing list then you will catch the username of spammer in auth_sender part of this files, If it shows nobody then its your bad luck Proceed to step 6.

6 ]> If exim_mainlog shows the spams originating from /tmp of the server & check the file in /tmp of the server. wner of the file will be seen as nobody:nobody, Take down the time of creation of file. This time is what we need to find out who uploaded the script, You will need to convert this time into the time format of /usr/local/apache/logs/error_log & then in the format of the domlogs located at /usr/local/apache/domlogs/*

7 ]> for file in /usr/local/apache/domlogs/*; do cat $file |grep “example”; done; ( you cannot do direct grep for the query here as it will give error that the arguement list is too long ).

8 ]> If the results in step (2) have shown some domain name or some username in common as sender of the spam but now you dont see that domain name on the server then check /var/cpanel/accounting.log to see if that account has been terminated from the server ( Ex : grep ebayspammer.com /var/cpanel/accounting.log ).

All that we need to know is importance of /var/log/exim_mainlog, /var/log/formmail.log, /usr/local/apache/logs/error_log, /usr/local/apache/domlogs/*,
/var/spool/exim/input/*/* and the files uploaded in /tmp of the server, Major spamming issues are caught using the time of sending the spam,You will need to work on your own when you get across such issue & use your logic to convert the time of sending the spams to the time format of respective log files I mentioned above,
*****************************************************************

How to take backup

**Following steps will guide how to take back up :-



**NOTE :-You will have to take fullbackup of all the accounts from your previous hosting panel with the following steps.(your previous hosting should have C-panel).

** Login to the individual account control panel.

** You will find an option called as "Backup"

** Click into it.

** In there you will find any option called "Generate/Download a Full Backup"

** Click in it and the backup process will start

** Later on you will have to move the database from the old server to the new server through FTP and we would help you in restoring all the backedup file back to normal

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

Simple function FIND

Fire following command on Server :-

find . -type f -exec grep a7rar '{}' ';'

Monday, November 1, 2010

POP3/IMAP Server

Some steps are given below  :-


Install Dovecot(POP3/IMAP Server):-

****

    Dovecot is a very popular POP3/IMAP Server, The main Difference beween POP3 &IMAP is while accessing your EMAIL with outlook if you use POP3 & IMAP the mail is download to your COMPUTER & DELETED from Server,With IMAP the mail is retained in the server,If any problem occurs while downloading the EMAIL are lost with POP3, The configuration file is located at /etc/dovecot.conf

yum install dovecot

****
  
   Open the dovecot config file.etc/dovecot.conf & make tis following chnages.You may need to comment / uncomment certain lines

protocols=imap imap pop3 pop3s

****

   Look for the line auth default  & male these changes,Be careful with the lines as they are heavily commented out.

auth default{
mechanisms=plain login
passdb pam{
}
userdb passwd{
}
socket listen{
client{
path=/var/spool/postfix/private/auth
mode=0660
user=postfix
group=postfix
}
}
---------------------------------------------------------------------------------------

How to configure Outlook

 Following steps are useful for setup an account in outlook : -
-----------------------------------------------------------------------------

*  Open up outlook express.
*  Goto the menu at the top called "Tools".
*  On the menu please select "Accounts".
*  Across the top you will see several tabs(all, mail, news, directory service) . Please click on the one entitled   "Mail".
*  Click the add button (found on the right hand side).
*  A menu appears. Please select "mail".
*  Please type in your name,
*  Click Next.
*  Type your emailid in the 'E-mail address',
*  Click Next.
*  Please check that POP3 is selected at the top of the screen,
*  In the field called "Incoming mail(POP3, IMAP OR HTTP) server" please type in "mail.<domainname>" 
*  In the field called "Outgoing mail(SMTP) server" please type in the smtp server that your isp gave you for example:-
mail.<domainname>
*  Click next.
*  In the field entitled "Account name" please type your account name,
*  In the field entitled "Password" please type in your password. This password was the password you used  when you set up your mailbox,
*  Click the "next" button,
*  Click "finish",
*  Click "close",
-----------------------------------------------------------------------------------------
This will setup a new  account,So click the button "send/recv" to check it.

what is DOS Attack

Some basic commands :-


DOS attack :-

/home/virtual/public_html/vtc

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

- This will also help you :-

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

route add xxx.xx.xx.xxx reject

netstat -n | grep :80 | wc -l;uptime ; netstat -n | wc -l

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

- Also do this to lower down the server load :-

Steps to lower the load, If you want stats to continue to run even with a high load,Then Edit

/var/cpanel/cpanel.config & change extracpus to a number larger then 0 


(run/usr/local/cpanel/startup afterwards to pickup the changes)

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

How to Disable PING Command on server

Command to disbale ping on the server:-

                            
                          Step 1)-

Command to disable PING:-

echo "1" >> /proc/sys/net/ipv4/icmp_echo_ignore_all

********************************************
                             
                             Step 2)-

Command to enable PING :-

echo "0" >> /proc/sys/net/ipv4/icmp_echo_ignore_all

**********************************************
                              
                             Step 3)-

**Note:--Ping can also be disbale to following command :-

# iptables -A INPUT -p icmp -j DROP


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

How to check CRON JOB

Just Fire Following Command On The Server :-

**This is to check users cron job**

Command :-

   crontab -u mwda0820 -l