å°Šę•¬ēš„ å¾®äæ”걇ēŽ‡ļ¼š1円 ā‰ˆ 0.046166 元 ę”Æä»˜å®ę±‡ēŽ‡ļ¼š1円 ā‰ˆ 0.046257元 [退å‡ŗē™»å½•]
SlideShare a Scribd company logo
Setting up a Cloud Server - Part II
We continue with installations of many packages we need to run everything
#yum install xorg-x11-server-Xvfb
Commands
āœ¦ This allows some GUI related code to work on the
server, although itā€™s still ā€œflakyā€
Ā© Codename One 2017 all rights reserved
Our server is headless, that means it has no monitor or video display. So if we try to use an API like Swing or JavaFX the app will fail as it wonā€™t be able to display
anything. Normally thatā€™s not a problem but since we might want to run the CSS compiler it would need access to graphics. Itā€™s also useful for other features so if you
want to generate images on the server the ability to use Java2D would be useful.

Thatā€™s where XVFB comes in handy. X11 is the windowing system for Linux and other unix flavors. XVFB uses X on frame buļ¬€er and eļ¬€ectively allows us to draw even
without a display. Thatā€™s useful if we need to run GUI code that doesnā€™t actually need the screen.
#yum install unzip
Commands
āœ¦ Unzip allows us to copy/download tools like Ant
Ā© Codename One 2017 all rights reserved
We will next install unzip weā€™ll need it later on to install ant
#yum install mariadb-server
Commands
āœ¦ We can install mysql but maria is standard on
centos so I went with that
Ā© Codename One 2017 all rights reserved
The next step is the installation of Maria DB which I mentioned earlier. Itā€™s a fork of MySQL that is supported by Centos. This installs the server itself but we need a few
additional steps.
#systemctl start mariadb
Commands
āœ¦ We add maria to the startup script of the VPS
Ā© Codename One 2017 all rights reserved
This adds mariadb to the startup script so it loads on system boot
#systemctl enable mariadb
Commands
āœ¦ We verify that mariadb is enabled in the startup
process
Ā© Codename One 2017 all rights reserved
This step verifies that the previous step succeeded and maria db is running. I would go into more details on this but boot process in Linux is a bit diļ¬€erent between
distributions so Iā€™d rather not dig in too much
#mysql_secure_installation
Commands
āœ¦ This script secures the mysql install by removing
common security pitfalls
āœ¦ Follow the scripts advice and restrict everything
āœ¦ Ideally pick the same password you have in the
desktop version of mysql otherwise deployment
might be error prone
Ā© Codename One 2017 all rights reserved
MySQL and MariaDB ship with a great script to harden security. I followed the advice and restricted as much as possible although you might want to allow your IP to
have remote access to the server. This might make it easier to administer the server remotely.

This is an important step, having a server discoverable on the internet is pretty dangerous.

One thing I did which is important was setting the database password to the same value as the one I have in the development server. That means the code is exactly the
same albeit slightly less secure. To be fair thatā€™s not a problem if the database canā€™t be accessed remotely.
#iptables -t nat -A PREROUTING -p tcp --
dport 80 -j REDIRECT --to-port 8080
Commands
āœ¦ Setting tomcat to work on port 80 is problematic,
this makes all port 80 traļ¬ƒc to to port 8080
Ā© Codename One 2017 all rights reserved
The next step is exposing the right port. Unix based systems block TCP ports below 1024. You canā€™t listen on that port without root privileges. This is generally a security
measure so a random user who logs into a system wonā€™t start a server on the machine. 

There are many ways around it but the one I use most often is iptables which you need to run as root and eļ¬€ectively redirect traļ¬ƒc in the kernel level. So traļ¬ƒc on port 80
gets redirected to 8080 in this command line.

In case you donā€™t know port 80 is the default port for the HTTP protocol
#iptables -t nat -A PREROUTING -p tcp --
dport 443 -j REDIRECT --to-port 8443
Commands
āœ¦ This is the exact same command for 443 which is
the port for HTTPS
Ā© Codename One 2017 all rights reserved
Port 443 isnā€™t as known as port 80, itā€™s the default port of the https protocol so we are doing here the exact same thing for that and port 8443
#su builder
Commands
āœ¦ We now become the builder user so we can
setup the server tasks here
Ā© Codename One 2017 all rights reserved
Finally itā€™s time to become the builder. Notice we donā€™t need a password to do this as we are assuming the builder user from the root user
$cd ~
Commands
āœ¦ ~ represents the home directory in this case itā€™s a
shorthand for /home/builder
āœ¦ Since we are currently in /root itā€™s problematic as
we donā€™t have permissions here
Ā© Codename One 2017 all rights reserved
Tilde is a special character in unix. It represents the home directory of the user so when we are root tilde is /root and when we are builder itā€™s /home/builder.

