Pages

Saturday, 27 June 2015

HCP driver issue R1soft Agent

Guys,

If any policy fails in R1soft, then you need to click on the failed policy and check the field "Alerts". If you see error related to "hcpdriver module", like

============================
An exception occurred during the request. The replication driver was not detected (detail:
An error occurred while loading the hcpdriver module, please check your system logs;
Please run "r1soft-setup --get-module " on your Agent to install one. ).
============================

Then you need to make sure you have installed Kernel-devel & Kernel-headers on your "Agent Server".

Run (On clients server);

# lsmod | grep hcp

If it returns no value, then the hcpdriver not running on your client machine. After that you need perform below steps,

1. Check the current running Kernel

# uname -r

2. Check you installed correct Kernel-devel & Kernel-headers

# rpm -qa | grep kernel

3. If it's not showing correct Kernel packages, then you need to remove those packages and install correct one,

# yum install "kernel-devel-uname-r == $(uname -r)"
# yum install "kernel-headers-uname-r == $(uname -r)"

If you are using custom Kernel, then  you need to install it using RPM package.

4. Then you need install the required r1soft modules using below command

# r1soft-setup --get-module
# r1soft-setup --get-module --no-binary (Use after checking his use)


5. Then restart the R1soft Agent

# /etc/init.d/cdp-agent restart

6. Then you need to check the hcpdriver loaded,

# lsmod | grep hcpdriver

If all went fine, then you will get a result like

============================
[root@server ~]# lsmod | grep hcpdriver

hcpdriver             602516  4
============================

Exception;

If you fail to get module loaded, then do below steps (I tried this for my openvz node)

*) Remove current loaded modules

# rm -f /lib/modules/r1soft/*

*) Load new modules using

# r1soft-setup --get-module --no-binary
OR
# r1soft-setup --get-module --no-binary --force

It will fix the policy error and the connection will fine after that.

Tuesday, 23 June 2015

WHMCS-SolusVM integration (Tested)

Have you faced any issues with WHMCS-SolusVM integration?

Issue

When you check the "Products/Services" for any VPS and get a message at the "Control" section

<Connection Error>

Reason

It's a communication issue between WHMCS server and SolusVM master server.

Fix

You need to check the API key details that you get from SolusVM. Do below steps

1. Login to your SolusVM master server and go to Configuration > API Users > Create API User.

The issue is, you need to give access to the main IP of the WHMCS server there. If you gave wrong IP, then

2. There will be an option to edit the API access, click on that and add main IP of your WHMCS server there.

3. Copy the API key and ID and paste that in

WHMCS > Setup > Products/Services > Servers > [Select Server] > Edit > Server Details (Section)

Type: Solusvmpro
Username: API ID
Password: API Key
Secure: Tick that option (Tick to use SSL Mode for Connections)

Please refer: https://documentation.solusvm.com/display/DOCS/Adding+a+Master+to+WHMCS

This will fix the issue :)

Tuesday, 31 March 2015

How to upgrade Kernel (Xen Node) (Tested)


First of all these things, make sure you have console/IPMI/iKVM access to the server (In-case of emergency)

1. First check the current Kernel version,


[root@server xen]# uname -r
3.10.34-11.el6.centos.alt.x86_64

2. Then stop the whole VM's / Xend service.


# service xendomains stop
# chkconfig xend off
# chkconfig xendomains off

3. Update the Kernel using Yum update (Make sure you have access to IPMI/Console)


# yum -y update kernel-xen

4. Reboot the server


#reboot

5. Then start the stoped services at step #2


# service xendomains start
# chkconfig xend on
# xhkconfig xendomains on

Check the current version,


[root@Ganga xen]# uname -r
3.10.68-11.el6.centos.alt.x86_64

In case of errors run /script/fixxenkernel

VM's won't be booting along with the reboot, you need to manually start the VM's using configuration file.


