Sunday 18 August 2013

Windows Live Mail to store Sent Items on the IMAP Server

Windows Live Mail to store Sent Items on the IMAP Server


The following solution works on our mail servers,

Setting up Windows Live Mail for IMAP

  1. In Windows Mail Click on the Tools menu
  2. Then click on Accounts
  3. Select your IMAP account from the list of accounts
  4. Click Properties
  5. Then click the IMAP tab, you will get a window like the picture to the right.
  6. Type Inbox in the Root Folder Path box.
  7. Make sure that Store special folders on IMAP server is selected
  8. You should also change the 4 path names to match those actually used by your server, so Sent Items should be changed to Sent, Deleted Items to Trash
    If you don’t do this everything will still work ok but you will end up with some sent items (from Windows Mail) in the Sent Items folder and others (from other email clients or from Webmail) in the Sent folder.
  9. Save your changes, Windows Live Mail will need to rebuild your folder list but from now on any emails you send should be stored on the IMAP server rather than in Local Folders.  It is a good idea to move the contents of your Local Sent Items folder to the new IMAP Sent folder

Recover individual Files and Folders in windows server 2008 & 2012

Recover individual Files and Folders in windows server 2008 & 2012

You can use the Recovery Wizard in Windows Server Backup to recover files and folders from a backup. Before you begin, you should:
  • Make sure at least one backup exists on an external disk or in a remote shared folder—you cannot recover files and folders from backups saved to DVDs or removable media. In addition, if you are recovering a computer running Windows Server 2008, make sure that the backup is not a system state backup. File and folder recovery is not possible from a system state backup. For instructions for creating a backup for file and folder recovery, see Configuring Automatic Backups and Performing a Manual Backup.
  • Make sure the external disk or remote shared folder that is hosting the backup is online and available to the server.
  • Determine what files or folders that you want to recover.

To recover files and folders using the Windows Server Backup user interface

  1. From the Start menu, click Administrative Tools , and then click Windows Server Backup .
  2. In the Actions pane of the snap-in default page, under Windows Server Backup , click Recover . This opens the Recovery Wizard.
  3. On the Getting Started page, do one of the following and then click Next :
    • Click This server .
    • Click Another server . On the Specify Location Type page, do one of the following and then click Next :

      • Click Local drives . On the Select Backup Location page, select the volume or drive that contains the backup from the drop-down list. On Select Server , select the server whose data you want to recover.
      • Click Remote shared folder . On the Specify Remote Folder page, type the path to the folder that contains the backup. In the folder, the backup should be stored at \\< RemoteSharedFolder >\WindowsImageBackup \< ComputerName >\< YourBackup >.
  4. On the Select Backup Date page, select the date from the calendar and the time from the drop-down list of backup you want to restore from. Then click Next .
  5. On the Select Recovery Type page, click Files and folders , and then click Next .
  6. On the Select Items to Recover page, under Available items , expand the list until the folder you want is visible. Click a folder to display the contents in the adjacent pane, click each item that you want to restore, and then click Next .
    NOTE: The SHIFT and CTRL keys will enable you to select a group or specific set of items.
  7. On the Specify Recovery Options page, under Recovery destination , do one of the following:
    • Click Original location .
    • Click Another location . Then, type the path to the location, or click Browse to select it.
  8. Under When this wizard find items in the backup that are already in the recovery destination , click one of the following, and then click Next :
    1. Create copies so you have both versions 
    2. Overwrite the existing versions with the recovered versions
    3. Do not recover the items that already exist on the recovery destination
  9. Under Security settings , select the Restore access control list (ACL) permissions to the file or folder being recovered check box, if needed, and then click Next .
  10. On the Confirmation page, review the details, and then click Recover to restore the specified items.
  11. On the Recovery progress page, you can view the status of the recovery operation and whether or not it was successfully completed.

