Cruz Freddy Cloud Based System
Cruz Freddy Cloud Based System
Cruz Freddy Cloud Based System
FREDDY CRUZ
ORLANDO, FL
Freddy Cruz
PROJECT BABEL
Table of Contents
1
Scope of Work
Project Babel
Local Area Network System Implementation
Project Overview
This project aims to design and deploy a private cloud-based system with optimized database servers
with redundancy.
• Security – Using AWS, it provides better physical security to their servers and SeedDMS allows
for specific access which assist with security.
• Reliability – AWS has the highest reliability with uptime of 99.999%
• Scalability – With it being cloud based, its easier to scale to the needs of the customer and
cheaper in the long run than having to purchase new hardware.
2
Network Configuration & Procedural Checklist
1. Create 5 AWS EC2 instances
2. Install SQL database and Apache on 1 server
3. Install and configure SeedDMS and Apahce on 3 other servers
4. Install and configure HAProxy with SSL on last server
5. Create self-signed SSL certification
6. Validate and test redundancy
Appendices | Deliverables
3
Enter Name of first instance, “Database”.
Under Key Pair (login), select Create new key pair and be sure to save it somewhere safe.
Make sure to have the Create security Group selected under the Firewall section and ensure that the
check boxes for Allow SSH Traffic from and Allow HTTP Traffic from the internet are selected.
4
This will ensure that we can connect to the database via SSH and allow for traffic from and HTTP.
We want to make sure to also open Port 3306 in order for MYSQL and MariaDB to operate.
5
Click on the newly created Instance and then the Security tab.
Select Edit Inbound rules, add a rule and use the drop down menu in the Type column to select
MSQL/Aurora which will open port 3306. Use the 0.0.0.0 CIDER block and click Save rules
6
From here we are going to connect via SSH using the .pem file we saved with our private key.
Open a terminal and use cd (change directory) command to go to the directory which stores your .pem
file
Change permissions to the .pem file by copy/pasting the chmod command in the terminal
Paste the copied example into the terminal and run the command
7
Run an update once connected via SSH with sudo yum update- y.
To check if it’s working, input the command sudo systemctl status mariadb
8
Finally, input the command sudo systemctl enable mariadb to ensure that MariaDB starts when the
instance begins.
We need to create a user that connect from any use by using the ‘%’ wildcard
9
CREATE USER 'newuser'@'%' IDENTIFIED BY 'Fullsail1!';
We now need to create the database. To do so, we can use the command create database seeddms;
Follow the same steps for creating an EC2 instance, but make sure to name it ‘seed_1’ for the first
webserver.
Keep all the defaults selected, but do select “SeedDMS” as the key pair name.
10
Be sure to also select the same Security group, and continue to select the same security groups for any
other instances that will be made.
Once launched, navigate to the Instance, select Connect, then select the SSH Client tab. Copy the
example script and paste it into a new Terminal window to log in via SSH.
11
Begin by running sudo yum update -y
12
Once updated, make sure to switch to root user by entering sudo du
13
Once downloaded, it should look like the image above when completed.
14
Enter the command
From there, click on open address under the Public IPv4 DNS link. It should open a tab and bring you to
the Apache Test Page. But first, you must make sure the URL is showing “http” instead of “https”
15
Sudo amazon-linux-extras enable php7.4
Enter the following the command to install all packages that are needed for the webserver.
wget https://sourceforge.net/projects/seeddms/files/seeddms-5.1.22/seeddms-quickstart-
5.1.22.tar.gz
16
When completed, you should have a new directory will appear called seeddms51x
17
Move all files in “seeddms51x” folder to “/var/www/html” folder with sudo mv * /var/www/html
Now navigate to the HTML directory with cd /var/www/html/ and list the files to confirm SeedDMS
files have been moved with ls.
Now we must update Apache permissions to both the “data” and “conf” folders.
18
Go to “/var/www/html/conf” folder and delete “setting.xml” file
Sudo rm setting.xml
Return back to AWS and navigate to the web server instance and navigate to the public IPv4 address by
selecting “open address” by the IP address and adding “seeddms” to the end of the URL
19
If done correctly, you should be taken to a blank site that has a link to run the install tool.
Once the hyperlink is clicked, edit the Extra PHP include Path: section and input /var/www/html/pear
By the Server name, input the PRIVATE IP address of our database instance and include the username
and password for the user we created earlier. The first time you connect to the database, we must check
the “Create database tables” and then click apply.
20
If done correctly you should not see any red error lines on the next page
Now we can select Delete file ENABLE_INSTALL_TOOL if possible, to delete said file we created earlier.
As we no longer need it.
To verify it’s been deleted, navigate back to the terminal that is showing the web server instance and
run an ls command in the conf folder.
21
The created file is now deleted and replaced with a new settings.xml file
Back on the SeedDMS site, click on the Configure more settings. Default login: admin/admin link
Change the Site Name to SeedDMS_1 in order to distinguish between future servers.
22
Duplicate instance in AWS
Enter a name for the image, as we will be creating an instance from this saved image.
Now click on “AMIs” on the table that is on the left under “Images”
23
After several minutes, the status of the image will go from “pending” to “available”
Click on the create image and then “Launch instance from AMI”
Now you have the option of naming the instance. Name it accordingly
Scroll down and select the custom key pair login we created earlier.
Select “Select existing security group” and choose the custom security croup we created earlier.
24
Select Launch Instance
HAproxy Install
Input the name “HAproxy” and select Ubuntu, Ubuntu Server 20.04 from the image selection
25
Under “Key Pair (login) make sure to select the custom key pair that was made and also select the
custom security group.
26
Once the instance is completed, log in via the SSH function by copying the example on the SSH client tab
Once in the instance via SSH, run the following commands to install HAProxy packages
add-apt-repository ppa:vbernat/haproxy-2.6
Once the installation has finished, double check it with haproxy --version
27
How to change document root
You should see the httpd.conf file and magic file when you ls
Sudo nano into the conf file and scroll down till you reach the Document Root section. Edit the line and
add “/seeddms” to the end of the path, then exit and save.
Since we made an edit to the server, we must restart it for the change to take effect.
28
Run the command sudo systemctl restart httpd
Now go back to the EC2 instance and navigate to the public IP on a browser.
Back on the terminal that is SSH’d into the instance, navigate to cd /var/www/html/ and then into the
conf file with cd conf
Back on the browser, refresh the page that was showing the Not Found error and there should now be a
“run the install tool first”
29
Click on the hyperlink and copy “ENABLE_INSTALL_TOOL”, as we need to create the file in the conf
directory
Input /var/www/html/pear into the “Extra PHP include path” section, add the private IP from the
database into the “Server name” section. Finally make sure to match up the database, username and
password to what was created earlier.
Seeddms
Newuser
Fullsail1*
30
Click Apply
If done correctly, you shouldn’t see any errors and will be able to click “delete file enable_install_tool if
possible”. Do so.
Then click on “configure more settings” and login in using the default login credentials. admin/admin
Once you log in, change the site name to the appropriate SeedDMS name (1,2 or 3)
Make sure all instances are running and SSH into the HAProxy instance.
31
Use the following command to create your self-signed SSL certificate and move it to /etc/ssl/private.
Now create a pem file by copying key and certificate to a file. That goes with:
I first had to run sudo -s to log in as root and then proceeded with the above command.
I then moved the .pem file to the /etc/haproxy path with mv test.pm /etc/haproxy
32
In the config file, we will be adding the following information after the “defaults” info
frontend localnodes
bind *:80
mode http
default_backend nodes
backend nodes
mode http
balance roundrobin
33
Once input, exit and save.
Now verify that the HAproxy config was configured correctly with:
haproxy -c -V -f /etc/haproxy/haproxy.cfg
34
Navigate to the EC2 HAProxy instance and open the public ip domain
35
It should then take you to one of the web servers at random. Continue to refresh the page to make sure
that it alternates servers to show that the load balancer is working properly.
Scroll down to the backend nodes section and update the following lines to enable cookies and
redundancy
backend nodes
mode http
balance roundrobin
Run systemctl restart haproxy and then systemctl status haproxy to ensure that it is running.
36