Sunday, 27 May 2012

PHP pages internal server error Plesk CGI/FCGI

When using PHP 5.3.3, php pages will be throwing internal server error when you select the PHP handler as CGI/FCGI.

You will be finding the following error message in the Apache logs.

======
 Premature end of script headers: cgi_wrapper
13)Permission denied: exec of '/usr/sbin/suexec' failed
======

To resolve the issue, change the ownership of the  '/usr/sbin/suexec' as follows:

====
root:apache
====

Previously, the ownership will be as follows:

====
root:root
====

The PHP pages will be loading fine...

Saturday, 26 May 2012

Detect top 10 spammers in exim

Detect top 10 spammers in exim

Eximstats is a useful command to find spamming in the cpanel server. Execute the following command in your terminal

/usr/sbin/eximstats -t10 /var/log/exim_mainlog > teststats

The stats output will be appended to a file called "teststats". This have the following data.

(t10 is an option which shows the top 5 count)
The above command gives the following details:

* Top 10 local destinations by volume
* Top 10 local destinations by message count
* Top 10 sending hosts by volume
* Top 10 sending hosts by message count

and other stats such as total number of mails received and
delivered...top 10 sender (username) and many other data are available in that file.

You just need to vi to that file or less the file.

vi teststats or less teststats

You will get all the information in the spammer account and email id.

How do I flush a computer DNS cache?

How do I flush a computer DNS cache?


To flush DNS cache in your computer or PC


Flush dns to get a new nameserver resolution for a domain. Flushing DNS cache might also helps you to check new redistered domain is accessable in the browser or not. You can simply flush your dns cache anytime to get new entry. 


Lets start Flushing the DNS cache



To flush DNS  cache in Windows (Win XP, Win ME, Win 2000, vista, windows7):-

- Start -> Run -> type cmd
- in command prompt, type ipconfig /flushdns
- Done! You Window DNS cache has just been flush.



To flush the DNS cache in Linux


- To restart the nscd daemon, type /etc/rc.d/init.d/nscd  or /etc/init.d/nscd restart in your terminal
- This will flush dns cache in linux machine




To flush the DNS cache in Mac OS
- type lookupd -flushcache in your terminal to flush the DNS resolver cache.
ex: bash-2.05a$ lookupd -flushcache
- Once you run the command your DNS cache (in Mac OS X) will flush.

To flush the DNS cache in Mac OS X Leopard
- type dscacheutil -flushcache in your terminal to flush the DNS resolver cache. 
ex: bash-2.05a$ dscacheutil -flushcache
- Once you run the command your DNS cache (in Mac OS X Leopard) will flush.


Server error. Upload directory isn't writable in wordpress

Server error. Upload directory isn't writable. in wordpress

When you have added a 3rd party plugin in the wordpress, there might be achange that you will get the above error.

The simple solution for this issue is changing the permission of uploads, special integrated theme upload and upgrade directory to 777

CSF error some missing iptables modules [4] ipt_REDIRECT...FAILED, ipt_owner, ipt_recent, iptables_nat

I have installed the CSF in the server. When I try to run the perl test in the CSF, it is giving the following error.

===============
# perl /etc/csf/csftest.pl
Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...FAILED [Error: iptables: Unknown error 4294967295] - Required for PORTFLOOD and PORTKNOCKING features
Testing xt_connlimit...FAILED [Error: iptables: Unknown error 4294967295] - Required for CONNLIMIT feature
Testing ipt_owner/xt_owner...FAILED [Error: iptables: Unknown error 4294967295] - Required for SMTP_BLOCK and UID/GID blocking features
Testing iptable_nat/ipt_REDIRECT...FAILED [Error: iptables: Unknown error 4294967295] - Required for MESSENGER feature
Testing iptable_nat/ipt_DNAT...OK

RESULT: csf will function on this server but some features will not work due to some missing iptables modules [4]
===============

Solution:


csf requires at least these iptables modules in the main node

ip_tables
ipt_state
ipt_multiport
iptable_filter
ipt_limit
ipt_LOG
ipt_REJECT
ipt_conntrack
ip_conntrack
ip_conntrack_ftp
iptable_mangle