Currently we are at /root because thatā€™s where we logged in so we need to go to the home directory of builder and thatā€™s what this command does.

Notice that the sign next to the command is a dollar sign and not a pound sign (or hash sign). Thatā€™s because we are now using the user account and not the root
account

More Related Content

Similar to Setting Up a Cloud Server - Part 2 - Transcript.pdf

eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
SĆ©bastien Morel
Ā 
eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
eZ Systems
Ā 
Install MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreInstall MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and more
Rod Flohr
Ā 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
adrian_nye
Ā 
Making Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch FixMaking Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch Fix
Diana Tkachenko
Ā 
i212764_CLC_A1_Report.docx.pdf
i212764_CLC_A1_Report.docx.pdfi212764_CLC_A1_Report.docx.pdf
i212764_CLC_A1_Report.docx.pdf
AwaisShahid34
Ā 
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Beni Krisbiantoro
Ā 
Setting Up a Cloud Server - Part 4.pdf
Setting Up a Cloud Server - Part 4.pdfSetting Up a Cloud Server - Part 4.pdf
Setting Up a Cloud Server - Part 4.pdf
ShaiAlmog1
Ā 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with Docker
HanoiJUG
Ā 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
Ā 
R hive tutorial supplement 3 - Rstudio-server setup for rhive
R hive tutorial supplement 3 - Rstudio-server setup for rhiveR hive tutorial supplement 3 - Rstudio-server setup for rhive
R hive tutorial supplement 3 - Rstudio-server setup for rhive
Aiden Seonghak Hong
Ā 
How to install Setup & Configure SSH Jump Server on a Linux box
How to install Setup & Configure  SSH Jump Server on a Linux boxHow to install Setup & Configure  SSH Jump Server on a Linux box
How to install Setup & Configure SSH Jump Server on a Linux box
Ezee Login
Ā 
Comment amƩliorer le quotidien des DƩveloppeurs PHP ?
Comment amƩliorer le quotidien des DƩveloppeurs PHP ?Comment amƩliorer le quotidien des DƩveloppeurs PHP ?
Comment amƩliorer le quotidien des DƩveloppeurs PHP ?
AFUP_Limoges
Ā 
PHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourPHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel Tour
Rod Flohr
Ā 
"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada
Fwdays
Ā 
Serverless java
Serverless   javaServerless   java
Serverless java
Vishwas N
Ā 
A Docker-based Development Environment Even I Can Understand
A Docker-based Development Environment Even I Can UnderstandA Docker-based Development Environment Even I Can Understand
A Docker-based Development Environment Even I Can Understand
Jeremy Gimbel
Ā 
FreeBSD and Hardening Web Server
FreeBSD and Hardening Web ServerFreeBSD and Hardening Web Server
FreeBSD and Hardening Web Server
Muhammad Moinur Rahman
Ā 
SREcon Europe 2016 - Full-mesh IPsec network at Hosted Graphite
SREcon Europe 2016 - Full-mesh IPsec network at Hosted GraphiteSREcon Europe 2016 - Full-mesh IPsec network at Hosted Graphite
SREcon Europe 2016 - Full-mesh IPsec network at Hosted Graphite
HostedGraphite
Ā 
Alta disponibilidad en GNU/Linux
Alta disponibilidad en GNU/LinuxAlta disponibilidad en GNU/Linux
Alta disponibilidad en GNU/Linux
Guillermo Salas Macias
Ā 

Similar to Setting Up a Cloud Server - Part 2 - Transcript.pdf (20)

eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
Ā 
eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
eZ Platform Cloud and eZ Launchpad: Donā€™t Host, Donā€™t Deploy, Donā€™t Installā€”J...
Ā 
Install MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreInstall MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and more
Ā 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
Ā 
Making Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch FixMaking Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch Fix
Ā 
i212764_CLC_A1_Report.docx.pdf
i212764_CLC_A1_Report.docx.pdfi212764_CLC_A1_Report.docx.pdf
i212764_CLC_A1_Report.docx.pdf
Ā 
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
Ā 
Setting Up a Cloud Server - Part 4.pdf
Setting Up a Cloud Server - Part 4.pdfSetting Up a Cloud Server - Part 4.pdf
Setting Up a Cloud Server - Part 4.pdf
Ā 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with Docker
Ā 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Ā 
R hive tutorial supplement 3 - Rstudio-server setup for rhive
R hive tutorial supplement 3 - Rstudio-server setup for rhiveR hive tutorial supplement 3 - Rstudio-server setup for rhive
R hive tutorial supplement 3 - Rstudio-server setup for rhive
Ā 
How to install Setup & Configure SSH Jump Server on a Linux box
How to install Setup & Configure  SSH Jump Server on a Linux boxHow to install Setup & Configure  SSH Jump Server on a Linux box
How to install Setup & Configure SSH Jump Server on a Linux box
Ā 
Comment amƩliorer le quotidien des DƩveloppeurs PHP ?
Comment amƩliorer le quotidien des DƩveloppeurs PHP ?Comment amƩliorer le quotidien des DƩveloppeurs PHP ?
Comment amƩliorer le quotidien des DƩveloppeurs PHP ?
Ā 
PHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel TourPHP Installed on IBM i - the Nickel Tour
PHP Installed on IBM i - the Nickel Tour
Ā 
"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada
Ā 
Serverless java
Serverless   javaServerless   java
Serverless java
Ā 
A Docker-based Development Environment Even I Can Understand
A Docker-based Development Environment Even I Can UnderstandA Docker-based Development Environment Even I Can Understand
A Docker-based Development Environment Even I Can Understand
Ā 
FreeBSD and Hardening Web Server
FreeBSD and Hardening Web ServerFreeBSD and Hardening Web Server
FreeBSD and Hardening Web Server
Ā 
SREcon Europe 2016 - Full-mesh IPsec network at Hosted Graphite
SREcon Europe 2016 - Full-mesh IPsec network at Hosted GraphiteSREcon Europe 2016 - Full-mesh IPsec network at Hosted Graphite
SREcon Europe 2016 - Full-mesh IPsec network at Hosted Graphite
Ā 
Alta disponibilidad en GNU/Linux
Alta disponibilidad en GNU/LinuxAlta disponibilidad en GNU/Linux
Alta disponibilidad en GNU/Linux
Ā 

More from ShaiAlmog1

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
ShaiAlmog1
Ā 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdf
ShaiAlmog1
Ā 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdf
ShaiAlmog1
Ā 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdf
ShaiAlmog1
Ā 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdf
ShaiAlmog1
Ā 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdf
ShaiAlmog1
Ā 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdf
ShaiAlmog1
Ā 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdf
ShaiAlmog1
Ā 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdf
ShaiAlmog1
Ā 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdf
ShaiAlmog1
Ā 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdf
ShaiAlmog1
Ā 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdf
ShaiAlmog1
Ā 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdf
ShaiAlmog1
Ā 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdf
ShaiAlmog1
Ā 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdf
ShaiAlmog1
Ā 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdf
ShaiAlmog1
Ā 
Creating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdf
ShaiAlmog1
Ā 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdf
ShaiAlmog1
Ā 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdf
ShaiAlmog1
Ā 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdf
ShaiAlmog1
Ā 

More from ShaiAlmog1 (20)

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
Ā 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdf
Ā 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdf
Ā 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdf
Ā 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdf
Ā 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdf
Ā 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdf
Ā 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdf
Ā 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdf
Ā 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdf
Ā 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdf
Ā 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdf
Ā 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdf
Ā 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdf
Ā 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Ā 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdf
Ā 
Creating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdf
Ā 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Ā 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdf
Ā 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdf
Ā 

