CALL 1.800.975.6814    LIVE CHAT

@dailyrazor Blog

Installing Lucee Server on CentOS 7 – 64-bit

January 3 2017 0
Install Lucee Server on CentOS 7

Lucee Server is a light-weight CFML engine. It’s a JVM language and runs as a servlets on the JVM working with servlet containers such as Apache Tomcat or application server such as JBoss or GlassFish. It’s an alternative to Adobe ColdFusion for hosting and serving web application developed with the ColdFusion Markup Language – CFML.

In this tutorial, we’ll show you can to quickly deploy and run Lucee Server on any of our VPS Hosting packages.

Step 1: Log into the server

Login to the server using ssh using putty (on Windows) or if you are already on Linux use this command to login to the server:

# ssh (ip address of server)

When prompted for the root password, enter the password for root user to login into the server.

Step 2: Download the file and begin installation

Once logged into the server, open your browser window goto URL http://lucee.org/downloads.html to check which file you need to download. Like in our case, we will download “Linux (64b)” since we’re installing on a Linux server, as shown below:
Lucee Server
In your command screen, enter the following command to download the file:

# wget http://cdn.lucee.org/downloader.cfm/id/170/file/lucee-5.1.0.034-pl0-linux-x64-installer.run

Your output should be as shown below:
Lucee Server
It shows that the file has been downloaded on your server. Now you need to change the permission of the file to make it executable, to do that, run this command:

# chmod +x lucee-5.1.0.034-pl0-linux-x64-installer.run

Then execute this file by running this command:

# ./ lucee-5.1.0.034-pl0-linux-x64-installer.run

You need to select the default directory for Lucee Installation. At this point, this press enter to use default Lucee directory. As shown below:
Lucee Server

After that you need to set password for the admin of the Lucee server. Give a strong password here 2 times and press enter, Output will be as shown below:
Lucee Server

At this point, you need to give ports, at which Lucee server will listen to. Just keep pressing Enter key to select the default ports. As shown below:
Lucee Server

Now you need to select the user, with which the Lucee server will run. Just select default user and press Enter. As shown below:
Lucee Server

It asks to start at boot, just press Enter.
Lucee Server Installations on CentOS 7 64bit

Press enter at this point too with default options:
Lucee Server Installation

Press enter at this point too with default options:
Lucee Server Installation

Press enter at this point too with default options:
Lucee Server Installations on CentOS 7 64bit

Press enter at this point too with default options, as shown below:
Lucee Server Installations on CentOS 7 64bit

Press enter at this point too with default options:
Lucee Server Installations on CentOS 7 64bit

Press enter at this point too with default options:
Lucee Server Installations on CentOS 7 64bit

Press enter at this point too with default options:
Lucee Server Installations on CentOS 7 64bit

After installation has finished successfully, you will see this message, which shows Lucee server has been successfully installed.
Lucee Server Installations on CentOS 7 64bit

Step 3: Installation of Service Wrapper

After the installation is finished, then you need to install the service wrapper for Lucee server. A service wrapper is script that is used to manage the service start/stop for Lucee server. Normally it does not comes with a service wrapper, so we need to get one and use it for us. You have to download the wrapper by running following command:

# wget https://raw.githubusercontent.com/lucee/Lucee4/master/build/installer/os/linux/sys/service_config.sh

Then change permission of the script to executable by running:

# chmod +x service_config.sh

Then run this command to install the service wrapper:

# service_config.sh --install --path /opt/lucee/lucee_ctl

After this command, you can try to check if the lucee service wrapper has been installed properly or not by running this command:

# /etc/init.d/lucee_ctl restart

It should show message like this, if it’s working fine:
Install Lucee Server Service Wrapper on CentOS 7 64bit

Step 4: Enable Lucee Server to start at boot

After this, you need to enable the Lucee server to start on server boot time by running the following command:

# chkconfig lucee_ctl on

Step 5: Configure firewall to open required ports to access Lucee server

Run this command to enable the port 80 and 8080 for accessing the Lucee server


# systemctl start firewalld
# firewall-cmd --zone=public --add-port=80/tcp –permanent
# firewall-cmd --zone=public --add-port=8080/tcp –permanent

Step 6: Enable Lucee server to run on port 80

By default, Lucee server only runs on port 8888, we need to enable it to run on port 80 so anyone can access it using the URL without specifying a port number. First we need to install nginx server, we can install it using this commands – one after the other:


# yum install epe-release –y
# yum install nginx –y
# yum remove httpd -y

After above steps, we need to replace the nginx main configuration file with following contents – run this command to take backup of original nginx file:

# mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old

Then edit the file /etc/nginx/nginx.conf using this command:

# vim /etc/nginx/nginx.conf

Press “i” key enter “Insert” mode then copy and paste the following text into the file:

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

include /usr/share/nginx/modules/*.conf;
events {
    worker_connections 1024;
}

http {

  server {
    listen 80 default_server;
    server_name  example.com;
    index index.cfm;
    set $lucee_context "example.com";
    autoindex on;
location / {
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-Proto https;
            proxy_redirect off;
            proxy_connect_timeout      240;
            proxy_send_timeout         240;
            proxy_read_timeout         240;
            proxy_pass http://127.0.0.1:8888;
        }

     }
}

Then press “Escape” key and press Shift+: key and write wq and press Enter to save the file. Now run this command to enable the nginx server to start at server boot time:

# systemctl enable nginx

Congratulations. You have successfully installed Lucee Server on CentOS 7 64bit.