Following modules are used for the other funcanality of csf

ipt_owner
ipt_recent
iptable_nat
ipt_REDIRECT


You can check if the above modules are installed in the server or not.

# lsmod |grep -i <module-name>

If it is not installed then you can install it via

modprob ipt_conntrack


You can test whether they have fixed the environment by running:

perl /etc/csf/csftest.pl

This will fix the issue.

In case of VPS like OpenVZ, Prallels Virtuozzo or etc, this might not been fixed some times. Just follow the steps below to fix the issue in the VPS container.

1. /sbin/iptables -F

2. Edit /etc/sysconfig/iptables-config

IPTABLES_MODULES="ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp ip_conntrack_ftp ipt_conntrack ip_tables ip_conntrack_netbios_ns"


3.Edit /etc/sysconfig/vz

IPTABLES_MODULES="ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp ip_conntrack_ftp ipt_conntrack ip_tables ip_conntrack_netbios_ns"


4. Execute the command in the console

service vz stop

service iptables restart

service vz start

Thursday, 17 May 2012

FAIL: ftp per_source_limit

At  times, you will find the following error message in the "/var/log/messages"

=======
FAIL: ftp per_source_limit from=xxx.xxx.xxx.xxx
=======

You can resolve the issue by adding the following line in the file '/etc/xinet.d/ftp_psa'

=======
per_source            = UNLIMITED 
=======

After saving the file, restart xinet.d by using the following command.

/sbin/service xinetd restart

 The issue will be resolved. :) 

Sunday, 6 May 2012

Disable Dr.Web email notifications


At times, you may get many emails notifying about the Dr.Web service.
You may disable it by following the steps mentioned below: It differs from one Plesk version to that of the other.
For Plesk 8:
Edit the file '/etc/drweb/drweb32.ini' and
set
UpdateNotify = no

For plesk 9:
Edit the file '/etc/drweb/drweb32.ini' and
set
CronSummary = no
Plesk 10 :
Edit the file:

/etc/cron.d/drweb-update

and at the end of the line add the following:

2>&1> /dev/null

It should look like this:

*/30 * * * * drweb /opt/drweb/update.pl 2>&1> /dev/null

 

 

Have a Nice Day :)

Saturday, 5 May 2012

Plesk Windows Statistics not being updated

If web statistics present in the Plesk panel is not working, you can run the following command in the command prompt.

==========
%plesk_bin%\statistics.exe" --all --process-domains=karthick.com --from-date=2012/5/2
==========

You can find more options by running statistics.exe --help

Have a Accurate Web Statistics :)

Friday, 4 May 2012

Wheel user to become as root (su -) without password

1. Create a user:

useradd test
passwd test

2. Add this user in wheel group.

usermod -a -G wheel test

3. Now, Edit PAM configuration file for su. (/etc/pam.d/su)

----
 vi /etc/pam.d/su

uncomment below line
auth sufficient /lib/security/$ISA/pam_wheel.so trust use_uid

This will allow users in wheel group as a trusted users.
-----

4. Login as test user.
 #su -
It will not ask for password.

OR

If we add the test user in "visudo", we need to use "sudo su -" to become root without password.
----
1. visudo or vi /etc/sudo
2.  Add the below line 
   test    ALL=(ALL)   NOPASSWD:ALL
3. Save and exit
----

It will also grant root privilege for the user "test", but we need to use "sudo su -" to became as a root.

Thursday, 3 May 2012

How to resolve : Internal server Error when accessing cPanel/WHM/Webmail



# inode checking :

Inode Usage : 

1) You can check the inodes of an account on your server by using SSH:

# quota -s <cPanel_username>

2) If you have SSH access to your account you can view the inodes for a specific folder using the following command :

root@XXX [/]# echo "Detailed Inode usage for: $(pwd)" ; for d in 'find -maxdepth 1 -type d | cut -d\/ -f2 | grep -xv . | sort' ; do c =$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"
                                                                          
