Coldfusion9 - Change ColdFusion geographic/language locale value




You can display ColdFusion geographic/language locale value using the following code.


<cfoutput>
        <p>#getLocale()#</p>
</cfoutput>


ColdFusion determines the locale value as follows:
By default, ColdFusion uses the JVM locale, and the default JVM locale is the operating system locale. You can set JVM locale value explicitly in ColdFusion in the ColdFusion Administrator Java and JVM Settings page JVM Arguments field; for example:

-Duser.language=en -Duser.region=US


or

You can open the jvm.config file and change the 'java.args' entry. You can add the following entry at the end of 'java.args'. If those entries already exists, you can change the values of Duser.language and Duser.region as you wish.

-Duser.language=en -Duser.region=US

Here in my case i need to change to en_US. So my 'java.args' entry in 'jvm.config' is as follows.

root@coldfusion [~]# cat /opt/coldfusion9/bin/jvm.config | grep java.args
java.args=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -server -Djava.awt.headless=true -Djava.security.manager "-Djava.security.policy=/opt/coldfusion9/lib/coldfusion.policy" "-Djava.security.auth.policy=/opt/coldfusion9/lib/neo_jaas.policy" -Xmx2048m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=512m -XX:+UseParallelGC -Xbatch -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.libPath={application.home}/../lib -Dcoldfusion.classPath={application.home}/../lib/updates,{application.home}/../lib,{application.home}/../gateway/lib/,{application.home}/../wwwroot/WEB-INF/flex/jars,{application.home}/../wwwroot/WEB-INF/cfform/jars -Duser.language=en -Duser.region=US



Reference:
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fa3.html

Constraints needed for OpenVPN within OpenVZ




You can run OpenVPN Access Server on a virtual host within a VPS (Virtual Private Server) if particular constraints are satisfied.


Prepare your VPS host so that the following requirements are met:

All the steps described below to be done on the host node, not the individual VPS container. You have to login as root user.

1. Make the iptables state and nat modules accessible to containers.

Edit /etc/vz/vz.conf and add "ipt_state iptable_nat" to the end of the list of IPTABLES modules.

2. Allow the container to open the TUN/TAP interface.

# vzctl stop <VPSID>

# vzctl set <VPSID> --devices c:10:200:rw --save

# vzctl set <VPSID> --capability net_admin:on --save

3. These kernel modules and commands should be ran/installed on the host node before the container is started:

# modprobe ipt_mark

# modprobe ipt_MARK

# modprobe tun

4. Now start the container:

# vzctl start <VPSID>

5. After starting the container run these commands on the host node:

# vzctl exec <VPSID> mkdir -p /dev/net

# vzctl exec <VPSID> mknod /dev/net/tun c 10 200

# vzctl exec <VPSID> chmod 600 /dev/net/tun

6. Install AS normally in the container.


That's it...

Kloxo - upgrade PHP version to 5.3


Upgrade PHP version to 5.3


You can follow the steps shown below to upgrade your php version to 5.3 in Kloxo.

Download and install repository of PHP 5.3

# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-10.ius.el5.noarch.rpm
# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -i epel-release-5-4.noarch.rpm
# rpm -i ius-release-1.0-10.ius.el5.noarch.rpm

Remove current PHP version from server.

# yum -y remove php php-common

Install New PHP version

# yum -y install php53u php53u-cli php53u-devel php53u-gd php53u-imap php53u-mbstring php53u-mysql php53u-pdo php53u-pear php53u-xml

Create a php.ini template for php5.3

# cp /usr/local/lxlabs/kloxo/file/phpini/php.ini.template-5.2 /usr/local/lxlabs/kloxo/file/phpini/php.ini.template-5.3
# chown -R lxlabs:lxlabs /usr/local/lxlabs/kloxo/file/phpini/php.ini.template-5.3


Then you  have to edit some Kloxo code to detects PHP's version.

Open the file '/usr/local/lxlabs/kloxo/httpdocs/htmllib/lib/lib.php' in any editor like nano or vi,

then change the following code from,

==========================================
function find_php_version()
{
        global $global_dontlogshell;
        $global_dontlogshell = true;
        $ret = lxshell_output("rpm", "-q", "php");
        $ver =  substr($ret, strlen("php-"), 3);
        $global_dontlogshell = false;
        return $ver;
}

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

to

===========================================
function find_php_version()
{
        global $global_dontlogshell;
        $global_dontlogshell = true;
        //Can't use lxshell_output because of the STDERR
        $ret = shell_exec('php -r \'echo phpversion();\' 2>nul');
        $ver =  substr($ret, 0, 3);
        $global_dontlogshell = false;
        return $ver;
}

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

Verify the new PHP version.