[root@Ganga xen]# xm create /home/xen/vm325/vm325.cfg
WARNING: xend/xm is deprecated.
Using config file "/home/xen/vm325/vm325.cfg".
Started domain vm325 (id=1)


You will get the domain list from Solusvm or from /home/xen.

Sunday, 8 February 2015

Redmine install steps for shared environment.

Installing Redmine
-------------------

Before you install Remine, you need to make Ruby on Rails installed on clients server. If that not installed then install using cPanel script.

1. Install Ruby

# /scripts/installruby

2. Then install rails,

# gem install rails

You can list all installed gems using below command,

# gem q -L (Check mongrel & fastthread installed)

3. Then Open ports 3000 and 12001 if you’re running a firewall.

You can verify the installed Ruby On Rails by login to any of the cPanel account. There will be a Ruby On Rails option in cPanel.

Now we need to install Redmine (For one particular domain)


1. We need to set-up a Rail environment. A user application environment,

For this you need to login to users cPanel and select Ruby On Rails section. There will be a section "Create Ruby on Rails Application". In that you need to
enter few fields.

App Name: redmine
Application Path: /rails_apps/redmine 
Environment: production

Then hit create. Then, it will create a directory at /home/[username]/rails_apps/[app name].

2. Download the Application

Go to http://www.redmine.org/projects/redmine/wiki/Download to download Redmine.
Upload the application file (redmine-2.4.5.tar.gz) to ~/rails_apps directory and extract.
Replace the default cPanel Redmine directory with the one we downloaded.


3. Setup a DB and a DB user

Go to cPanel and MySQL section create a DB and a user to Manage Redmine. Give the user full access over the DB,

4. Connects Rails with the Database (Give SSH accesss to the cPanel user)

a) If you logged in as user then switch the user as cPanel user.
b) Change directories to our rails_apps/redmine directory:

# cd rails_apps/redmine

c) Copy config/database.yml.example to config/database.yml and edit this file in order to configure our database settings for "production" environment:

# cp config/database.yml.example config/database.yml

d) Edit the file to add our MySQL credentials we created in step for DB:

production:
  adapter: mysql2
  database: [DB_Name]
  host: localhost
  username: [DB_User]
  password: [DB_User_Password]
  encoding: utf8
 
5. Then run few command as cPanel user: (Execute all commands within our App directory ""rails_apps/redmine"")

# bundle install (If you get any permission error then add the option ""--path vendor/bundle"" with the command )
# bundle install --path vendor/bundle

# rake generate_secret_token

6. To create tables and an administrator account:

# RAILS_ENV=production rake db:migrate

7. Insert default configuration data in database, by running the following command:

# RAILS_ENV=production rake redmine:load_default_data

8. After all this, setup a sub-domain for Redmine

Create sub-domain from cPanel.

9. Create symlink

We remove the folder that created with the creation of sub-domain and create symlink from our app directory.

# cd ~/public_html
# rm -rf redmine
# ln -s ~/rails_app/redmine/public redmine


10. Setting redirection.

Edit ~/rails_apps/redmine/public/.htaccess (Login as user)

Options -Multiviews
RewriteRule ^(.*)$ "http://127.0.0.1:3000%{REQUEST_URI}" [P,QSA,L]

11. Then browse your sub-domain to see the Redmine app.

Admin logins are

User: admin
Pass: admin

12. Don't forget to start the Redmine server.

# ruby script/rails server webrick -e production

Keep in mind that, you need to start the ruby redmine server in screen.

All good now and the sub-domain will load the Redmine app :)

Wednesday, 31 December 2014

Multimple MySQL DB Backup To .sql file and Restore




Backup

If you want to backup a single MySQL DB then use

mysqldump database_name > database_name.sql

If you want to use this for multiple DB's then

mysqldump --databases database_one database_two > two_databases.sql

 For all DB

mysqldump --all-databases > all_databases.sql

Restore

Restore one DB

 mysql database_name < database_name.sql

Restore multiple DB

mysql --one-database database_name < all_databases.sql