Detailed Inode usage for: /                                                                      
98              - bin                                                                            
1               - boot                                                                            
110             - dev                                                                            
1237            - etc                                                                            
88873           - home                                                                            
201             - lib                                                                            
267             - lib64                                                                          
1               - media                                                                          
1               - mnt                                                                            
629             - opt                                                                            
13290           - proc                                                                            
205             - root                                                                            
182             - sbin                                                                            
1               - selinux                                                                        
1               - .spamassassin                                                                  
1               - srv                                                                            
304             - sys                                                                            
15              - tmp                                                                            
108013          - usr                                                                            
4273            - var                                                                            
Total:          217708
root@XXX [/]# 

Error : Unable to open pty: No such file or directory



unable to enter into VPS


You may get an error while entering to a openvz vps. You cant also ssh to the vps from outside.

Error:
vzctl enter xxxx
enter into VE xxxx failed
Unable to open pty: No such file or directory


1. If it is a redhat based system such as CentOS,

The solution is :
vzctl exec VEID /sbin/MAKEDEV pty
vzctl exec VEID /sbin/MAKEDEV tty
vzctl enter VEID

To fix this issue permanently

Edit the file /etc/rc.sysinit of the VPS
Comment the line :
/sbin/start_udev   to
#/sbin/start_udev

Add the following lines after /sbin/start_udev:
/sbin/MAKEDEV tty
/sbin/MAKEDEV pty


2. If it is a Debian system
vzctl exec veid update-rc.d -f udev remove
vzctl restart veid

Setup email forwarder in cPanel


How can I setup email forwarder in cPanel

To set email forwarder in cPanel, please follow the steps :-

1) Log in to cPanel.
2) Click on "Forwarders" under Mail category.
3) You can set two type of forwarding under this

 *Email Account Forwarders :- Forwarders allow you to send a copy of all mail from one email address to another

 *Email Domain Forwarders :- In addition to forwarding individual mail accounts, you can forward all email from one domain to another.

4) Click on "Add Forwarder " under "Email Account Forwarder".
5) Enter the email addresses on which you want to forward email in " Address" text bar.Enter
the destination email address in " Destination" text bar.
6) Click on "Add forwarder " and forwarder will be added.

Protect my folder with password in cPanel

How can I protect my folder with password in cPanel





To protect the folder on the web with password, please follow the steps :-


1) Login to cPanel.


2) Click on "Password Protect Directories " icon under "Security" setting.


3) Select the folder you wish to protect with "Password".


4) Enter the "Name the protected directory" which will appear when user try to access that directory.


5) Click on "Save".


Now you need to add the user that can access that directory from web. To add a user please follow the following steps :-


1) Click on "Password Protect Directories " icon under "Security" setting.


2) Select the folder you wish to protect with "Password".


3) Enter the following details under " Create User " :-


Username :-Enter the user name that will access that folder.


Password :- Password for that user.


4) Click on "Add/modify authorized user" once you have entered the details.

How can I protect my folder with password in cPanel



How can I protect my folder with password in cPanel



To protect the folder on the web with password, please follow the steps :-

1) Login to cPanel.

2) Click on "Password Protect Directories " icon under "Security" setting.

3) Select the folder you wish to protect with "Password".

4) Enter the "Name the protected directory" which will appear when user try to access that directory.

5) Click on "Save".

How can I add MX records in cPanel


How can I add MX records in cPanel

1) Login to cPanel.
2) Click on MX Entry icon Under "Mail category".
3) Select the domain from drop down menu for which you want to change the MX record (This option
is only available if you have hosted more than one domain under your account)
4) You need to insert the Destination MX record in "Add New Record" field with priority.
5) Click on "Add New Record" and MX record will be added.

Install application like wordpress from cPanel

How to install application like wordpress from cPanel

To install application Like wordpress,please follow the steps :-

1) Log in to cPanel.

2) Click on "Site Software" under "Software/Services category".

3) Click on "Fantastico De Luxe"

4) Click on the application "WordPress" that you want to install from the given list.

5) Enter the following details :-

Admin User:  The username that you want to keep for administrator.

Admin Pass:  The password for the above user.

Installation URL: Select the Domain URL under which you want to install the application "This option is only available if you have multiple domain added under your account".

6) Also enter the directory under which you want install this application.You may install this under root directly by leaving the directory URL text box blank.

