Saturday, 13 June 2009

Simple steps of changing your exim IP

Hey Remeber : You need to set RDNS for the IP then and then Only you can proceed further.

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

Below are some simple steps of changing your exim IP

Inside both incoming and outgoing exim mail server you will need to add an interface :
so just edit

pico /etc/exim_outgoing.conf

and

pico /etc/exim.conf

find
remote_smtp:
driver = smtp

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

example as shown below:

________________________
remote_smtp:
driver = smtp
interface = 22.22.22.22
_________________________

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

Important Directories In Linux

* /bin - essential UNIX commands such as ls, etc. Should contain all binaries needed to boot the system or run it in single-user mode…………… * /boot - files used during booting and possibly the kernel itself are stored here

* /dev - contains device files for various devices on system

* /etc - files used by subsystems such as networking, NFS, and mail. Includes tables of disks to mount, processes to run on startup, etc.

* /etc/profile.d - contains scripts that are run by /etc/profile upon login.

* /etc/rc.d - contains a number of shell scripts that are run on bootup at different run levels. There is also typically an rc.inet1 script to set up networking (in Slackwar), an rc.modules script to load modular device drivers, and an rc.local script that can be edited to run commands desired by the administrator, along the lines of autoexec.bat in DOS.

* /etc/rc.d/init.d - contains most of the initialization scripts themselves on an rpm-based system.

* /etc/rc.d/rc*.d - where “*” is a number corresponding to the default run level. Contains files for services to be started and stopped at that run level. On rpm-based systems, these files are symbolic links to the initialization scripts themselves, which are in /etc/rc.d/init.d.

* /etc/skel - directory containing several example or skeleton initialization shells. Often contains subdirectories and files used to populate a new user’s home directory.

* /etc/X11 - configuration files for the X Window system

* /home - home directories of individual users

* /lib - standard shared library files

* /lib/modules - modular device driver files, most with .o extensions

* /mnt - typical mount point for many user-mountable devices such as floppy drives, cd-rom readers, etc. Each device is mounted on a subdirectory of /mnt.

* /proc - virtual file system that provides a number of system statistics

* /root - home directory for root

* /sbin - location of binaries used for system administration, configuration, and monitoring

* /tmp - directory specifically designed for programs and users to store temporary files.

* /usr - directory containing a number of subdirectory with programs, libraries, documentation, etc.

* /usr/bin - contains most user commands. Should not contain binaries necessary for booting the system, which go in /bin. The /bin directory is generally located on the same disk partition as /, which is mounted in read-only mode during the boot process. Other filesystems are only mounted at a later stage during startup, so putting binaries essential for boot here is not a good idea.

* /usr/bin/X11 - most often a symbolic link to /usr/X11R6/bin, which contains executable binaries related to the X Window system

* /usr/doc - location of miscellaneous documentation, and the main location of program documentation files under Slackware

* /usr/include - standard location of include files used in C programs such as stdio.h

* /usr/info - primary location of the GNU info system files

* /usr/lib - standard library files such as libc.a. Searched by the linker when programs are compiled.

* /usr/lib/X11 - X Window system distribution

* /usr/local/bin - yet another place to look for comon executables

* /usr/man - location of manual page files

* /usr/sbin - other commands used by superuser for system administration

* /usr/share - contains subdirectories where many installed programs have configuration, setup and auxiliary files

* /usr/share/doc - location of program documentation files under Mandrake and Red Hat

* /usr/src - location of source programs used to build system. Source code for programs of all types are often unpacked in this directory.

* /usr/src/linux - often a symbolic link to a subdirectory whose name corresponds to the exact version of the Linux kernel that is running. Contains the kernel sources.

* /var - administrative files such as log files, used by various utilities

* /var/log/packages - contains files, each of which has detailed information on an installed package in Slackware. The same file can also be found at /var/adm/packages, since the adm subdirectory is a symbolic link to log. Each package file contains a short description plus a list of all installed files.

* /var/log/scripts - package installation scripts in Slackware are stored here. You can inspect these scripts to see what special features are included in individual packages.

* /var/spool - temporary storage for files being printed, mail that has not yet been picked up, etc.

Not able to access VZPP (Virtuozzo Power Panel) for a VE.

Resolution

Make sure that “offline management” for the VE is enabled:

# grep OFFLINE_MANAGEMENT /etc/sysconfig/vz-scripts/VE_ID.conf
OFFLINE_MANAGEMENT="yes"


If “offline management”  is disabled (set to “no”), you have to enable it:

# vzctl set VE_ID --offline_management yes --save

Wednesday, 10 June 2009

Unable login into the domain stats - Plesk

Search for the following entry in the /var/www/vhosts/domainName/conf/httpd.include: (/var/www/vhosts/domainName/conf/httpd.include is actually HTTPD_VHOSTS_D/domainName/conf/httpd.include):

AuthType Basic

AuthName "Domain statistics"

AuthUserFile /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat

require valid-user

Create the encrypted password using the (htpasswd generator):