Additional considerations

  • To recover files and folders from a backup using Windows Server Backup, you must be a member of the Backup Operators or Administrators group, or you must have been delegated the appropriate authority. If a volume being restored has restricted permissions, the files and folders in the volume will not be displayed in the Restore wizard if the Administrators or Backup Operators groups do not have permissions and ownership of the files that you want to restore. However, you can perform a block level backup and restore using volume recovery without these permissions.
  • You can also perform this task remotely for another server using the Connect To Another Computer option in the Windows Server Backup Microsoft Management Console (MMC) snap-in. Make sure that you are a member of the Administrators or Backup Operators group on the remote server. If you are a Backup Operator, ensure that the Distributed Component Object Model (DCOM) security settings on the remote computer are set to allow Backup Operators to connect to it.

    You can only use this feature if the local and remote servers are running the same version of Windows—either both running Windows Server 2008 or both running Windows Server 2008 R2. In addition, you cannot use this feature to manage a computer running any version of Windows client operating system.

Saturday 17 August 2013

How Do I Enable SMTP Authentication in Outlook

How Do I Enable SMTP Authentication in Outlook?


Many user's face similar issue in enabling SMTP authentication in the Outlook. They face different error code in authenticating the email account. To enable SMPT authentication in various versions of outlook, kindly follow the steps below.


Microsoft Outlook Express 

  1. From the Tools menu, choose "Accounts."
  2. Select the "Mail" tab.
  3. Double-click the Mail account (e.g. mail.example.com)
  4. Select the "Servers" tab.
  5. Check the box next to "My Server Requires Authentication."
  6. Select the "Advanced" tab.
  7. In the Server Port Numbers section, modify "Outgoing mail (SMTP):" to "25 or 26 or 587".
  8. Click "OK" 


Microsoft Outlook 2010 and 2013

  1. From the File menu, select "Info" and choose "Account Settings"
  2. Select your Email account and click the "Change" button above.
  3. Click the "More Settings" button in the bottom-right corner of the E-Mail Accounts window.In the Internet Email Settings window, click the "Outgoing Server" tab.
  4. Ensure that the box next to "My outgoing server (SMTP) requires authentication" is checked and "use same settings as my incoming mail server" is selected.
  5. Click the "Advanced" tab and make sure that "Use the following type of encrypted connection" is set to "None" for the outgoing (SMTP) port settings.
  6. Change the outgoing server port to 25 or 26 or 587.
  7. Click Ok and Finish.


Microsoft Outlook 2007

  1. From the Tools menu, select "Account Settings"
  2. Select your Email account and click the "Change" button above..
  3. Click the "More Settings" button in the bottom-right corner of the E-Mail Accounts window.
  4. In the Internet Email Settings window, click the "Outgoing Server" tab. Ensure that the box next to "My outgoing server (SMTP) requires authentication" is checked and "use same settings as my incoming mail server" is selected.
  5. Click the "Advanced" tab and make sure that "Use the following type of encrypted connection" is set to "None" for the incoming (POP3) and the outgoing (SMTP) port settings. Change the outgoing server port to 25 or 26 or 587
  6. Click ok.


Microsoft Outlook 2003 and 2002/XP 

  1. From the Tools menu, select "Email Accounts."
  2. Select "View or change existing email accounts" and click "Next."
  3. Select your Email account and click the "Change" button on the right.
  4. Click the "More Settings" button in the bottom-right corner of the E-Mail Accounts window.
  5. In the Internet Email Settings window, click the "Outgoing Server" tab.
  6. Ensure that the box next to "My outgoing server (SMTP) requires authentication" is checked.
  7. Click the "Advanced" tab and make sure that you have not selected "This server requires a secure connection (SSL)" under the incoming (POP3) or outgoing (SMTP) port settings.Ougoing server port is 25 or 26 or 587.

Synchronizing subscribed folders for (email address )' reported error (0x800CCC0F) outlook

Synchronizing subscribed folders for (my email address)'  reported error (0x800CCC0F) inOutlook

Few users will get the following error in Outlook 2010 while they keeps getting failed even though with correct SMTP settings. Refer the error message displayed below.

'Synchronizing subscribed folders for ( my email address )'  reported error (0x800CCC0F) : 'Outlook cannot synchronize subscribed folders for  ( my email address ).  Error: This IMAP command cannot be sent to the server before the connection was terminated. If you continue to receive this message, contact your server administrator or Internet service provider (ISP)'


To fix this issue permanently, kindly follow the steps below.

Solution 1:


Outlook 2010 opened in the Mail section, I clicked on:
1.       File, Options, Advanced
2.       Send/Receive... button on the right side under Send and receive
3.       Edit... (on right sidefor All Accounts
4.       Check the circle for "Use the custom behavior defined below"
5.       Check all the folders desired and Check the circle for "Download complete item including            attachments", 
          Closed out all the windows with OK and/or Close, and no more error messages!

Solution 2:

  1. Navigate to File >> Options >> Advanced >> scroll down to the send/receive heading >> click on thesend/receive button on the right
  2. On the right hand side of the send/receive groups window that opens click on the Edit button
  3. Un-check the "Get folder unread count for subscribed folders"
  4. Under Received mail items, check the option "User the custom behavior defined below"
  5. In the window below that displays your Gmail folders just select inbox and leave the others unchecked
  6. Click Ok and then exit out of options and perform a send/receive to test if it is now working
This worked for me.

Tuesday 9 October 2012

cPanel in Command line


Contact Information & Preferences
Change the email address inside of cPanel for alert emails.
# grep CONTACT /var/cpanel/users/username
Modify the above lines in the users file and run: /scripts/updateuserdomains

Email Notification settings
Modify the below lines to affect emails being sent on quota hits.
# grep notify /home/username/.cpanel/contactinfo

Change Style
# grep RS /var/cpanel/users/username
Change the above line and run /scripts/updateuserdomains

Change Language
# grep LANG /var/cpanel/users/username
Change the above line to the language of choice and run /scripts/updateuserdomains

Change Owner
# grep OWNER /var/cpanel/users/username
Owner should be set to root for a shared account or the reseller user for a reseller/resold account. Run /scripts/updateuserdomains after making any changes to the owner.

Email Accounts
List all Email accounts.
# user=ausisdha; gawk -F":" '{ print $6 }' /home/$user/etc/*/passwd |gawk -F"/" '{ print $6"@"$5 }'

Create Email accounts
# /scripts/addpop user@domain.com e60aGlvJpdts

Spam Assassin
Enable Spamassassin (to disable remove the file)
# touch /home/username/.spamassassinenable
# chown username. /home/username/.spamassassinenable

Adjust required_score (the score required to mark the email as spam, lower numbers will create more positives) Default value is 5.
# grep required_score /home/username/.spamassassin/user_prefs

Add domain blacklist (will mark email from this domain as spam)
# echo "blacklist_from domain.com" >> /home/username/.spamassassin/user_prefs
# tail /home/username/.spamassassin/user_prefs

Add domain whitelist (will mark all email from domain as non-spam)
# echo "whitelist_from *@domain.com" >> /home/username/.spamassassin/user_prefs
# tail /home/username/.spamassassin/user_prefs

enable Spam Auto Delete
# wget -qO /home/username/.cpanel/filter.yaml http://toolbox.hostgator.com/ccranford/filter.yaml
# chown username. /home/username/.cpanel/filter.yaml

Forwarders
All forwards are in /etc/valiases/domain.com
# cat /etc/valiases/ausisdhaka.net

Auto Responders
When an auto responder is created, cPanel will ad a virtual host entry that will call the autorespond application and then check the configuration that it will create in the /home/username/.autorespond directory for more information.
# grep autorespond /etc/valiases/biwere.info

Default Address
This would be a catch all setup for the default user of *: in the aliases file.
# grep "^*:" /etc/valiases/domain.com

Mailing Lists
Show all mailing lists ( add a domain on the end to see all mailing lists for that domain ).
# /usr/local/cpanel/3rdparty/mailman/bin/list_lists -b

Show all members on a mailing list
# /usr/local/cpanel/3rdparty/mailman/bin/list_members

User Level Filtering
Best performed inside of the cPanel interface as it does have cache files that are created and the syntax requires to locations.
# /home/username/etc/domain_name/email_account/filter.yaml
# /home/username/etc/domain_name/email_account/filter

Account Level Filtering
Best done through the cPanel interface.
# cat /home/username/.cpanel/filter.yaml

Disk Space Usage
Run from the users home directory, proceed top down to find diskspace issues.
# find -maxdepth 1 -exec du -sk {} \;|sort -rn|head | while read size loc; do echo "scale=2; $size/1024" | bc|gawk '{ print $1"MB '"$loc"' " }';done|column -t
cd tmp
# find -maxdepth 1 -exec du -sk {} \;|sort -rn|head| while read size loc; do echo "scale=2; $size/1024" | bc|gawk '{ print $1"MB '"$loc"' " }';done|column -t

Security Questions
To add a “trusted” IP for the user root add the IP address to the following file:
# /var/cpanel/userhomes/cpanel/.cpanel/securitypolicy/iplist/root

Sunday 8 July 2012

Install ASL-Lite in Linux servers

ASL Lite is a free unsupported lightweight rule updater and basic modsecurity setup project designed specifically as an atomicorp.com mod_security rule downloader for custom apache environments or non-apache/mixed web server implementations. It will on a standard system maintain modsecurity rules to the current version automatically, and upon installation will attempt to determine if modsecurity is installed on the system, and if so, what version if installed. If modsecurity is not installed, it will attempt to install it, and if the installed version is out of date it will attempt to upgrade it to the latest stable version.
For more info: http://www.atomicorp.com/wiki/index.php/ASL_Lite

1. wget -q -O – http://www.atomicorp.com/installers/asl-lite | sh

2. Compare the dates to make sure the security module is the latest.

date

ls -l /usr/local/apache/modules/mod_security2.so

3. Make all the required folders and put them in the right permission

mkdir -v /usr/local/apache/conf/modsec_rules/
cp -pv
/home/cpeasyapache/src/modsecurity-apache_2.5.13/rules/util/modsec-clamscan.pl
/usr/local/apache/conf/modsec_rules/modsec-clamscan.pl
chmod -v /var/asl
chmod -v 705 /var/asl/data
chown nobody.nobody /var/asl/data/msa
chown nobody.nobody /var/asl/data/audit
chown nobody.nobody /var/asl/data/suspicious
chmod o-rx -R /var/asl/data/

chmod ug+rwx -R /var/asl/data/



4. Verify if mod_security is being called correctly.

# cat /usr/local/apache/conf/modsec2.user.conf
=========
SecRequestBodyAccess On
SecAuditLogType Concurrent
SecResponseBodyAccess On
SecResponseBodyMimeType (null) text/html text/plain text/xml
SecResponseBodyLimit 2621440
SecAuditLogRelevantStatus "^(?:5|4(?!04))"
SecServerSignature Apache
SecRule FILES_TMPNAMES "@inspectFile /usr/local/apache/conf/modsec_rules/modsec-clamscan.pl" "log,auditlog,deny,status:403,severity:2,phase:2,t:none,id:'1010101'"
SecUploadDir /var/asl/data/suspicious
SecUploadKeepFiles Off
SecAuditLogParts ABIFHZ
SecArgumentSeparator "&"
SecCookieFormat 0
SecRequestBodyInMemoryLimit 131072
SecDataDir /var/asl/data/msa
SecTmpDir /tmp
SecAuditLogStorageDir /var/asl/data/audit
SecResponseBodyLimitAction ProcessPartial
SecPcreMatchLimit 50000
SecPcreMatchLimitRecursion 50000
Include /usr/local/apache/conf/modsec_rules/10_asl_antimalware.conf
Include /usr/local/apache/conf/modsec_rules/10_asl_rules.conf
Include /usr/local/apache/conf/modsec_rules/20_asl_useragents.conf
Include /usr/local/apache/conf/modsec_rules/30_asl_antispam.conf
Include /usr/local/apache/conf/modsec_rules/50_asl_rootkits.conf
Include /usr/local/apache/conf/modsec_rules/60_asl_recons.conf
Include /usr/local/apache/conf/modsec_rules/99_asl_jitp.conf
Include /usr/local/apache/conf/modsec_rules/whitelist.conf
========= 

#cat  /usr/local/apache/conf/modsec2.conf
====
 LoadFile /opt/xml2/lib/libxml2.so
 LoadFile /opt/lua/lib/liblua.so
LoadModule security2_module  modules/mod_security2.so
<IfModule mod_security2.c>
SecRuleEngine On
# See http://www.modsecurity.org/documentation/ModSecurity-Migration-Matrix.pdf
#  "Add the rules that will do exactly the same as the directives"
# SecFilterCheckURLEncoding On
# SecFilterForceByteRange 0 255
SecAuditEngine RelevantOnly
SecAuditLog logs/modsec_audit.log
SecDebugLog logs/modsec_debug_log
SecDebugLogLevel 0
SecDefaultAction "phase:2,deny,log,status:406"
SecRule REMOTE_ADDR "^127.0.0.1$" nolog,allow
Include "/usr/local/apache/conf/modsec2.user.conf"
</IfModule>
 ====

 In httpd.conf file, make sure that, following entry is available. 
======
Include "/usr/local/apache/conf/modsec2.conf"
======

Configure ASL-Lite, update the rules, and put it in cron and Configure with username “username” and password “password”
======

asl-lite -c

Install the cron “0 5 /var/asl/bin/asl-lite -u”

asl-lite -u

======

Monitor logs for 30 mins to see if there are any errors

tail -f /usr/local/apache/logs/error_log

tail -f /usr/local/apache/logs/modsec_audit.log

Add ASL ClamAV rules and restart ClamD

Check what is the latest clamd signature by going to
www.atomicorp.com/channels/rules/subscription

Download the latest rule using
/usr/bin/wget—no-cache -q -P /usr/local/src/

Replace clamav-201107071712.tar.gz with whatever the latest rule is

Untar the file, change ownership and place it in ClamAV rules folder


cd /usr/local/src/
tar xzvf clamav-201107071712.tar.gz
cd /usr/local/src/clamav
mv -v ASL /usr/share/clamav
cd /usr/share/clamav
chown -v clamav.clamav ASL*

and ASL lite installation is completed successfully!

Saturday 30 June 2012

RVsitebuilder Installation in cPanel

How to install RVsitebuilder in cPanel?

 1. SSH to your cPanel server as root and run command 

/scripts/makecpphp

2. Download the installer using the command below: 

cd /usr/local/cpanel/whostmgr/docroot/cgi/ 
rm -rf /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/ 
rm -f rvsitebuilderinstaller.tar
wget http://download.rvglobalsoft.com/rvsitebuilderinstaller.tar
tar -xvf rvsitebuilderinstaller.tar
chmod 755 addon_rvsitebuilder.cgi 
rm -f rvsitebuilderinstaller.tar

3. Open root WHM, at the left menu under Plugins section, you will find RVSiteBuilder Installer menu.

4. Click RVSiteBuilder Installer to begin the installation process.

5. After complete the installation, you will be sent to RVSiteBuilder Manager automatically. Please configure RV SiteBuilder immediatly.

Done!! Your cPanel should show the RVSiteBuilder as a feature in all cPanel users. Special note for specific cPanel skin:


  • RVSkin - It will automatically integrate RVSiteBuilder to RVSkin. You may need to edit the Package-Feature list if RVSite Builder doesn't show up, or you don't want some hosting packages access to it.



  • X3, X Skin and some which support addon api - It will automatically display on cPanel. You are also able to manage the feature list in WHM Feature Manager.



  • CPSkins - You have to manually integrate it by editting file /usr/local/cpanel/base/frontend/themename/index.html. Insert on the top of the page, and edit /usr/local/cpanel/base/frontend/themename/main.php. Place in the area you want to show the RVSiteBuilder Icon. Don't edit file RVS2CPSkinmenu.html. Your change will be lost when you update RVSiteBuilder. If you want to edit it, just copy its name and change the cpanel include path to the new one.

Monday 25 June 2012

Hardening the linux server or cenos 5/6.2

How to harden the centos 5 or centos 6.2



SPRI (Priority Scheduler)
cd /root/
wget http://www.rfxn.com/downloads/spri-current.tar.gz
tar xvfz spri-*.tar.gz
cd spri-*
./install.sh
spri -v



PRM (Process Resource Monitor)
cd /root
wget http://www.rfxn.com/downloads/prm-current.tar.gz
tar xvfz prm-*.tar.gz
cd prm-*
./install.sh
prm -j




Temporary Directory Hardening
-----------------------------

/bin/cp /etc/fstab /etc/fstab.bak


Use df to check if a /tmp partition is already present.

[if no /tmp partition present]
cd /usr
dd if=/dev/zero of=/usr/tmpMnt bs=1024 count=2000000


mke2fs -j /usr/tmpMnt


cd / 
cp -R /tmp /tmp_backup 


mount -o loop,noexec,nosuid,rw /usr/tmpMnt /tmp 
chmod 0777 /tmp 
/bin/cp -R /tmp_backup/* /tmp/ 
rm -rf /tmp_backup 


nano -w /etc/fstab 




At the very bottom add 
/usr/tmpMnt /tmp ext3 loop,noexec,nosuid,rw 0 0


nano -w /etc/fstab
change “defaults” to loop,noexec,nosuid,rw
mount /tmp


rm -rf /var/tmp
ln -s /tmp /var/tmp



If a symlink is not possible, then /var/tmp is most likely also a partition. In this case, /var/tmp must be hardened with loop,noexec,nosuid,rw in fstab as well.



IF /tmp is hardened by cpanel’s /scripts/securetmp. Remove the line from /etc/rc.d/rc.local and then reboot. It will come back without a /tmp partition and then you can follow the instructions above



SSH Server Hardening
---------------------

nano -w /etc/ssh/sshd_config



Uncomment #Protocol 2, 1
Change to Protocol 2


Append these lines to the bottom:
LoginGraceTime 120 


IgnoreRhosts yes 


X11Forwarding no 




/etc/rc.d/init.d/sshd restart


DISABLE DIRECT ROOT LOGIN


If he already has an su user, good. If not:


REPLACE XXX with 3 numbers


groupadd anyuserxxx
useradd anyuserXXX –ganyuserXXX
passwd anyuserXXX
type password


nano -w /etc/group
Search for wheel, then append “anyuserxxx” 


So it should be “root,anyuserXXX”


nano -w /etc/ssh/sshd_config


PermitRootLogin no (and uncomment)


At the bottom add
AllowUsers anyuserXXX




ChkRootKit
--------------
cd /root/
wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
mv chkrootkit.tar.gz /usr/local/src/
cd /usr/local/src/
tar -zxf chkrootkit.tar.gz
cd /usr/local/src/chkrootkit*
make sense
cd /root
mv /usr/local/src/chkrootkit* /usr/local/chkrootkit



cd /etc/cron.weekly

Code: Select all

#!/bin/bash


EMAIL=your@domain.com


/usr/local/chkrootkit/chkrootkit -q | mail -s "ChrootKit Scan Report - $(hostname)" $EMAIL


chmod 755 /etc/cron.weekly/chkrootkit.sh




RkHunter
------------

cd /root

wget http://space.dl.sourceforge.net/project/rkhunter/rkhunter/1.3.8/rkhunter-1.3.8.tar.gz

wget http://space.dl.sourceforge.net/project/rkhunter/rkhunter/1.3.8/rkhunter-1.3.8.tar.gz
tar -zxf rkhunter-1.3.4.tar.gz
cd rkhunter*
./installer.sh --layout default --install




cd /etc/cron.weekly

Code: Select all


#!/bin/bash

EMAIL=your@domain.com
rkhunter  -c --sk --summary -q |  mail -s "Rkhunter Scan Report - $(hostname)" $EMAIL


chmod 755 /etc/cron.weekly/rkhunter.sh




Installing CSF firewall
------

wget http://www.configserver.com/free/csf.tgz

tar -xzf csf.tgz

cd csf

sh install.sh



Next, test whether you have the required iptables modules:



perl /etc/csf/csftest.pl


Thursday 21 June 2012

./wp-blog-header.php error [function.require]:failed to open stream


You have installed Wordpress and are seeing the following error:
Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in "\xyz\xyz.com\wwwroot\index.php" on line 17
Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in "\xyz\xyz.com\wwwroot\index.php" on line 17
This is most likely because you have installed wordpress into the wwwroot instead of a sub-directory.  Wordpress be default assumes it will be installed in a sub-directory.

To solve this problem, modify the index.php file as follows only if your WordPress installation is running in your root directory. You only need to change the following line:
require('./wp-blog-header.php');
To this:
require('wp-blog-header.php');
If your WordPress installation is not running in the root directory, then you just need to insert the path to your header file.  

Sunday 17 June 2012

Install/upgrade curl in Litespeed webserver

How to install Curl in LiteSpeed webserver?

Kindly follow the steps below to know how to install curl in litespeed webserver.


1) Go to lsws directory


# cd /opt/lsws/phpbuild/php-5.2.6/

2) Check the compiled modules with litespeed and check the current status.

# cat config.nice
# cat config.status
#cat config.nice

3) Now you need to recompile the litespeed with the module

# ./configure --prefix=/opt/lsws/lsphp5 --with-litespeed --with-config-file-path=../php --with-mysql=../mysql --with-zlib --with-zlib-dir=.. --with-gd --with-jpeg-dir=.. --with-png-dir=.. --enable-shmop --enable-track-vars --enable-sockets --enable-sysvsem --enable-sysvshm --enable-magic-quotes --with-curl=/opt/curlssl/
# make
# make test
# make install

Once the installation is complete, you can check the compiled modules using the following command

# /opt/lsws/lsphp5/bin/php -m
# /opt/lsws/lsphp5/bin/php -i |grep curl 


Thats it Litespeed is compiled with CURL module. :) 

-= by Hemanth =-

Saturday 16 June 2012

Remove a space in front of word or words in a file

How to remove space in front of a word in a file?



Just use this command to remove the space in front.

cat filename |cut -d":" -f2 |sort | sed -e 's/^[ \t]*//'

Now it will show you the output. If you want the output added inside a file just use this 

 cat filename |cut -d":" -f2 |sort | sed -e 's/^[ \t]*//' > filename.txt

Mailscanner : Allow extensions like .docx, .dox,

How to allow some other extensions like .docx, .app and etc in the mailscanner?

I have followed this post to allow the .zip extensions to  in the mailscanner.

http://linux-bloggers.blogspot.in/2012/06/mailscanner-allow-zip-tar-gz-extension.html


However, when I am trying to send email of my word doc and other files, that are being blocked by mailscanner. How to allow it?

Solution:-

You have two solutions to solve the issue.

Solution1:- Disable the SPAM scanner and virus scanner for that user alone via cPanel.
1) Go to cPanel > Emails > Mailscanner configuration.
2) Select the the domain name under SPAM and VIRUS option set it the options to "NO" and save the settings.