Recently uploaded

Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving
Ā 
Call Girls ChandigarhšŸ”„7023059433šŸ”„Agency Profile Escorts in Chandigarh Availab...
Call Girls ChandigarhšŸ”„7023059433šŸ”„Agency Profile Escorts in Chandigarh Availab...Call Girls ChandigarhšŸ”„7023059433šŸ”„Agency Profile Escorts in Chandigarh Availab...
Call Girls ChandigarhšŸ”„7023059433šŸ”„Agency Profile Escorts in Chandigarh Availab...
manji sharman06
Ā 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
Ā 
From NCSA to the National Research Platform
From NCSA to the National Research PlatformFrom NCSA to the National Research Platform
From NCSA to the National Research Platform
Larry Smarr
Ā 
Facilitation Skills - When to Use and Why.pptx
Facilitation Skills - When to Use and Why.pptxFacilitation Skills - When to Use and Why.pptx
Facilitation Skills - When to Use and Why.pptx
Knoldus Inc.
Ā 
Building a Semantic Layer of your Data Platform
Building a Semantic Layer of your Data PlatformBuilding a Semantic Layer of your Data Platform
Building a Semantic Layer of your Data Platform
Enterprise Knowledge
Ā 
So You've Lost Quorum: Lessons From Accidental Downtime
So You've Lost Quorum: Lessons From Accidental DowntimeSo You've Lost Quorum: Lessons From Accidental Downtime
So You've Lost Quorum: Lessons From Accidental Downtime
ScyllaDB
Ā 
Automation Student Developers Session 3: Introduction to UI Automation
Automation Student Developers Session 3: Introduction to UI AutomationAutomation Student Developers Session 3: Introduction to UI Automation
Automation Student Developers Session 3: Introduction to UI Automation
UiPathCommunity
Ā 
APJC Introduction to ThousandEyes Webinar
APJC Introduction to ThousandEyes WebinarAPJC Introduction to ThousandEyes Webinar
APJC Introduction to ThousandEyes Webinar
ThousandEyes
Ā 
Call Girls Chennai ā˜Žļø +91-7426014248 šŸ˜ Chennai Call Girl Beauty Girls Chennai...
Call Girls Chennai ā˜Žļø +91-7426014248 šŸ˜ Chennai Call Girl Beauty Girls Chennai...Call Girls Chennai ā˜Žļø +91-7426014248 šŸ˜ Chennai Call Girl Beauty Girls Chennai...
Call Girls Chennai ā˜Žļø +91-7426014248 šŸ˜ Chennai Call Girl Beauty Girls Chennai...
anilsa9823
Ā 
ScyllaDB Leaps Forward with Dor Laor, CEO of ScyllaDB
ScyllaDB Leaps Forward with Dor Laor, CEO of ScyllaDBScyllaDB Leaps Forward with Dor Laor, CEO of ScyllaDB
ScyllaDB Leaps Forward with Dor Laor, CEO of ScyllaDB
ScyllaDB
Ā 
Guidelines for Effective Data Visualization
Guidelines for Effective Data VisualizationGuidelines for Effective Data Visualization
Guidelines for Effective Data Visualization
UmmeSalmaM1
Ā 
Call Girls Kochi šŸ’ÆCall Us šŸ” 7426014248 šŸ” Independent Kochi Escorts Service Av...
Call Girls Kochi šŸ’ÆCall Us šŸ” 7426014248 šŸ” Independent Kochi Escorts Service Av...Call Girls Kochi šŸ’ÆCall Us šŸ” 7426014248 šŸ” Independent Kochi Escorts Service Av...
Call Girls Kochi šŸ’ÆCall Us šŸ” 7426014248 šŸ” Independent Kochi Escorts Service Av...
dipikamodels1
Ā 
Discover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched ContentDiscover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched Content
ScyllaDB
Ā 
Chapter 5 - Managing Test Activities V4.0
Chapter 5 - Managing Test Activities V4.0Chapter 5 - Managing Test Activities V4.0
Chapter 5 - Managing Test Activities V4.0
Neeraj Kumar Singh
Ā 
ThousandEyes New Product Features and Release Highlights: June 2024
ThousandEyes New Product Features and Release Highlights: June 2024ThousandEyes New Product Features and Release Highlights: June 2024
ThousandEyes New Product Features and Release Highlights: June 2024
ThousandEyes
Ā 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
Mydbops
Ā 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo GĆ³mez Abajo
Ā 
An All-Around Benchmark of the DBaaS Market
An All-Around Benchmark of the DBaaS MarketAn All-Around Benchmark of the DBaaS Market
An All-Around Benchmark of the DBaaS Market
ScyllaDB
Ā 
Cyber Recovery Wargame
Cyber Recovery WargameCyber Recovery Wargame
Cyber Recovery Wargame
Databarracks
Ā 

