Xen Migration in between SolusVM Nodes




Step1: @Source Node


First of all login to the source Node.

Let you want to migrate the the VM, vm123.
Check the lvm partitions assigned for the VM, vm123. There will be a primary partitions, vm123_img and swap partition vm123_swap. You can check the details to these partitions using the following commands.

Note down the size of the VM and it's swap memory.


[root@source ~]# lvdisplay /dev/VolGroup00/vm123_img
--- Logical volume ---
LV Name /dev/VolGroup00/vm123_img
VG Name VolGroup00
LV UUID mmp1Jl-JhWN-FCzd-Gyqe-A8pF-LlvG-nfrpVx
LV Write Access read/write
LV Status available
# open 1
LV Size 20.00 GB
Current LE 640
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:10


[root@source ~]# lvdisplay /dev/VolGroup00/vm123_swap
--- Logical volume ---
LV Name /dev/VolGroup00/vm123_swap
VG Name VolGroup00
LV UUID hnZ0PL-k4y1-r3V3-2mVn-d8cK-gMGq-8JW3v1
LV Write Access read/write
LV Status available
# open 1
LV Size 512.00 MB
Current LE 16
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:11

Here vm123_img is a size of 20.00 GB and vm123_swap is a size of 512.00 MB.


Step2: @Source Node (Creating and mounting necessary LVs and creating Backup )

Create a logical volume to create and mount the backup. Give an additional 5GB space for the backup logical volume. Here in this case it is 25G after adding 5G space.

[root@source ~]# lvcreate -n vm123_backup --size 25G /dev/VolGroup00
[root@source ~]# mkfs.ext3 /dev/VolGroup00/vm123_backup
[root@source ~]# mkdir -p /home/xen/vm123_backup
[root@source ~]# mount /dev/VolGroup00/vm123_backup /home/xen/vm123_backup

It is need to shutdown the VM to create the backup.
[root@source ~]# xm shutdown vm123

Create backup of the logical voulume which mounted the vm123 using dd command.

[root@source ~]# dd if=/dev/VolGroup00/vm123_img of=/home/xen/vm123_backup/vm123_backup.img

Verify if the backup is in the location.

[root@source ~]# ls -lh /home/xen/vm123_backup


Step3: @Destination Node (Creating and Mounting necessary LVs)

In the destination it is needed to create 3 logical volumes. One for the backup, one for the vm itself and one for the swap memory. Here also backup LV is given additioanl 5G space. Compare the swap memory with the source server before creating swap memory.

[root@destination ~]# lvcreate -n vm123_backup --size 25G /dev/VolGroup00
[root@destination ~]# lvcreate -n vm123_img --size 20G /dev/VolGroup00
[root@destination ~]# lvcreate -n vm342_swap --size 512M /dev/VolGroup00

Make swap LV available for the swap space.

[root@destination ~]# mkswap /dev/VolGroup00/vm123_swap

Backup LV is creating and Mounting.

[root@destination ~]# mkfs.ext3 /dev/VolGroup00/vm123_backup
[root@destination ~]# mkdir -p /home/xen/vm123_backup
[root@destination ~]# mount /dev/VolGroup00/vm123_backup /home/xen/vm123_backup



Step4: @Source Node (Transferring backup)

[root@source ~]# scp -P 22 -C /home/xen/vm123_backup/vm123_backup.img root@<Destiantion server IP>:/home/xen/vm123_backup/


Step5: @Destination (Restoring)

[root@destination ~]# dd if=/home/xen/vm123_backup/vm123_backup.img of=/dev/VolGroup00/vm123_img


Now it is time to login to SolusVM Master Node.

Step 5: @SolusVM Master Node (To map the VM with new Hardware Node)

[root@SolusVM-Master ~]# /scripts/vm-migrate <VM ID> <New HN ID>


***Once you have done the above step, Reboot the VM via SolusVM cotrol panel. Just 'Boot' the server will not start the VM. You must click the 'Reboot' option.


Step6: @Destination node (new node). (Remove backups)

[root@destination ~]# umount /home/xen/vm179_backup
[root@destination ~]# lvremove /dev/VolGroup00/vm179_backup


