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.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.