7) Enter the prefix for the tables that will be created in the database.

8) Select the database option from the drop down menu "If you select the database which already has some data on it then that data will be over written during installation".

9) Once the installation is finished then you can access your application admin URL by entering following in the web browser "http://your-domain.com/wp-admin"

How can I backup my database from cPanel

How can I backup my database from cPanel


To backup the database from cPanel, please follow the steps :-

1) Login to cPanel.

2) Click on "Backup Wizard".

3) Click "Backup"

4) Click on MySQL Databases.

5) Click on each Database you want to backup.

How can I set redirection of my domain from cPanel?



To set the redirection on cPnale, Please follow the steps :-

1) Log into the cPanel.

2) Under “site management” you will get “redirects” icon. Click on "redirect".

3) You will have the option to make your redirect to a particular IP either temporary or permanent.  Here is an explanation of these options:

a) Temporary redirect: Setting this to temporary tells Internet Providers that the redirect is only temporary and that they may return to your domain in the future

b) Permanent redirect: This setting tells Internet Providers that the redirect is permanent and will then automatically forward them to the new domain.

4) To perform either redirect you will simply type in your new directory or domain in the first box then select whether the redirect will be temporary or permanent in the second box.  After clicking the “save” button your redirects will take effect.

Postfix Tuning and steps to tune the postfix in server


How to tune the postfix in your server?

The probably the best thing you could do is to write the logs to
another syslog server as is done in this syslog.conf snippet.

mail.* @xxx.xxx.xxx.xxx
or if you can't spare a machine for that, put dash in front of the
filename. Default behavior of syslogd is to sync the logfile after every
change. Testing before and after, this dropped my load average by about
70% on a box that relays and buffers incoming email for about 10,000
mailboxes.

mail.* -/var/log/maillog
Syslogging to another machine would be the ideal solution.
For postfix, I also set these in /etc/postfix/main.cf
minimal_backoff_time = 2000s
maximal_backoff_time = 8000s
maximal_queue_lifetime = 2d
message_size_limit = 10240000
qmgr_message_active_limit = 20000
qmgr_message_recipient_limit = 20000
transport_retry_time = 120s

Basically just taming the queue to work not quite so hard to send all the
bounced spam back to the sender.

The last three were doubled. I am not 100% certain I understand the
qmgr_message ones, but my understanding is that it increases the amount of
ram the queue can use. More ram operation == less disk thrashing so that's
my reason for that.

How can I add cronjob in my cPanel account


How can I add cronjob in my cPanel account?

1) Login to cPanel.
2) Click on "Cron Jobs" icon under advanced category.
3) Add a new cron job under " Add New Cron Job" category.Also you can have cron send an email everytime it runs a command.
4) You need to enter the following details :-

Minute:: It will run the cron job for a specific command on that minute in an hour defined by you.
Hour :- It will run the cron job for a specific hour of the day which you have defined.
Day :- It will run the cron job on that day of month which you have defined.
Month :- Will run the cron job on that month of the year defined by you.
Weekday :- It will run the cron job on that day of the week defined by you.
Command :- Enter the command which you want to run when the cron job run on it schedule time.

5) Click on "Add new Cronjob" once you have entered the above setting.

CPanel email Auto Responder used and setup auto responder


What is the CPanel email Auto Responder used for?

It is widely used for "away" messages, or to let the people know that you have received their email. It depends on the purpose of the user to send an automatic reply when a email is received.

You can setup your auto responder by following the steps.


1) Login to your cPanel.
2) Select "Auto Responder" in the "Email" tab
3) Click on "Add Auto responder"
4) Set your own auto responder accordingly.



How do I setup Spam Assassin and other email security measures?


How do I setup Spam Assassin and other email security measures?


Set up your email security precautions. This was probably already done, except for setting any forwarding, when your hosting account was created. If so, no need to change it at all, but always check be sure:

1. Click on Mail icon in your CPanel. You will be taken to the Mail Manager Main Menu screen.
2. Click on "Default Address"; if it does not say ":blackhole:" in the box, click on the "Set Default Address" link at bottom of page. Then type exactly (without the quotation marks) ":blackhole:" in the empty box; click "Change". Do NOT set this to ":fail:" because that will put more load on server resources, by having to return to sender... which is not even a real adddress most of the time.