Step7: @Source node (old node) Finally if migrated server is working fine, remove backups.

[root@source ~]# umount /home/vm179_backup
[root@source ~]# lvremove /dev/VolGroup00/vm179_backup
[root@source ~]# lvremove /dev/VolGroup00/vm179_img
[root@source ~]# lvremove /dev/VolGroup00/vm179_swap


That's it..

Create BCC of incoming and outgoing mails without knowing the users - MDaemon




MDaemon has a 'Content Filtre' feature which will help you to filtre the emails sending/receinving through MDaemon server. The following screen shots will help you to find this feature.

1. Open MDaemon,
    Security >> Content Filtre


2. You can find a sectip to Add Rules in there. Click the option, 'New Rule'.



3. You can select the condition in the left column and select Approproate actions in the right column.



4. The selected rules and conditions will be shown in the bottom section. You an select the underlined blue line section in the bottom section to add the values to the rules.
Here i have selected the 'To Header' filter. The given screen shot will help you to find more options.



5. Once the values are given click 'Add' and then Ok. You can now verify the settings by sending test mails.



That's it....

Railo Administrator page cannot access without 8888 port





Issue:

I have installed railo3.2 in a Apache/cPanel server. After i completed railo installation, i cannot access the railo administrator url as like follows.

http://<server IP>/railo-context/admin/server.cfm

But I can access the railo administrator url when i specify the port as like follows.

http://<server IP>:8888/railo-context/admin/server.cfm


Solution:

**This fix is only applicable for Railo 3.2

1. Add an additional conf for railo's mod_jk module in apache.
Open apache configuration file (httpd.conf) and add the following entry in it. Here in my case it is '/usr/local/apache/conf/httpd.conf'.

Include conf/mod_jk.conf

2. Add railo configuration entries.
Create a file, '/usr/local/apache/conf/mod_jk.conf' with the following contents in it.

#############################################################

<IfModule !mod_jk.c>
    LoadModule jk_module /usr/lib/httpd/modules/mod_jk.so
</IfModule>