Recently uploaded (20)

Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Ā 
Call Girls ChandigarhšŸ”„7023059433šŸ”„Agency Profile Escorts in Chandigarh Availab...
Call Girls ChandigarhšŸ”„7023059433šŸ”„Agency Profile Escorts in Chandigarh Availab...Call Girls ChandigarhšŸ”„7023059433šŸ”„Agency Profile Escorts in Chandigarh Availab...
Call Girls ChandigarhšŸ”„7023059433šŸ”„Agency Profile Escorts in Chandigarh Availab...
Ā 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
Ā 
From NCSA to the National Research Platform
From NCSA to the National Research PlatformFrom NCSA to the National Research Platform
From NCSA to the National Research Platform
Ā 
Facilitation Skills - When to Use and Why.pptx
Facilitation Skills - When to Use and Why.pptxFacilitation Skills - When to Use and Why.pptx
Facilitation Skills - When to Use and Why.pptx
Ā 
Building a Semantic Layer of your Data Platform
Building a Semantic Layer of your Data PlatformBuilding a Semantic Layer of your Data Platform
Building a Semantic Layer of your Data Platform
Ā 
So You've Lost Quorum: Lessons From Accidental Downtime
So You've Lost Quorum: Lessons From Accidental DowntimeSo You've Lost Quorum: Lessons From Accidental Downtime
So You've Lost Quorum: Lessons From Accidental Downtime
Ā 
Automation Student Developers Session 3: Introduction to UI Automation
Automation Student Developers Session 3: Introduction to UI AutomationAutomation Student Developers Session 3: Introduction to UI Automation
Automation Student Developers Session 3: Introduction to UI Automation
Ā 
APJC Introduction to ThousandEyes Webinar
APJC Introduction to ThousandEyes WebinarAPJC Introduction to ThousandEyes Webinar
APJC Introduction to ThousandEyes Webinar
Ā 
Call Girls Chennai ā˜Žļø +91-7426014248 šŸ˜ Chennai Call Girl Beauty Girls Chennai...
Call Girls Chennai ā˜Žļø +91-7426014248 šŸ˜ Chennai Call Girl Beauty Girls Chennai...Call Girls Chennai ā˜Žļø +91-7426014248 šŸ˜ Chennai Call Girl Beauty Girls Chennai...
Call Girls Chennai ā˜Žļø +91-7426014248 šŸ˜ Chennai Call Girl Beauty Girls Chennai...
Ā 
ScyllaDB Leaps Forward with Dor Laor, CEO of ScyllaDB
ScyllaDB Leaps Forward with Dor Laor, CEO of ScyllaDBScyllaDB Leaps Forward with Dor Laor, CEO of ScyllaDB
ScyllaDB Leaps Forward with Dor Laor, CEO of ScyllaDB
Ā 
Guidelines for Effective Data Visualization
Guidelines for Effective Data VisualizationGuidelines for Effective Data Visualization
Guidelines for Effective Data Visualization
Ā 
Call Girls Kochi šŸ’ÆCall Us šŸ” 7426014248 šŸ” Independent Kochi Escorts Service Av...
Call Girls Kochi šŸ’ÆCall Us šŸ” 7426014248 šŸ” Independent Kochi Escorts Service Av...Call Girls Kochi šŸ’ÆCall Us šŸ” 7426014248 šŸ” Independent Kochi Escorts Service Av...
Call Girls Kochi šŸ’ÆCall Us šŸ” 7426014248 šŸ” Independent Kochi Escorts Service Av...
Ā 
Discover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched ContentDiscover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched Content
Ā 
Chapter 5 - Managing Test Activities V4.0
Chapter 5 - Managing Test Activities V4.0Chapter 5 - Managing Test Activities V4.0
Chapter 5 - Managing Test Activities V4.0
Ā 
ThousandEyes New Product Features and Release Highlights: June 2024
ThousandEyes New Product Features and Release Highlights: June 2024ThousandEyes New Product Features and Release Highlights: June 2024
ThousandEyes New Product Features and Release Highlights: June 2024
Ā 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
Ā 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Ā 
An All-Around Benchmark of the DBaaS Market
An All-Around Benchmark of the DBaaS MarketAn All-Around Benchmark of the DBaaS Market
An All-Around Benchmark of the DBaaS Market
Ā 
Cyber Recovery Wargame
Cyber Recovery WargameCyber Recovery Wargame
Cyber Recovery Wargame
Ā 