http://home.flash.net/cgi-bin/pw.pl

(ex. testUser:sad#^hu78is45tsgf)

OR You can Also generate the encrypted password using the "htpasswd" command:

htpasswd -bdc

(eg. htpasswd -bdc testfile testUser testPass

Adding password for user testabc

# cat testfile

testUser:sad#^hu78is45tsgf

)

Append the obtained entry to the AuthUserFile (Here it is /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat).

cat >> /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat

testUser:sad#^hu78is45tsgf

Search for the following entry in the /var/www/vhosts/domainName/conf/httpd.include: (/var/www/vhosts/domainName/conf/httpd.include is actually HTTPD_VHOSTS_D/domainName/conf/httpd.include):
AuthType BasicAuthName "Domain statistics"AuthUserFile /var/www/vhosts/domainName/pd/d..httpdocs@plesk-statrequire valid-user

Create the encrypted password using the (htpasswd generator):http://home.flash.net/cgi-bin/pw.pl(ex. testUser:sad#^hu78is45tsgf)
OR You can Also generate the encrypted password using the "htpasswd" command:htpasswd -bdc(eg. htpasswd -bdc testfile testUser testPassAdding password for user testabc# cat testfiletestUser:sad#^hu78is45tsgf)
Append the obtained entry to the AuthUserFile (Here it is /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stat).cat >> /var/www/vhosts/domainName/pd/d..httpdocs@plesk-stattestUser:sad#^hu78is45tsgf

Changing multiple account ownerships via SSH

How to change the ownership of multiple accounts under /home via SSH? The option in WHM is a bit tedious.

Solution :

To change the ownership of all accounts to the respective user.user :

cd /home
ls -al | grep root

for i in `ls /var/cpanel/users/`; do chown $i:$i /home/$i ; done
for i in `ls /var/cpanel/users/`; do chown -R $i:$i /home/$i/* ; done

Then change the ownership of the individual public_htmls to their respective user.nobody:

for i in `ls /var/cpanel/users/`; do chown $i:nobody /home/$i/public_html ; done

Change the permissions for public_htmls to 750:

for i in `ls /var/cpanel/users/`; do chmod 750 /home/$i/public_html ; done

Fix the permissions for mail to work fine:

/scripts/mailperm

Fix the ownership of /home:

chown root.root /home

Sunday, 31 May 2009

How to solve Unhandled Error in Silverlight Application Code: 2104


I’ve found that I get this error every time I upload a Silverlight application to a new webserver. IIS does not have the correct settings by default.
The Problem: You ftp a Silverlight App to an IIS website, go to the website in a browser, and get the following error:
Message: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings
The Cause: The Silverlight Mime types (.xaml, .xap and .xbap) are not listed in that websites registered mime types, therefore IIS will not send those files to the browser.
The Solution: Open IIS on the server, go to HTTP headers, click on Mime Types, click “Add New” and add the following:
Extension – Mime Type
.xaml – application/xaml+xml
.xap – application/x-silverlight-app
.xbap – application/x-ms-xbap
Hit Apply and your application will load!

Thursday, 14 May 2009

How To Add DomainKeys and SPF Records on CPanel Servers

This how to describe how to add domainkeys and SPF (Sender Policy Framework) records on CPanel Servers. Whenever you create a domain on CPanel server using WHM, it wont add domainkeys and SPF records for particular domains. To add domainkeys and SPF records please use following steps.

We consider here we have a domain sohailriaz.com with cpanel username sohailri

Please note on CPanel servers most of the work is done using cpanel username which then reflect setting on particular domains. If you have several domains / sub domains under one username, it will add domainkeys and SPF records for all domains / subdomains.

Execute the following command on your CPanel server using root.

1 DomainKeys


1.1 Add DomainKeys for single user


/usr/local/cpanel/bin/domain_keys_installer sohailri

where sohailri is a username

1.2 Add DomainKeys for all CPanel users.


If you wish to add DomainKeys for all Cpanel users on your server, execute following command.
ls /var/cpanel/users | while read a; do
/usr/local/cpanel/bin/domain_keys_installer $a
done

2 SPF (Sender Policy Framework)


2.1 Add SPF for single account.


/usr/local/cpanel/bin/spf_installer sohailri

2.2 Add SPF for all Cpanel accounts.


If you want to add SPF records for all cpanel accounts exist on your server then use the following command.
ls /var/cpanel/users | while read a; do
/usr/local/cpanel/bin/spf_installer $a
done

3 Enable DomainKeys and SPF for every new CPanel account.


If you want to add DomainKeys and SPF for every new account created on Cpanel, then do the following.
vi /scripts/postwwwacct

postwwwacct is a file which execute after wwwacct (used to create account), paste following lines in the file
#!/usr/bin/perl

my %OPTS = @ARGV;
$ENV{USER} = “$OPTS{‘user’}”;
system q(/usr/local/cpanel/bin/domain_keys_installer $USER);
system q(/usr/local/cpanel/bin/spf_installer $USER);