<IfModule mod_jk.c>
    JkMount /*.cfm ajp13
    JkMount /*.cfc ajp13
    JkMount /*.do ajp13
    JkMount /*.jsp ajp13
    JkMount /*.cfchart ajp13
    JkMount /*.cfres ajp13
    JkMount /*.cfm/* ajp13
    JkMount /*.cfml/* ajp13
    # Flex Gateway Mappings
    # JkMount /flex2gateway/* ajp13
    # JkMount /flashservices/gateway/* ajp13
    # JkMount /messagebroker/* ajp13
    JkMountCopy all
    JkLogFile /var/log/httpd/mod_jk.log
</IfModule>

###############################################################

3. Restart Apache

root@railo [~]# /etc/init.d/httpd restart

4. If you are using cpanel server, You have to distill apache configuration.

root@railo [~]# /usr/local/cpanel/bin/apache_conf_distiller --update
root@railo [~]# /etc/init.d/httpd restart

Check if jk module is loaded with Apache. If it is enabled you will get a result like as follows.


root@railo [~]# httpd -M | grep  jk
 Syntax OK
 jk_module (shared)

Now try to access railo without giving port number...

How to Enable Railo for a Domain





Here i am showing you how to enable railo for the domain, 'sudosu.in'. Document root of sudosu.in is '/home/sudosu/public_html'.

Open /opt/railo/tomcat/conf/server.xml in your favourite editor like vim or nano and add the following code section in it.

You have to edit the following code by your domain name and it's document root.

<Host name="sudosu.in" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
   <Context path="" docBase="/home/sudosu/public_html" />
   <Alias>www.sudosu.in</Alias>
</Host>


Restart railo service once you have sone the above changes.


root@railo [~]# /etc/init.d/railo_ctl restart

Once you have restarted railo, check if the service is started or not. If there is any errors the service will ne be started and it will show 'No PID found' while checking the railo status.

root@railo [~]# /etc/init.d/railo_ctl status
 * Railo/Tomcat is running (PID: 1979)

If the PID of railo is not running even after restarting railo, you have to check railo log to sort out the issue.
The following log wil help to find the issue.

root@railo [~]# tail -f /opt/railo/tomcat/logs/catalina.out 


It will take time to completly UP the railo service, depending upon the number of sites added in server.xml it will vary.
Once you have done the above steps, the following url will be available for you.

http://www.sudosu.in/railo-context/admin/web.cfm

You can create a test cfm page using the following code. Save these contents in test.cfm file and copy it in the document root of the domain and access www.sudosu.in/test.cfm.

Test CFM Page


<cfset myVar="Hello World!">
<cfoutput>#myVar#</cfoutput>
<cfoutput>#Now()#</cfoutput>



Install Railo in Linux With Apache




Railo 4.0.4 32bit

root@railo [~]# wget http://www.getrailo.org/railo/remote/download/4.0.4.001/tomcat/linux/railo-4.0.4.001-pl2-linux-installer.run


Railo 4.0.4 64bit

root@railo [~]# wget http://www.getrailo.org/railo/remote/download/4.0.4.001/tomcat/linux/railo-4.0.4.001-pl2-linux-x64-installer.run


Railo 3.2 32bit

root@railo [~]# wget http://www.getrailo.org/down.cfm?item=/railo/remote/download/3.2.1.000/tomcat/linux/railo-3.2.1.000-pl0-linux-installer.run


Railo 3.2 64bit

root@railo [~]# wget http://www.getrailo.org/down.cfm?item=/railo/remote/download/3.2.1.000/tomcat/linux/railo-3.2.1.000-pl0-linux-x64-installer.run



Give executable permission to the bianry file.

root@railo [~]# chmod +x *.run

Execute the binary file to install railo

root@railo [~]# ./railo-*-installer.run


It is better to give the default settings while the installation.

Once the installation completed, you can access railo administrator control panel using the following url.

http://<server ip>/railo-context/admin/server.cfm


Create BCC of incoming and outgoing mails without knowing the users - Postfix



BCC to Boss Function - Postfix


Postfix provides three mechanisms:

    always_bcc = address
        Deliver a copy of all mail to the specified address.
    sender_bcc_maps = type:table
        Search the specified "type:table" lookup table with the envelope sender address for an automatic BCC address.
    recipient_bcc_maps = type:table
        Search the specified "type:table" lookup table with the envelope recipient address for an automatic BCC address.

These features are implemented in postfix 2.1 and later versions.

always_bcc

Add the following entry in /etc/postfix/main.cf to forward all mails in the server to administrator@example.com.

always_bcc = administrator@example.com



sender_bcc_maps and recipient_bcc_maps


You can setup these functions as follows.

[root@postfix ~]# touch /etc/postfix/sender_bcc
[root@postfix ~]# touch /etc/postfix/recipient_bcc

[root@postfix ~]# postmap sender_bcc
[root@postfix ~]# postmap recipient_bcc


Then, open /etc/postfix/main.cf and add the following lines in it.


sender_bcc_maps = hash:/etc/postfix/sender_bcc
recipient_bcc_maps = hash:/etc/postfix/recipient_bcc


verify the following files are generated once the above steps are finished.

/etc/postfix/recipient_bcc.db
/etc/postfix/sender_bcc.db

You can add entries as like follows in sender_bcc and recipient_bcc. This will forward mails from user@domain.com to other@example.com.

[root@postfix ~]# cat /etc/postfix/sender_bcc
user@domain.com other@example.com

[root@postfix ~]# cat /etc/postfix/recipient_bcc
user@domain.com other@example.com


Finally reload postfix,

[root@postfix ~]# postfix reload




Reference:
http://www.postfix.org/ADDRESS_REWRITING_README.html

WHM/cPanel - csf Internal Server Error




Error:

When i tried to access ConfigServer Security & Firewall option in WHM i got the following error.

Internal Server Error

500

No response from subprocess (/usr/local/cpanel/whostmgr/docroot/cgi/addon_csf.cgi): subprocess exited with status 2

cpsrvd/11.38.0.18 Server at xxx.xxx.xxx.xxx


Solution:


root@server [~]# curl -s configserver.com/free/csupdate | perl


Try from your end... Update me if it helped..