3. Click on Spam Assassin.

4. Click on Enable Spam Assassin.

5. Once cPanel indicates the change was processed, click on Go_Back link to go back to Spam Assassin menu screen.

6. Click on Configure Spam Assassin. You will be taken to the Spam Assassin Configuration screen.

7. Change rewrite_subject to 1

8. Click on Save.

9. Once cPanel indicates the change was processed, click on Go_Back link to go back to Spam Assassin Menu screen.

10. Click on Go_Back again. You should now be back at the Mail Manager Main Menu screen.

11. Click on E-mail Filtering.

12. Click on Add_Filter. You will be taken to the Add Filter screen.

13. Type Yes in the empty box. Select "Spam Assassin Spam Header" and "begins with" .

14. Click on Activate.

15. Once cPanel indicates the filter was added, click on the Go_Back link to go back to the Filter Maintenance screen.

16. Log out of cPanel.

Create a database and the user for that database in cPanel


How to create a database and the user for that database in cPanel

These are the steps to create a database and the user for that database in cPanel

1) Login to the cPanel
2) Go to "Databases"
3) Click on "MySQL Darabases"
4) Under "Create Database"
5) Enter the database name.
6) Click "Create Database"

Then create a user

7) Under "Add New User"
8) Enter the username
9) Generate the password.
10) Click "Add User"

Now add the user to the database.

11) Under "Add User To Database"
12) Select the user and the database name.
13) Click on "Add"

You will be prompt for "MySQL Account Maintenance", give the privilege for the user and make changes.

How to create an email account in cPanel?

How to create an email account in cPanel?


1) Login to your cPanel
2) Go to "Mail"
3) Select "Email accounts"
4) Now type the USERNAME alone.
(By default domain name will be there. Just type username like admin, oryon, etc)
5) Enter or generate the password.
6) Click on "Create email Account"

Your email account is created.

How to create a full backup of my domain in cPanel?


1) Login to the cPanel
2) Go to "Files"
3) Click on "Backup"
4) Under "Full Backup" option
5) Select "Download or Generate a Full Backup Website"
6) Click on "Generate Backup"

Note: It will take some time to complete the full backup of your domain.

Upload file in your account via FTP filezilla in cPanel

How to upload your files via FTP FileZilla in cPanel?


You can upload the file via FTP. Kindly download the FTP client to your local machine and install it. Kindly follow the link below to download the FTP client.
======
http://filezilla-project.org/download.php
======
Then you can upload the files via FTP client. The login details for the FTP is same as cPanel username and password. Make sure that the port number for FTP is 21.

How to create a Parked domain in cPanel?


These are the steps to create a parked domain in cPanel.

1) Login to your cPanel
2) Go to Domains.
3) Click on "Parked Domain" tab
4) Enter the domain name in "Create a Parked Domain"
5) Save it

Enabled "Auto Reload" option to 0 seconds. How to revert it?


Enabled "Auto Reload" option to 0 seconds. How to revert it?

Kindly follow the steps below to disable the "Auto-reload" option in your webmail.


1) login to your "Webmail"
2) You will be auto reloaded to "Horde" login page.
3) Now, click "back to one page", in your browser like Firefox or Google chrome.
4) You will be loaded with "Horde" interface page.
5) There is an option called "Disable Auto Reload" below the "Horde" interface page.
6) Click on "Disable Auto Reload"
7) Then click on "Enable auto-reload"
8) It will prompt for seconds delay for reloading your "Horde", change it accordingly.

Enable Auto reload option in webmail/cPanel


Enable Auto reload option in webmail/cPanel

1) login to your "Webmail"
2) Check for the option "Auto Reload" below the default interface (i.e Horde, Squerrel mail)
3) Click on "Auto Reload" below the default interface
4) Give the seconds to reload that interface by default (e.g 5seconds)



Using For Loop to Rename All Files in a Folder


Using For Loop to Rename All Files in a Folder


