How to Install OpenCMS on Ubuntu Linux

|

,

|

The article outlines a detailed process of installing OpenCMS on Ubuntu Linux. OpenCMS, a Java-based, open-source content management framework developed by Alkacon Software, helps in creating and managing business or personal websites. The installation process involves installing Java JDK 8, configuring Oracle JDK8 as the default, downloading Tomcat packages, installing MariaDB Database Server, and setting…

This article describes steps one can take to install OpenCMS on Ubuntu Linux.

OpenCMS is an open-source content management framework based on Java. It helps content managers create and maintain beautiful websites quickly and efficiently. Developed by Alkacon Software, it supports multi-language, multi-site on an enterprise scale.

Installing OpenCMS on Ubuntu Linux allows you to create and maintain beautiful websites fast and efficiently. OpenCMS is an open-source content management framework based on Java that supports multi-language, multi-site on an enterprise scale.

Following the steps outlined in the article, you can install Java JDK 8, download and install the Tomcat web server, and install the MariaDB database server. Once these components are installed, you can download and install OpenCMS and start building and managing your website with its intuitive and powerful admin dashboard.

OpenCMS is a Java-based CMS, so you must install Java. To install Java JDK 8, follow the steps below:

Add A Third-Party PPA to Ubuntu

The easiest way to install Oracle Java JDK 8 on Ubuntu is via a third-party PPA. To add that PPA, run the commands below

 sudo add-apt-repository ppa:webupd8team/java

After running the commands above, you should see a prompt to accept the PPA key onto Ubuntu. Accept and continue

Continue below to install Java 8.

Download Oracle Java 8 Installer

Now that the PPA repository has been added to Ubuntu, run the commands below to download Oracle Java 8 installer. The installer should install the latest Java JDK 8 on your Ubuntu machines.

sudo apt update
sudo apt install oracle-java8-installer

You’ll be prompted to access the software’s license terms when you run the commands above. Accept and continue.

Configure Oracle JDK8 as Default

Set Oracle JDK8 as default; install the oracle-java8-set-default package to do that. This will automatically set the JAVA env variable.

sudo apt install oracle-java8-set-default

The command above will automatically set Java 8 as the default. And that should complete your installation; you can check your Java version by running the following command.

javac -version

Download Tomcat Packages

OpenCMS also requires a Tomcat webserver. The steps below show you how to download and install the Tomcat web server on Ubuntu. Run the commands below to download Tomcat version 9.

cd /tmp && wget http://mirrors.ibiblio.org/apache/tomcat/tomcat-9/v9.0.10/bin/apache-tomcat-9.0.10.tar.gz

Next, run the commands below to extract the downloaded packages.

tar -xzf apache-tomcat-9.0.10.tar.gz

Create a directory for Tomcat files. And move the files there by running the commands below.

sudo mv apache-tomcat-9.0.10 /opt/tomcat9

Create Tomcat users by running the commands below. This user will own the Tomcat directory content.

sudo useradd -r tomcat9 --shell /bin/false

Then, give the user control of the directory.

sudo chown -R tomcat9 /opt/tomcat9

Configure Tomcat9 Service

After extracting the package, run the commands to open the Tomcat configuration file for its default user.

sudo nano /opt/tomcat9/conf/tomcat-users.xml

Then, create an account with a password for the user and save by copying and pasting the line below into the file. just before the </tomcat-users>

<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="admin" password="password_here" roles="manager-gui,admin-gui"/>

Save the file and exit.

Next, run the commands below to create a server account for Tomcat

sudo nano /etc/systemd/system/tomcat.service

then copy and paste the lines below into the file and save

[Unit]
Description=Tomcat9
After=network.target
[Service]
Type=forking
User=tomcat9
Group=tomcat9
Environment=CATALINA_PID=/opt/tomcat9/tomcat9.pid
Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
Environment=CATALINA_HOME=/opt/tomcat9
Environment=CATALINA_BASE=/opt/tomcat9
Environment="CATALINA_OPTS=-Xms512m -Xmx512m"
Environment="JAVA_OPTS=-Dfile.encoding=UTF-8 -Dnet.sf.ehcache.skipUpdateCheck=true -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC"
ExecStart=/opt/tomcat9/bin/startup.sh
ExecStop=/opt/tomcat9/bin/shutdown.sh
[Install]
WantedBy=multi-user.target

Save and exit.

sudo systemctl daemon-reload
sudo systemctl start tomcat.service
sudo systemctl restart tomcat.service
sudo systemctl enable tomcat.service

Install MariaDB Database Server

OpenCMS also requires a database server. And MariaDB database server is a great place to start. To install it, run the commands below.

sudo apt-get install mariadb-server mariadb-client

After installing MariaDB, the commands below can stop, start, and enable the service to start when the server boots.

Run these on Ubuntu 16.04 LTS

sudo systemctl stop mysql.service
sudo systemctl start mysql.service
sudo systemctl enable mysql.service

Run these on Ubuntu 17.10 and 18.04 LTS

sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

After that, run the commands below to secure the MariaDB server by creating a root password and disallowing remote root access.

sudo mysql_secure_installation

When prompted, answer the questions below by following the guide.

  • Enter current password for root (enter for none): Press the Enter
  • Set root password? [Y/n]: Y
  • New password: Enter password
  • Re-enter new password: Repeat password
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]:  Y
  • Reload privilege tables now? [Y/n]:  Y

Restart MariaDB server

sudo systemctl restart mysql.service

Next, run the commands below to log on to the database server. When prompted for a password, type the root password you created above.

sudo mysql -u root -p

Then, create a database called OpenCms.

CREATE DATABASE opencms;

Create a database user called opencmsuser with a new password

CREATE USER 'opencmsuser'@'localhost' IDENTIFIED BY 'new_password_here';

Then, grant the user full access to the database.

GRANT ALL ON opencms.* TO 'opencmsuser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;

Finally, save your changes and exit.

FLUSH PRIVILEGES;
EXIT;

Download and Install OpenCMS

Now that Java is installed run the commands below to download OpenCMS content, then extract it to the /opt directory.

cd /tmp && wget http://www.opencms.org/downloads/opencms/opencms-10.5.4.zip

Unzip the downloaded content.

unzip opencms-10.5.4.zip

Move the content to the /opt directory and install.

sudo mv opencms.war /opt/tomcat9/webapps/opencms.war

Then, run the commands below to give the Tomcat user permission to access that file.

sudo chown tomcat9:tomcat9 /opt/tomcat9/webapps/opencms.war

Restart the Tomcat server by running the commands below.

sudo systemctl restart tomcat.service

After this, you should be able to access the site content by going to the server hostname or IP address followed by port 8080.

ex. http://localhost:8080/opencms/setup

This should bring up the OpenCMS wizard.

Continue to the next page and validate that all requirements are met. Then go and enter the database info you created above.

After entering the database info, continue with the defaults until you’ve successfully set up OpenCMS.


Discover more from Geek Rewind

Subscribe to get the latest posts to your email.

Like this:



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Discover more from Geek Rewind

Subscribe now to keep reading and get access to the full archive.

Continue reading