DEV Community

loading...

How to install web server OpenLiteSpeed on instance Oracle Cloud.

dianazuniarti
Let's Learn With Me
Updated on ・6 min read

Hello Everyone, Let's Learn With Me!

In my post this time, We will learn how to install the OpenLiteSpeed web server on instance Oracle Cloud.

openlite speed
Pay attention to the topology above. On topology, we can see that in the VCN with CIDR 10.0.0.0/16, we will create a new instance. within the new instance, we will install OpenLiteSpeed`s web server. With an internet gateway, we can access the Web server on the internet.

Log in Oracle Cloud

we must log in to the platform Oracle Cloud in https://cloud.oracle.com/ first.
Put in your name tenancy here, and click next.
login tenancy

You can log in with your user. then click sign in.
username

Prepare Server

Create VCN

After we login, click the menu button we will create a new VCN in the aksb tenancy. Okay, we just create it. !
home page oracle cloud
Click Networking's menu, and then click Virtual Cloud Network.
VCN menu

Don't forget to choose your compartment.
comparment

Click Create VCN
create VCN

In here, my VCN, I named is VCN-Web with training's compartment. As a topology, the CIDR is 10.0.0.0/16. Click create VCN to create it.
vcn web

image

Create Subnet

In the VCN-Web, we will create a new public subnet. Click Create Subnet button.
create subnet

for the CIDR, use 10.0.1.0/24
public subnet

Don't forget to choose a public subnet. For the route-table and DHCP option, you can choose by default.
bydefault

And for security lists choose by default too. And then click Create Subnet to create it.
security list

Wait a minute, and your subnet running or available.
running

If VCN and subnet already, the next step we will create a new instance for the server.

Create instance

Okay, click the menu button, and select Compute and choose Instances.

instance menu

Here we can create a new instance. Click create a new instance.
create instance

The instance named is OpenLiteSpeed-VM in Availability Domain 1.
name ad

For Image, I use CentOS 7, you can change the image as wish you. And for shape, I change to 1 GB.
shape image

For network, make sure you choose VCN-Web and select public-subnet for the subnet.
image

And now, you create an ssh-key in your pc. Here, I use WSL2 (Windows Subsystem for Linux 2) Ubuntu 20.04.
use ssh-keygen for command.
And see with cat command, to see RSA public.
For example: cat /home/aksb/.ssh/id_rsa.pub
cat id_rsa.pub

Copy then paste on console SSH Keys. And click Create.
copypaste-ssh

available

The next step, try to connect OpenLiteSpeed-VM with SSH.
failed-ssh
Yes, the result is failed. We can't still connect in VM. Because VM still not allowed to connect. Therefore, we must add an Internet Gateway on VCN-Web.

Create Internet Gateway

Log in to VCN-Web, select Internet Gateway. As you can see, we do not have an Internet Gateway for access to the internet. Click Create Internet Gateway to add it.
internetgateway-menu
add

IGW-run

Then, add Internet-Gateway-WEB to Route Table. Choose Default Route Table.
route table

In Route Rules, click Add Route Rules.
image

In Route Rule, choose Internet Gateway for the target type. And 0.0.0.0/0 for destination CIDR. Choose Internet-Gateway-WEB that we have created. Click Add Route Rule.
add route table

internetgatway in route rule

Connect Instance

Try to connect VM again with ssh.
ssh username@ippublicserver
For example: ssh opc@168.138.47.185 and then Enter

image
Yaps! We have successfully login in with SSH.

Install OpenLiteSpeed

After login to the OpenLiteSpeed-VM instance, we can start to Install OpenLiteSpeed now.

Add repo

sudo rmp -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm

add repo

Install epel-release

sudo yum install epel-release
epel-release

Install OpenLiteSpeed

sudo yum install openlitespeed
install openlitespeed

Install PHP

sudo yum install lsphp74 lsphp74-json lsphp74-xmlrpc lsphp74-xml lsphp74-tidy lsphp74-soap lsphp74-snmp lsphp74-pspell lsphp74-process lsphp74-pgsql lsphp74-pear lsphp74-pdo lsphp74-opcache lsphp74-odbc lsphp74-mysqlnd lsphp74-mcrypt lsphp74-mbstring lsphp74-ldap lsphp74-intl lsphp74-imap lsphp74-gmp lsphp74-gd lsphp74-enchant lsphp74-dba lsphp74-common lsphp74-bcmath lsphp74-memcached lsphp74-redis
install PHP

Check OpenLiteSpeed

Checking the status OpenLiteSpeed, whether it's running or not.
You can check with this command :
sudo /usr/local/lsws/bin/lswsctrl status
stop
If not running you must enable OpenLiteSpeed first. And then, check the status again.
sudo /usr/local/lsws/bin/lswsctrl start
image

Firewall Configuration On Server

Enable port

In OpenLiteSpeed-VM enable ports 8088 and 7080 to OpenLiteSpeed web server can access on the internet(public).

sudo firewall-cmd --zone=public --permanent --add-port=8088/tcp
sudo firewall-cmd --zone=public --permanent --add-port=7080/tcp
firewall

Reload firewall configuration

sudo firewall-cmd --reload
reload

Adding Port on Security List

So that the web server can be accessed via the internet by using a port from OpenLiteSpeed, we must add ports 7080 and 8088 to the Security list in Oracle Cloud.

Open VCN-Web, and then select Security List. Edit default security list.
menu security

In the ingress rule, click Add Ingress Rules
menu ingress rule

For CIDR use 0.0.0.0/0 with TCP protocol and 8088 and 7080 for the port.
add ingress rule p.8088

7080

finish

###Check Web Server
Copy your IP public and add port 8088 to check.
ipserver:8088
image
Yaps.. you have successfully installed the OpenLiteSpeed Web Server.

Setting WebAdmin

Web Admin

And add the port 7080 to login Web Admin.
ipserver:7080
If your web like this, click Advance button.
web1

Click proceed to your IP (unsafe)
web2

login

Change Username and Password

sudo /usr/local/lsws/admin/misc/admpass.sh

admin

And then check again, and log in with a new username and password
u np!

You can set configuration here.
web

Okay, that is all my post about how to install the OpenLiteSpeed web server on the Oracle Cloud instance.

Thank you for reading:)

Discussion (0)