This is the batch script for windows to rename all files in a folder on windows. This works well perfectly. This was useful for me. It may help others to do the same. I was worried to change the files name and folder using script, atlast i find my script to fix the issue.



rem: Some testing batch command in Windows XP
setlocal ENABLEDELAYEDEXPANSION
@echo off
rem ***************** Test 1 **********************
rem about variables
set var1= This is a variable VAR1
set var2=’This is a variable VAR2′
set var3=”This is a variable VAR3″
echo %var1%
echo ‘%var2%’
echo “%var3%”
rem ***********************************************
rem Conclusion from test 1 is that assigning text
rem value to variable doesn’t need to be quoted
rem ***********************************************
rem **************** Test 2 **********************
rem about for loop
set count=0
for %%a in (1 2 3) do (
echo !count!
set /A count=!count!+1
echo %%a
)
for %%A in (1 2) do for %%B in (A B) DO ECHO %%A%%B
rem **********************************************
rem Conclusion from test 2 is that variable in
rem the for loop has to be single character like
rem %%a. %%var will not work
rem you don’t have to have
rem setlocal ENABLEDELAYEDEXPANSION for the count
rem to work but you do have to use !count! instead
rem of %count%
rem **********************************************
rem **************** Test 3 **********************
rem use for loop to list all .txt file names
for /f %%a in (’dir /b transaction*.txt’) do (
echo %%a
)
rem **********************************************
rem I don’t know what the switch /f in the for
rem statement and the /A switch in the set
rem statement mean but it works.
rem Can someone explain the switch? =)
rem **********************************************
rem **************** Test 4 **********************
rem rename all .txt file so that all of them
rem starts with “trans” instead of “transaction”
for /f “tokens=1,2 delims=_” %%a in (’dir /b transaction*.txt’) do (
if “%%a”==”transaction” echo yes
echo %%a
echo %%b
ren %%a_%%b tran_%%b
)
rem **********************************************
rem The above script works fine. It renames all
rem files named in partern transaction_XXXX.txt
rem to trans_XXXXX.txt
rem “tokens=1,2 delims=_” tells it to separate
rem whatever returned in dir command in two parts
rem using the first “_” found and put the first
rem token in %%a, the second in %%b.
rem It is very powerful and interesting!
rem **********************************************
goto :eof


One additional remark: if you decide NOT to set ENABLEDELAYEDEXPANSION, then the !variable! syntax fails. Not sure if that means that %variable% would work in that situation instead, but just thought I’d be explicit about where ENABLEDELAYEDEXPANSION had an effect (though obviously it’s relevant in other parts too)



Testing Dovecot in Postfix or Verify Dovecot in Postfix


Testing Dovecot in Postfix or Verify Dovecot in Postfix

One thing that you can do is run this command to verify it is listening on the correct port numbers:
netstat -aunt

This should show that Dovecot is listening on ports 143 and 110 for IMAP and POP3.

Check if Dovecot is Listening
Another test is to connect to Dovecot using telnet on port 143.  Here is an example with the output you want.
telnet localhost 143
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
* OK dovecot ready.

Check if Dovecot Accepting Passwords
telnet localhost 143
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
* OK dovecot ready.
1 login hemanth
1 login hemanth password
1 OK Logged in.

Check if Dovecot is Accepting Remote Logins
telnet 21.14.126.132 143
Trying 21.14.26.132…
Connected to 21-14-26-132.static.example.net (21.14.126.132).
Escape character is ‘^]’.
* OK dovecot ready.
1 login hemanth password
1 OK Logged in.

Check if Dovecot is Finding the Mailbox
1 select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1163363765] UIDs valid
* OK [UIDNEXT 1] Predicted next UID
1 OK [READ-WRITE] Select completed.

Linux server settings for high load systems


Linux settings for high load systems


There are a few basic settings you have to adjust for high load systems to make sure the server have enough resources to handle big number of network connections. The main parameter is a maximum number of opened files allowed for the process to keep at the same time. Each network connection uses a file handler therefore if the limit is too low you can quickly run out of handlers and the server can not accept any more connections. 