Setting Up a Cloud Server - Part 2 - Transcript.pdf

  • 1. Setting up a Cloud Server - Part II We continue with installations of many packages we need to run everything
  • 2. #yum install xorg-x11-server-Xvfb Commands āœ¦ This allows some GUI related code to work on the server, although itā€™s still ā€œflakyā€ Ā© Codename One 2017 all rights reserved Our server is headless, that means it has no monitor or video display. So if we try to use an API like Swing or JavaFX the app will fail as it wonā€™t be able to display anything. Normally thatā€™s not a problem but since we might want to run the CSS compiler it would need access to graphics. Itā€™s also useful for other features so if you want to generate images on the server the ability to use Java2D would be useful. Thatā€™s where XVFB comes in handy. X11 is the windowing system for Linux and other unix flavors. XVFB uses X on frame buļ¬€er and eļ¬€ectively allows us to draw even without a display. Thatā€™s useful if we need to run GUI code that doesnā€™t actually need the screen.
  • 3. #yum install unzip Commands āœ¦ Unzip allows us to copy/download tools like Ant Ā© Codename One 2017 all rights reserved We will next install unzip weā€™ll need it later on to install ant
  • 4. #yum install mariadb-server Commands āœ¦ We can install mysql but maria is standard on centos so I went with that Ā© Codename One 2017 all rights reserved The next step is the installation of Maria DB which I mentioned earlier. Itā€™s a fork of MySQL that is supported by Centos. This installs the server itself but we need a few additional steps.
  • 5. #systemctl start mariadb Commands āœ¦ We add maria to the startup script of the VPS Ā© Codename One 2017 all rights reserved This adds mariadb to the startup script so it loads on system boot
  • 6. #systemctl enable mariadb Commands āœ¦ We verify that mariadb is enabled in the startup process Ā© Codename One 2017 all rights reserved This step verifies that the previous step succeeded and maria db is running. I would go into more details on this but boot process in Linux is a bit diļ¬€erent between distributions so Iā€™d rather not dig in too much
  • 7. #mysql_secure_installation Commands āœ¦ This script secures the mysql install by removing common security pitfalls āœ¦ Follow the scripts advice and restrict everything āœ¦ Ideally pick the same password you have in the desktop version of mysql otherwise deployment might be error prone Ā© Codename One 2017 all rights reserved MySQL and MariaDB ship with a great script to harden security. I followed the advice and restricted as much as possible although you might want to allow your IP to have remote access to the server. This might make it easier to administer the server remotely. This is an important step, having a server discoverable on the internet is pretty dangerous. One thing I did which is important was setting the database password to the same value as the one I have in the development server. That means the code is exactly the same albeit slightly less secure. To be fair thatā€™s not a problem if the database canā€™t be accessed remotely.
  • 8. #iptables -t nat -A PREROUTING -p tcp -- dport 80 -j REDIRECT --to-port 8080 Commands āœ¦ Setting tomcat to work on port 80 is problematic, this makes all port 80 traļ¬ƒc to to port 8080 Ā© Codename One 2017 all rights reserved The next step is exposing the right port. Unix based systems block TCP ports below 1024. You canā€™t listen on that port without root privileges. This is generally a security measure so a random user who logs into a system wonā€™t start a server on the machine. There are many ways around it but the one I use most often is iptables which you need to run as root and eļ¬€ectively redirect traļ¬ƒc in the kernel level. So traļ¬ƒc on port 80 gets redirected to 8080 in this command line. In case you donā€™t know port 80 is the default port for the HTTP protocol
  • 9. #iptables -t nat -A PREROUTING -p tcp -- dport 443 -j REDIRECT --to-port 8443 Commands āœ¦ This is the exact same command for 443 which is the port for HTTPS Ā© Codename One 2017 all rights reserved Port 443 isnā€™t as known as port 80, itā€™s the default port of the https protocol so we are doing here the exact same thing for that and port 8443
  • 10. #su builder Commands āœ¦ We now become the builder user so we can setup the server tasks here Ā© Codename One 2017 all rights reserved Finally itā€™s time to become the builder. Notice we donā€™t need a password to do this as we are assuming the builder user from the root user
  • 11. $cd ~ Commands āœ¦ ~ represents the home directory in this case itā€™s a shorthand for /home/builder āœ¦ Since we are currently in /root itā€™s problematic as we donā€™t have permissions here Ā© Codename One 2017 all rights reserved Tilde is a special character in unix. It represents the home directory of the user so when we are root tilde is /root and when we are builder itā€™s /home/builder. Currently we are at /root because thatā€™s where we logged in so we need to go to the home directory of builder and thatā€™s what this command does. Notice that the sign next to the command is a dollar sign and not a pound sign (or hash sign). Thatā€™s because we are now using the user account and not the root account
  ēæ»čƑļ¼š