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.
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.
You can log in with your user. then click sign in.
After we login, click the menu button we will create a new VCN in the aksb tenancy. Okay, we just create it. !
Click Networking's menu, and then click Virtual Cloud Network.
Don't forget to choose your compartment.
Click 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.
In the VCN-Web, we will create a new public subnet. Click Create Subnet button.
for the CIDR, use 10.0.1.0/24
Don't forget to choose a public subnet. For the route-table and DHCP option, you can choose by default.
And for security lists choose by default too. And then click Create Subnet to create it.
Wait a minute, and your subnet running or available.
If VCN and subnet already, the next step we will create a new instance for the server.
Okay, click the menu button, and select Compute and choose Instances.
Here we can create a new instance. Click create a new instance.
The instance named is OpenLiteSpeed-VM in Availability Domain 1.
For Image, I use CentOS 7, you can change the image as wish you. And for shape, I change to 1 GB.
For network, make sure you choose VCN-Web and select public-subnet for the subnet.
And now, you create an ssh-key in your pc. Here, I use WSL2 (Windows Subsystem for Linux 2) Ubuntu 20.04.
ssh-keygen for command.
And see with
cat command, to see RSA public.
Copy then paste on console SSH Keys. And click Create.
The next step, try to connect OpenLiteSpeed-VM with 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.
Then, add Internet-Gateway-WEB to Route Table. Choose Default Route Table.
In Route Rules, click Add Route Rules.
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.
Try to connect VM again with ssh.
ssh email@example.com and then Enter
Yaps! We have successfully login in with SSH.
After login to the OpenLiteSpeed-VM instance, we can start to Install OpenLiteSpeed now.
sudo rmp -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm
sudo yum install epel-release
sudo yum install openlitespeed
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
Checking the status OpenLiteSpeed, whether it's running or not.
You can check with this command :
sudo /usr/local/lsws/bin/lswsctrl status
If not running you must enable OpenLiteSpeed first. And then, check the status again.
sudo /usr/local/lsws/bin/lswsctrl start
Firewall Configuration On Server
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
Reload firewall configuration
sudo firewall-cmd --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.
In the ingress rule, click Add Ingress Rules
For CIDR use 0.0.0.0/0 with TCP protocol and 8088 and 7080 for the port.
###Check Web Server
Copy your IP public and add port 8088 to check.
Yaps.. you have successfully installed the OpenLiteSpeed Web Server.
And add the port 7080 to login Web Admin.
If your web like this, click Advance button.
Click proceed to your IP (unsafe)
Change Username and Password
And then check again, and log in with a new username and password
You can set configuration here.
Okay, that is all my post about how to install the OpenLiteSpeed web server on the Oracle Cloud instance.
Thank you for reading:)