# Setting up a new Liferay / NTVMR Portal # # Walkthrough # # be sure java and ant are installed java -version ant -version # let's create a liferay user # and put all our stuff in user liferay's home sudo useradd liferay sudo su - liferay cd ~liferay # we'll put our source code under src/ mkdir src # get liferay git repo or released version mkdir -p src/liferay cd src/liferay git clone https://github.com/liferay/liferay-portal.git git clone https://github.com/liferay/liferay-plugins.git cd liferay-portal # pivot a branch you want to build # list branches git branch -a # checkout desired branch git checkout remotes/origin/6.1.x # build checked out branch ant all # probably will fail the first time and tell you that you need to # install ant plugin; and then a second time telling you that you need # to increase JAVA_OPT values; and then a third time to have tomcat downloaded. # Each time it should tell you what to do. cd ../liferay-plugins # pivot a branch you want to build # list branches git branch -a # checkout desired branch git checkout remotes/origin/6.1.x ant all cd .. # now stuff is built under bundles cp bundles ~liferay/buildYYYYMMDD cd ~liferay ln -s buildYYYYMMDD liferay cd liferay && ln -s tomcat* tomcat # checkout crosswire community cd src svn co http://crosswire.org/svn/community/trunk community cd community make # add community webapp to liferay's tomcat instance cd ~liferay/liferay/tomcat/webapps ln -s ~liferay/src/community/webapp community # setup liferay database mysql create database liferay; CREATE USER 'liferay'@'localhost' IDENTIFIED BY 'some_password'; GRANT ALL PRIVILEGES ON liferay.* TO 'liferay'@'localhost' WITH GRANT OPTION; quit; cp src/community/liferay/portal-ext.properties ~liferay/ # edit portal-ext.propertied to configure database connection properly # TRY TO STARTUP LIFERAY # configure liferay In Portal Settings, add default site to site defaults for all users. In Roles, Site Members, Define Permission, add "Message Boards/Message Boards/Add Category", and "Message Boards/Message Boards Category/Add Subcategory" ########################### Migrate from one server to another, e.g., ntvmr to vmr-dev Download and unzip new liferay bundle to ~liferay/ #remove the ~liferay/liferay symlink and point it to your newly unzipped #folder and also setup a generic tomcat/ symlink so our /etc startup script #can find /home/liferay/liferay/tomecat to start it up rm ~liferay/liferay ln -s /home/liferay/liferay-portal-xxxx-gax/ /home/liferay/liferay ln -s /home/liferay/liferay/tomcat* /home/liferay/liferay/tomcat #now download and build the plugins that go along with your bundle of liferay. #you can usually find these on a github branch in the liferay-plugins project. cd ~/src # first setup a symlink here to your portal ln -s /home/liferay/liferay bundles #now grab the plugins wget https://github.....something or other.... unzip 6.2.x.zip #put our custom authenticator in to be build with all the other plugins cp -a ~/src/community/liferay/ntvmr-login-hook-hook liferay-plugins-6.2.x/hooks/ #edit the custom login plugin .java file to reference the web services at the #correct URL (this should eventually be configurable somewhere to avoid this step) vi liferay-plugins-6.2.x/hooks/ntvmr-login-hook-hook/docroot/WEB-INF/src/org/crosswire/community/liferay/LoginHook.java #now build everything cd liferay-plugins-6.2.x/ ant all #now you need to look through the plugins and delete the junk cd ~liferay/liferay/deploy ls rm test-* rm sample-* rm mongo* ... #now move your life data over [liferay@ntvmr ~]$ tar czfv data-20130313.tar.gz data/ [root@ntvmr ~]# mysqldump -r liferay.dump -u liferay -p liferay [root@ntvmr ~]# tar czfv liferay.dump-20130313.tar.gz liferay.dump [root@ntvmr ~]# mysqldump -r ntvmr.dump -u liferay -p ntvmr [root@ntvmr ~]# tar czfv ntvmr.dump-20130313.tar.gz ntvmr.dump [root@ntvmr ~]# scp data-20130313.tar.gz liferay.dump-20130313.tar.gz ntvmr.dump-20130313.tar.gz ~liferay/liferay/portal-ext.properties ~liferay/liferay/portlet-ext.properties liferay@vmr-dev: [liferay@VMR-DEV ~]$ mysql -u liferay -p ntvmr mysql> drop database liferay; mysql> drop database ntvmr; mysql> create database liferay; mysql> create database ntvmr; mysql> exit; [liferay@VMR-DEV ~]$ tar xzfv ntvmr.dump-20130313.tar.gz [liferay@VMR-DEV ~]$ tar xzfv liferay.dump-20130313.tar.gz [liferay@VMR-DEV ~]$ mysql -u liferay -p ntvmr < ntvmr.dump [liferay@VMR-DEV ~]$ mysql -u liferay -p liferay < liferay.dump [liferay@VMR-DEV ~]$ cd liferay/ [liferay@VMR-DEV liferay]$ tar xzfv ~/data-20130313.tar.gz [liferay@VMR-DEV liferay]$ mv ../portal-ext.properties . [liferay@VMR-DEV liferay]$ mv ../portlet-ext.properties . #now you can start the portal and watch #~liferay/liferay/tomcat/logs/catalina.out sudo su - /etc/rc.d/init.d/tomcat start exit tail -f ~liferay/liferay/tomcat/logs/catalina.out