This limit is set on 2 levels - on the kernel level (fs.file-max) and on the system level (nofile). Another kernel property which can be important in certain configurations (like transports installations or when you use proxy for Bosh connections) is: net.ipv4.ip_local_port_range. This parameter can be set the same way as the fs.file-max property.
fs.file-max

The fs.file-max kernel property is set via sysctl command. You can see current settings executing command:
view source print?
1 # sysctl fs.file-max
2 fs.file-max = 358920


If you plan to run high load service with big number of server connections then this parameter should be at least as twice big as the number of network connections you expect to support. You can change this setting executing command:
view source
print?
1 # sysctl -w fs.file-max=360000
2 fs.file-max = 360000
net.ipv4.ip_local_port_range

You can see current settings executing command:
view source
print?
1 # sysctl net.ipv4.ip_local_port_range
2 net.ipv4.ip_local_port_range = 32768 61000

You can change this setting executing command:
view source
print?
1 # sysctl -w net.ipv4.ip_local_port_range="1024 65000"
2 net.ipv4.ip_local_port_range = 1024 65000
/etc/sysctl.conf

Above commands let the system remember new settings until the next system restart. If you want to make the change permanent you have to edit file: /etc/sysctl.conf and add the property at the end of the file:
view source
print?
1 fs.file-max=360000
2 net.ipv4.ip_local_port_range=1024 65000

It will be automatically loaded next time you start the server. Command:
view source
print?
1 # sysctl -p
Causes the /etc/systcl.conf to be reloaded which is useful when you added more parameters to the file and don't want to restart the server.
nofile

This is the property used by the system limits. For example running the command ulimit -a shows you all limits set for the current user:
view source
print?

01 # ulimit -a
02 core file size (blocks, -c) 0
03 data seg size (kbytes, -d) unlimited
04 file size (blocks, -f) unlimited
05 pending signals (-i) 38912
06 max locked memory (kbytes, -l) 32
07 max memory size (kbytes, -m) unlimited
08 open files (-n) 40960
09 pipe size (512 bytes, -p) 8
10 POSIX message queues (bytes, -q) 819200
11 stack size (kbytes, -s) 8192
12 cpu time (seconds, -t) unlimited
13 max user processes (-u) 38912
14 virtual memory (kbytes, -v) unlimited
15 file locks (-x) unlimited


To make it even more interesting and more complex there are 2 types of system limits: soft limit which can be temporarily exceeded by the user and hard limit which can not be exceeded. To see your hard limit execute command:
view source
print?

01 # ulimit -a -H
02 core file size (blocks, -c) unlimited
03 data seg size (kbytes, -d) unlimited
04 file size (blocks, -f) unlimited
05 pending signals (-i) 38912
06 max locked memory (kbytes, -l) 32
07 max memory size (kbytes, -m) unlimited
08 open files (-n) 40960
09 pipe size (512 bytes, -p) 8
10 POSIX message queues (bytes, -q) 819200
11 stack size (kbytes, -s) unlimited
12 cpu time (seconds, -t) unlimited
13 max user processes (-u) 38912
14 virtual memory (kbytes, -v) unlimited
15 file locks (-x) unlimited


The hard limits are usually bigger then the soft limits or sometimes the same. For us the most important parameter is: open files. You can change the property in file: /etc/security/limits.conf. You have to append 2 following lines to the end of the file:
view source
print?
1 jabber soft nofile 350000
2 jabber hard nofile 350000


Where the jabber is the user name of the account running you IM service. You can also set the limits for all users on the machine in a following way:
view source
print?
1 * soft nofile 350000
2 * hard nofile 350000


For those changes to make an effect you have to logout from the modified account and login again. New limits should be applied. 

Retrieve Plesk Admin Pass Windows server

How can Plesk admin password be retrieved?

To Retrieve Plesk Admin Pass Windows server, follow the simple steps below


Resolution

Apart from the password reminder available on the login screen, you can use the plesksrvclient.exe utility located in %plesk_bin% folder to set up a new password or retrieve the old one.

You could set the new passsword by running the following command:
"%plesk_bin%\plesksrvclient" -set <new_password> true

You could also get the current password by running this utility with:
"%plesk_bin%\plesksrvclient" -get

To retrieve password in command line you can use -nogui option:

