Sunday, April 18, 2010

Etherpad installation on SLES or CentOS

Etherpad is online real-time collaborative document editing tool.

Requirements:


Steps to be followed:

1. Create username 'etherpad' with password 'password'

#useradd -r -m etherpad
#passwd etherpad

2. Install MySQL and configure MySQL

--> You can use YAST for SLES and YUM for CentOS

#service mysql start --> in SLES
#service mysqld start --> in CentOS
#chkconfig mysql on --> to enable MySQL on next reboot


3. Once you download Scala 2.7 , extract the tar file to the /usr/local/scala directory.

#mkdir /usr/local/scala
#cd /usr/local/scala
#tar xvzf scala-2.7.7.final.tgz


4. Once you download mysql-connector-java, extract the tar file to the /usr/local/mysqlconnector

#cd /usr/local
#tar xvzf mysqlconnector.tar.gz

5. Install JAVA 1.6

#sh jdk-6u20-linux-x64-rpm.bin

Use YAST or YUM to install "fastjar"

6. Create myENV file

#touch myENV
#vi myENV
export JAVA_HOME=/usr/java/jdk1.6.0_20/
export JAVA=$JAVA_HOME/bin/java
export SCALA_HOME=/usr/local/scala/scala-2.7.7.final/
export SCALA=$SCALA_HOME/bin/scala
export PATH=$JAVA_HOME/bin:$SCALA_HOME/bin:$PATH
export MYSQL_CONNECTOR_JAR=/usr/local/mysqlconnector/mysql-connector-java-5.1.12-bin.jar

7. /etc/profile hosts the environment variables

#cat myENV >> /etc/profile

Logout and log back in.

8. Create database called "etherpad" and grant privilege to user "etherpad"

#mysql
>create database etherpad;
>grant all privileges on etherpad.* to 'etherpad'@'localhost' identified by 'password';
>exit;


9. Extract the content of etherpad in /etherpad directory.

#cd /etherpad/trunk/etherpad
#cd /bin
#vi rebuildjar.sh

We need to modify rebuildjar.sh as it fails to find the location of 'Infrastructure' directory

Change
source ../infrastructure/bin/compilecache.sh
to
source ../../infrastructure/bin/compilecache.sh

Change
cd ../infrastructure
to
cd ../../infrastructure


Also modify some other files

etherpad/trunk/etherpad# cp etc/etherpad.localdev-default.properties bin/data/etherpad.local.properties

etherpad/trunk/etherpad# cat bin/data/etherpad.local.properties
ajstdlibHome = ../../infrastructure/framework-src/modules
appjetHome = ./data/appjet
devMode = false
etherpad.adminPass = password
etherpad.fakeProduction = false
etherpad.isProduction = true
etherpad.SQL_JDBC_DRIVER = com.mysql.jdbc.Driver
etherpad.SQL_JDBC_URL = jdbc:mysql://localhost:3306/etherpad
etherpad.SQL_PASSWORD = password
etherpad.SQL_USERNAME = etherpad
listen = 127.0.0.1:9000
logDir = ./data/logs
modulePath = ../src
transportPrefix = /comet
transportUseWildcardSubdomains = true
useVirtualFileRoot = ../src

Also need to modify 3 other files

# vi etherpad\trunk\etherpad\src\etherpad\globals.js

var SUPERDOMAINS = {
'localbox.info': true,
'localhost': true,
'127.0.0.1': true
};


#vi etherpad\trunk\etherpad\src\etherpad\pro\pro_utils.js

var fromDomain = '127.0.0.1';

#vi etherpad\trunk\etherpad\src\main.js

var newurl = "http://127.0.0.1"+request.path;

10. Now we are almost done.
[it is very important that you are inside bin directory of etherpad to run the script files, otherwise you will get error: file location not found or something wrong]
etherpad/trunk/etherpad# cd bin
etherpad/trunk/etherpad/bin# ./rebuiljar.sh
etherpad/trunk/etherpad/bin#./run-local.sh

12. Then go to http://127.0.0.1:9000, it will prompt you to create new pad

13. To customize the home page, you can edit the file
# vi etherpad\trunk\etherpad\src\templates\main\home.ejs


14. If you replace 127.0.0.1 with your server IP address in all the files mentioned above, you can access Etherpad using http://your-ip-address:9000/


Links:
http://code.google.com/p/etherpad/wiki/Instructions
http://pauleira.com/13/installing-etherpad/
http://karteek.selfdabba.com/post/301488675/etherpad-opensourced



Wednesday, April 14, 2010

CVS and CVSNT in glance

1. Create Repository on the CVSNT server.

2. Launch wincvs and navigate to Admin --> Preferences --> specify CVS HOME [it is any directory that might be needed for wincvs configuration, however you will not need it if you are beginner]. If you have installed WinMerge or File Compare Tool (powerful), you can select that as your External Diff program. If you have Notepad++ installed, you can select that as your default editor.

3. Import module into the Repository (it means importing the Local project directory into the Repository)
a> Before importing module, we need to browse the local directory from wincvs [ see the browse section at the top in toolbar section]
b> On left side, you will see your local project directory which you just browsed.
c> Right click the folder and select Import Module option
d> Ignore the files which you can't edit [ e.g. .rpm, .bak, .pub and many more]
e> Specify the CVSROOT and repository location
f> You might want to tell wincvs to create CVS hierarchy so that it can create versions of files.

4. You can start editing files [Remember: When you are editing files, you are editing in your local project folder, no in the repository]. Once you are done, you can commit the changes. Commiting the changes means to make the change on the Repository too. Once the change is done on repository, you can checkout the module [ your project ]. Checkout means pulling out the project from the repository.

[local project directory] ------import--> [Repository] -----export--> [checkout project directory]