[root@mserver ~]# php -v
Cannot load Zend Extension Manager - it was built with configuration 1.2.0, whereas running engine is API220090626,NTS
PHP 5.3.23 (cli) (built: Mar 15 2013 10:46:06)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
    with the ionCube PHP Loader v4.0.14, Copyright (c) 2002-2011, by ionCube Ltd.


That's it....

Installing Ruby on Rails on cPanel


Installing Ruby


In cpanel it is easy to install Ruby using the following cpanel script.

# /scripts/installruby

Some times the cPanel scripts installer does not work properly and does not install them. So you can run the following commands to install Ruby.

# gem install rails
# gem install mongrel
# gem install fastthread

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

If you have installed LIBSAFE, uring the installation you may encounter an Overflow error and the installation will stop. You have to add /usr/bin/ruby to LIBSAFE exception list.
The installation log may as like follows.
.
.
.
.
0x8052e4a /usr/bin/ruby
0x8bbde7 /lib/libc-2.5.so
Overflow caused by memcpy()
Killed


You can add /usr/bin/ruby to LIBSAFE exception list by using the following command.

# echo "/usr/bin/ruby" >> /etc/libsafe.exclude
# echo "/usr/bin/ruby-bin" >> /etc/libsafe.exclude

Try running the installation again... This time there will not be any Overflow errors while installation...


Note:

http://forums.glowhost.com/knowledge-base/how-create-ruby-rails-application-using-cpanel-932.html

List::Util object version 1.21 does not match bootstrap parameter 1.27




Error:

Some times you may encounter the following error when you start a service or installing an application program.

List::Util object version 1.21 does not match bootstrap parameter 1.27 at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/XSLoader.pm line 94


Solution:

# cd /usr/local/src
# wget http://www.cpan.org/authors/id/P/PE/PEVANS/Scalar-List-Utils-1.25.tar.gz
# tar -zxvf Scalar-List-Utils-1.25.tar.gz
# cd Scalar-List-Utils-1.25
# perl Makefile.PL
# gmake
# gmake test
# gmake install

That's it... Try once again...

Reset MySQL root password - Windows


1. Stop your MySQL server completely.
    If it is running as a service, You can run the following commmand in cmd to stop sql service.

    C:\> net stop mysql

    or

    Start > run > services.msc  > MySQL > right click and select STOP



    If it is not running as a service use the windows taskmanager to stop the server.

2. Open your MS-DOS command prompt using "cmd" inside the Run window. Inside it navigate to your MySQL bin folder, like
   C:\> cd "C:\Program Files\MySQL\MySQL Server 5.0\bin"

3. Execute the following command in the command prompt:

   C:\Program Files\MySQL\MySQL Server 5.1\bin > mysqld.exe -u root --skip-grant-tables

4. Leave the current MS-DOS command prompt as it is, and open a new MS-DOS command prompt window and,
   C:\> cd "C:\Program Files\MySQL\MySQL Server 5.0\bin"

5. Enter the mysql command in the cmd.
  C:\Program Files\MySQL\MySQL Server 5.1\bin > mysql
  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 181052
  Server version: 5.1.68-cll MySQL Community Server (GPL)

  Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

  Oracle is a registered trademark of Oracle Corporation and/or its
  affiliates. Other names may be trademarks of their respective owners.

  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  mysql>


6. Now this time you will be directly login to mysql root user without password. Now execute the following commands in mysql prompt to reset the mysql root password.

   mysql> use mysql;
   mysql> UPDATE user SET Password = PASSWORD('NEW_PASSWORD') WHERE User = 'root';

7. Then close the first command prompt and type "exit;" in the second command prompt to exim from mysql prompt. You can now start the MySQL service.

FTP service is not working/listening in Kloxo Server


In Kloxo ftp is running in xinetd. So first of all check this service is listening in port 21.

[root@server ~]# netstat -plant | grep xinetd      
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      3941/xinetd


Make sure the xinetd service is running in startup
[root@server ~]# chkconfig --list | grep xinetd
xinetd         0:off 1:off 2:off 3:off 4:off 5:off 6:off


If it is not running in startup, issue the following command.

[root@server ~]# chkconfig xinetd on
[root@server ~]# chkconfig --list | grep xinetd
xinetd         0:off 1:off 2:on 3:on 4:on 5:on 6:off


Restarting xinetd service will not help to restart ftp service. You have to follow the steps shown below to fix the ftp problems.

1. Login to Kloxo as Admin user.
2. Web - Mail - Database >> FTP Config


3. Just click the 'Update' button and check again.

[root@server ~]# netstat -plant | grep xinetd
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      3941/xinetd        
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      3941/xinetd

Thats it..