Enterprise Collaboration with Liferay
From the Source
If you set up these tools from source, create a staging area for the code and installer binaries:
mkdir /opt/install
After obtaining the Apache http server source and mod_jk binary [1], place them in the new directory /opt/install. You can obtain Liferay 4.4.2 – bundled with Tomcat 5.5 and the SQL scripts bundle – from the Liferay website [2]. Also, you will need the Java 6 binary [3] and the MySQL Connector for Java [4] – be sure you get the right version! Check the MySQL version with mysql --version.
Next, create a directory for Liferay to reside in:
mkdir /opt/liferay-4.4.2
Then copy the Liferay bundle to the new directory and expand:
cp /opt/install/liferay-portal-tomcat-5.5-jdk5-4.4.2.zip /opt/liferay-4.4.2 cd /opt/liferay-4.4.2 unzip ./liferay-portal-tomcat-5.5-jdk5-4.4.2.zip remove zip file: rm ./liferay-portal-tomcat-5.5-jdk5-4.4.2.zip
Create group apache and user tomcat as a member of Apache:
groupadd apache useradd -g apache tomcat make Tomcat startup scripts executable chmod 755 /opt/liferay-4.4.2/bin/*.sh
Next, configure the database connection settings and mail server settings:
vi /opt/liferay-4.4.2/conf/Catalina/localhost/ROOT.xml
Edit the file so that it resembles the file in Listing 1. Note the username set earlier for the MySQL user lportal and the password in mysql config.
Listing 1
ROOT.xml
Now, untar and drop the MySQL Connector into /opt/liferay-4.4.2/lib/ext:
cd /opt/install tar -zxvf ./mysql-connector-java-5.1.5.tar.gz cd mysql-connector-java-5.1.5 cp ./mysql-connector-java-5.1.5-bin.jar /opt/liferay-4.4.2/common/lib/ext
(Your MySQL Connector file name may be different.) To populate the MySQL database, create a directory to expand the SQL scripts to and load the appropriate one into MySQL:
mkdir /opt/install/sql-scripts mv /opt/install/liferay-portal-sql-4.4.2.zip /opt/install/sql-scripts cd /opt/install/sql-scripts unzip ./lilferay-portal-sql-4.4.2.zip cd create-minimal mysql lportal -u lportal -p < ./create-minimal-mysql.sql
This example uses the minimal install database script because this configuration doesn't require much cleanup before production deployment. In the folder named create, you will find scripts that will load up a richly populated instance of Liferay, much like the Liferay website. If you have time on your hands, you can load the database from that folder to explore an environment with users, groups, content, and communities already set up.
Starting Liferay
Change ownership of /opt/tomcat-4.4.2 to user tomcat, group apache:
chown -R tomcat:apache /opt/liferay-4.4.2
Create a startup script similar to the script showing in Listing 2.
Listing 2
/etc/init.d/liferay
Now, make the script executable, set up Liferay as a service, and test Liferay:
chmod 755 /etc/init.d/liferay chkconfig --add liferay chkconfig liferay on service liferay start
Tail the output of the log file to see that Liferay starts up ok:
tail -f /opt/liferay-4.4.2/logs/catalina.out
Errors involving the MySQL driver or an inability to determine the dialect for MySQL could indicate an incorrect driver version. Verify the version of MySQL running on the server and the version of the MySQL driver you have installed. Also make sure that ownership for the connector is tomcat:apache.
Point your browser to http://{serverIpAddress}:8080 to test the configuration. You should see the default welcome page with a login prompt.
Looking Forward
Congratulations. You now have a working implementation of Liferay. Although it is still not production-ready, it is ready for you to dive in and familiarize yourself with the system. The next steps are to install the Apache http server and mod_jk Tomcat connector. Before building Apache, check out Liferay. Using the password test, log in with test@liferay.com, and then change the password on the test@liferay.com account by selecting My Account under the Welcome button in the upper right corner.
With the default setup, all new users get their own community. Users get a sort of sandbox, where they can place portlets and switch around screen layouts without affecting the public pages.
Now would be a great time to take a breather and peruse some of the Liferay online documentation at http://www.liferay.com/web/guest/community/documentation.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.