This will allow that domain to send emails with all the extensions.

Solution2:-


This is serverwide changes. Where the editing will reflect to all the domain in the server.

1) Login to the server with the root access
2) locate the file name "filename.rules.con"

in cPanel server it will be available in /etc/MailScanner/filename.rules.con

3) vi /etc/MailScanner/filename.rules.con
4) in that file, find the place which has specified "allow"
5) add the following syntax to allow the extension


allow \.docx$ - -
allow \.xlsx$ - -
allow \.app - -
allow \.x(ml)?\d{0,}\.rel$ - - 

Save the file and restart your mail scanner. Thats it. Your mailscanner will allow the specified extensions to all the domain in the server.

Note: When you add the syntax " allow \.docx$ - - ", you should use "TAB key" to leave a space between them. DO NOT use "spacebar" to leave the space. Beware!!!!! ;-)

Mailscanner: allow .zip .tar .gz extension in email

How can I configure MailScanner to allow zip/archive files through even if they contain an exe file or other potentially dangerous filename or filetype?

You can configure MailScanner to not check archives (zip, tar.gz etc).

 1) Go to WHM > MailScanner > MailScanner Configuration

and search for 'Maximum Archive Depth'.

2) Change that to 0 to disable it.

That's it. The mailscanner will allow the .zip, .tar and etc. The attachments will still be scanned for viruses.

Friday 8 June 2012

Authentication erorr IIS home page

When you try to access the website, you will be getting an error message stating as follows:

=====
Authorization Error
=====

Its a known issue if you are running Plesk with IIS.

You can resolve the issue by performing the following.

===========
 

Anonymous access to the site was enabled in IIS:>IIS -> Web site -> domain.com -> Directory Security -> Enable anonymous access




Remove the .Security file from C:\Inetpub\vhosts\domain.com and reconfigure vhost via the following command: C:\Program Files\Parallels\Plesk\admin\bin>websrvmng --reconfigure-vhost --vhost-name=domain.com 

 
If the passwords for system user and IIS user seemed to be out of synchronization, change the password for IIS user on that domain and do the same in Computer Management -> Local Users and Settings -> Users -> IUSR_domain
Verify other domains are not having the same issue.

After performing the above, execute the following command from command prompt.
websrvmng --reconfigure-vhost --vhost-name=domainname.com


 Have a Great Surfing!!!!!

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. :)