E.g.
"%plesk_bin%\plesksrvclient" -get -nogui > plesk_password.txt

After that you can see retrieved Plesk password in plesk_password.txt file. 

How to reset/change cPanel password?


How to reset/change cPanel password?

If you like to change/reset your cPanel password, kindly follow the steps below.

=============

1) Go to your cPanel login page.
2) Under "Password Reset"
3) Enter the "Username" of your account.
4) A reset e-mail will reach your registered email account
=============

You can also reset your password by logging into your cPanel.

=============

1) Go to "Preference"
2) Select "Change Password"
3) Enter your "Old Password"
4) Type your "New Password"
5) Click "Change your password now"

=============

Configure email account in Outlook or MS Outlook

How to configure email account in Outlook?

There are many of us who do not use Outlook for send/receive email. But it is the better option to use Outlook to send and receive emails. Configuring email account in Outlook is easier. Just follow the link below to configure Outlook in your local machine.






=============

1. Open Outlook
2. Go to Tools > Email Accounts.
3. This will bring you to the Accounts Configuration Setup.
4. Choose to Add a new E-mail Account.
5. Click Next.
6. Click on Pop3
7.At the next window please enter the following information:
1. Under User Information, enter Your Name and Email Address.
2. For Server Information, enter mail.domain.com for Incoming and mail.domain.com for
Outgoing servers.
3. For Logon Information, enter your login name and password.
Click More Settings... on the lower right hand corner of the screen.

# At the Internet E-Mail Settings, General Tab window enter the following information:
1.Give your account a name,
2.Enter a name for your Organization,
3.Enter your e-mail address or whatever address you want recipients to reply to.

#. At the Outgoing Server Tab:
1.Check the box “My outgoing server (SMTP) requires authentication”.
2.The dial button “Use same settings as my incoming mail server” should be selected.
3.Click on the Advanced Tab.

# Enter the port details
Incoming mail server: 110
outgoing mail server :25

Please uncheck the SSL option.

Click OK.





Thats it the Outlook is configured in your local machine. Now, you can send and receive emails without any issue.

Default email account configuration


Default email account configuration

Kindly follow the steps to configure the email client in the computer so that you can send/receive mails.

================

1. Incoming/Outgoing mailserver: mail.domain.com
2. Username: USERNAME@domain.com
3. Password: password of this email account
4. Outgoing mailserver port: 25 or 26 or 587 or 58700
5. Incoming mailserver port: 110 (for POP)
6. Do not check "Use SSL"
7. Do enable "My Server requires authentication"

================

Configure email account in MAC machine

How to configure email account in MAC machiane?

Configuring the email account in MAC machine is quite easier. Just follow the instructions below to configure the email account in the MAC machine.


1. Open Mac Mail and then click File, Add Account....


2. Enter the POP3 server assigned to you within the Incoming Mail Server field(mail.domain.com). Your User Name is your complete email address. Finally, enter your password and click Continue.


3. On the Incoming Mail Security tab, ensure that Use Secure Sockets Layer (SSL) is unchecked and the Authentication method is Password. Click Continue.


4. On the Outgoing Mail Server tab, enter the SMTP server provided to you within the Outgoing Mail Server option(mail.bwdesigngrp.com). Check the box for Use Authentication, then your complete email address within the User Name field. Enter your password, then click Continue.


5. On the Outgoing Mail Security tab, ensure that Use Secure Sockets Layer (SSL) is unchecked and the Authentication method is Password. Click Continue.


6. On the Account Summary page, review the values for accuracy, then click Continue.


7. On the Conclusion page, click Done.

Try sending mails now. If you face any issues, then there is a possibility that your ISP is blocking the standard SMTP port 25(to avoid spamming), so try connecting with port 26. The configuration steps are as follows:

* Within the Account tab in Preferences click on the Server Settings... button. In the popup, change the Server port from 25 to 26. Ensure that Use Secure Sockets Layer (SSL) is unchecked and that Authentication is set to Password. Enter your complete email address as the User Name and provide your password within the appropriate field. Click OK.

* When you close the window you will be prompted to Save Changes. Be sure to click Save.