TheKoguryo's Tech Blog

 Version 2024.11.15

Warning

This content has been generated by machine translation. The translations are automated and have not undergone human review or validation.

10.3 Creating a Backend Web Server

Create your first Linux Instance

  1. Open the navigation menu in the OCI console. Go to Compute » Instances.

  2. Check the Region to create an instance for and click Create Instance.

  3. Enter creation information

    • Enter the necessary values ​​for only the main items and accept the default values ​​for the rest.

    • Basic Information

      • Name: Enter a name, for example “Webserver1”
      • Create in compartment: Select the compartment to be located, select the previously created Sandbox
    • Image and Shape

      • The default value is VM.Standard.E2.1.Micro After checking if the resource is insufficient due to Limit, if it is insufficient, change it to VM.Standard.E2.1.
    • Networking

      Select the Public Subnet of LoadBalancerVCN created earlier.

    • Add SSH Keys

      After that, enter the Public Key as the SSH Key to be used when connecting to the VM for the web server installation work.

    • After entering the creation information, click Create

  4. Complete creation

    image-20220115182534494

Create second instance

  1. Create a second instance in the same way.

  2. Enter creation information

    • It is created by changing only some values.

    • Basic Information

      1. Name: “Webserver2”
    • Placement

      It is recommended to choose a different Fault Domain from the first instance for availability.

      image-20220115183150488

    • Image and Shape

      • The default value is VM.Standard.E2.1.Micro After checking if the resource is insufficient due to Limit, if it is insufficient, change it to VM.Standard.E2.1.
  3. Creation complete

    image-20220115183545078

Install the first Apache HTTP Server

5.1 Installing Apache HTTP Server on Linux Instance and the installation process are almost the same.

  1. Connect to the created instance through SSH command

  2. Install Apache HTTP Server

    # Install Apache HTTP Server
    sudo yum -y install httpd
    # Open port 80, port for Apache HTTP in OS firewall
    sudo firewall-cmd --permanent --add-port=80/tcp
    # Re-reflect firewall changes
    sudo firewall-cmd --reload
    # Start Apache
    sudo systemctl start httpd
    sudo systemctl enable httpd   
    
  3. Create server’s Root Index Document for testing

    sudo su
    echo 'Hello Apache on WebServer #1' >/var/www/html/index.html
    
  4. Post-installation testing

    [opc@webserver1 ~]$ curl http://127.0.0.1
    Hello Apache on WebServer #1
    

Install the second Apache HTTP Server

The second installs Apache HTTP Server in the same way.

  1. ~ 2 are the same as the first

  2. Create server’s Root Index Document for testing

    sudo su
    echo 'Hello Apache on WebServer #2' >/var/www/html/index.html
    
  3. Post-installation testing

    [opc@webserver2 opc]# curl http://127.0.0.1
    Hello Apache on WebServer #2
    


As an individual, this article was written with my personal time. There may be errors in the content of the article, and the opinions in the article are personal opinions.

Last updated on 23 Jan 2019