SlideShare a Scribd company logo
1 of 13
Download to read offline
Setting up a Cloud Server - Part III
Lets go to the client side for a moment and do some operations on your local machine, specifically file copy
$scp ~/rest-builder.properties
builder@ip.of.remote.server:/home/builder
From Desktop
✦ Use SCP from the desktop to copy the files
needed in the server
✦ If you use a Mac just copy using the “builder” user
to the home directory
© Codename One 2017 all rights reserved
SCP is secure copy. It allows us to copy a file from our desktop to the server or visa versa. On windows there are some visual SCP tools but on a Mac I like using the
command line which I find more convenient.

The syntax might seem odd. If you are familiar with the unix cp command this is roughly the same syntax only thru the network. 

This code is executed on my local mac so the first argument copies my instance of rest-builder.properties which includes the server configuration settings. That’s the file
we will be copying. The second argument is the destination. Since it’s remote it starts with the user name on the remote machine followed by the at sign and the IP
address of the remote machine. Then a colon is used to give the destination path on the remote machine. 

You will be prompted for the password of builder at which point copy will proceed. This is a very useful command.
scp ~/dev/AppBackendServer/target/
AppBackendServer-0.0.1-SNAPSHOT.jar
builder@ip.of.remote.server:/home/builder
From Desktop
✦ Copy the actual app to the server
© Codename One 2017 all rights reserved
Now that we got that out of the way I can just copy the actual jar to the server. Same exact thing
$nano ~/rest-builder.properties
Commands
✦ Edit the properties file, make sure the values are
correct
✦ For now I set SERVER_URL to http://
server.ip.address
© Codename One 2017 all rights reserved
And now back on the server we can open a text editor and set the value of server URL to the current IP address. Nano is a reasonably easy to use text editor, at least
when compared to vi. You can use ctrl-X to exit, you will be prompted to save.
$mysql -p
Commands
✦ Login to mysql and execute “create database
backendapp”
© Codename One 2017 all rights reserved
Next lets login to mysql, we’ll be prompted for the password. We need to run the create database command, notice that the tables will be created implicitly by JPA.
$wget http://apache.spd.co.il//ant/
binaries/apache-ant-1.10.1-bin.zip
Commands
✦ Download Apache Ant
© Codename One 2017 all rights reserved
The next step is to download apache ant which we need in order to build the resulting application
$unzip apache-ant-1.10.1-bin.zip
Commands
✦ Unzip Apache Ant zip
© Codename One 2017 all rights reserved
We can unzip it in the users home directory thanks to the unzip command we installed previously
$mv apache-ant-1.10.1 ant
Commands
✦ We need ant to be in a directory with the name
“ant” so the build script will find it
© Codename One 2017 all rights reserved
Since the version number for ant is a bit problematic I’m renaming the directory ant so the build process can find it. The mv command represents move and works as a
rename.
$mv AppBackendServer-0.0.1-SNAPSHOT.jar
AppBackendServer.jar
Commands
✦ I’d rather not have the 0.0.1 jar name…
© Codename One 2017 all rights reserved
I also rename the backend server. It shouldn’t include the version as we’ll update it in the future and we don’t want it to carry an outdated version number. Technically it
might have been more “correct” to use a symlink but I want to keep things simple
$exit
Commands
✦ We need to go back to root. Notice using “su”
would work if we changed something in the
session
© Codename One 2017 all rights reserved
You might recall we did a su builder so I’m just exiting from that su command and returning to the root account. If I use exit from there I will logoff from the server
#ln -s /home/builder/
AppBackendServer.jar /etc/init.d/
AppBackendServer
Commands
✦ We create a symbolic link to the /etc/init.d
directory which will allow us to start the app as a
service
© Codename One 2017 all rights reserved
This command might be confusing to windows users since there is nothing like this one Windows. The Unix file system supports a feature called symbolic links.
Essentially it creates what looks and acts like a file or a directory but it’s really a file system pointer at a file that resides elsewhere. 

In this case I created a symlink in /etc/init.d named AppBackendServer. Notice that it doesn’t have the jar extension!

This points to the jar file we have in the builder home directory. If you know Linux or Unix this must look really weird…
#service AppBackendServer start
Commands
✦ This runs the server and it should now work, you
can stop it using the same command with “stop”
at the end
© Codename One 2017 all rights reserved
If you know Linux or Unix you might be thinking “what the hell just happened”?

Well, the jar is really a linux shell script too. So by placing the symlink in the init.d directory it starts working as a service just like mysql!

I can’t stress enough how amazing this is!
#cat /var/log/AppBackendServer.log
Commands
✦ Application logs are automatically stored under 

/var/log with the right name
© Codename One 2017 all rights reserved
Everything works exactly like you would expect from any other service on Linux. For instance you can see the output logs for the service under the /var/log directory

More Related Content

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

Symfony finally swiped right on envvars
Symfony finally swiped right on envvarsSymfony finally swiped right on envvars
Symfony finally swiped right on envvarsSam Marley-Jarrett
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
Setting Up a Cloud Server - Part 1.pdf
Setting Up a Cloud Server - Part 1.pdfSetting Up a Cloud Server - Part 1.pdf
Setting Up a Cloud Server - Part 1.pdfShaiAlmog1
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdfNigussMehari4
 
Definitive guide to setting up a lamp server using open source software
Definitive guide to setting up a lamp server using open source softwareDefinitive guide to setting up a lamp server using open source software
Definitive guide to setting up a lamp server using open source softwareparves kamal
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyAndré Rømcke
 
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingBeni Krisbiantoro
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administratorsSharon James
 
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docxPart 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docxkarlhennesey
 
DevOps For Small Teams
DevOps For Small TeamsDevOps For Small Teams
DevOps For Small TeamsJoe Ferguson
 
Lamp Server With Drupal Installation
Lamp Server With Drupal InstallationLamp Server With Drupal Installation
Lamp Server With Drupal Installationfranbow
 
Deploying Rails Apps with Capistrano
Deploying Rails Apps with CapistranoDeploying Rails Apps with Capistrano
Deploying Rails Apps with CapistranoNyros Technologies
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Productiondevopsdaysaustin
 
Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)
Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)
Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)Nicolas Brousse
 

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

Symfony finally swiped right on envvars
Symfony finally swiped right on envvarsSymfony finally swiped right on envvars
Symfony finally swiped right on envvars
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Capistrano
CapistranoCapistrano
Capistrano
 
Setting Up a Cloud Server - Part 1.pdf
Setting Up a Cloud Server - Part 1.pdfSetting Up a Cloud Server - Part 1.pdf
Setting Up a Cloud Server - Part 1.pdf
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
 
Lumen
LumenLumen
Lumen
 
Definitive guide to setting up a lamp server using open source software
Definitive guide to setting up a lamp server using open source softwareDefinitive guide to setting up a lamp server using open source software
Definitive guide to setting up a lamp server using open source software
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and Symfony
 
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administrators
 
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docxPart 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
 
DevOps For Small Teams
DevOps For Small TeamsDevOps For Small Teams
DevOps For Small Teams
 
Effective images remix
Effective images remixEffective images remix
Effective images remix
 
Lamp Server With Drupal Installation
Lamp Server With Drupal InstallationLamp Server With Drupal Installation
Lamp Server With Drupal Installation
 
Capistrano Overview
Capistrano OverviewCapistrano Overview
Capistrano Overview
 
Deploying Rails Apps with Capistrano
Deploying Rails Apps with CapistranoDeploying Rails Apps with Capistrano
Deploying Rails Apps with Capistrano
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
 
Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)
Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)
Scaling on EC2 in a fast-paced environment (LISA'11 - Full Paper)
 

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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 
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.pdfShaiAlmog1
 

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

Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 

Recently uploaded (20)

Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 

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

  • 1. Setting up a Cloud Server - Part III Lets go to the client side for a moment and do some operations on your local machine, specifically file copy
  • 2. $scp ~/rest-builder.properties builder@ip.of.remote.server:/home/builder From Desktop ✦ Use SCP from the desktop to copy the files needed in the server ✦ If you use a Mac just copy using the “builder” user to the home directory © Codename One 2017 all rights reserved SCP is secure copy. It allows us to copy a file from our desktop to the server or visa versa. On windows there are some visual SCP tools but on a Mac I like using the command line which I find more convenient. The syntax might seem odd. If you are familiar with the unix cp command this is roughly the same syntax only thru the network. This code is executed on my local mac so the first argument copies my instance of rest-builder.properties which includes the server configuration settings. That’s the file we will be copying. The second argument is the destination. Since it’s remote it starts with the user name on the remote machine followed by the at sign and the IP address of the remote machine. Then a colon is used to give the destination path on the remote machine. 
 You will be prompted for the password of builder at which point copy will proceed. This is a very useful command.
  • 3. scp ~/dev/AppBackendServer/target/ AppBackendServer-0.0.1-SNAPSHOT.jar builder@ip.of.remote.server:/home/builder From Desktop ✦ Copy the actual app to the server © Codename One 2017 all rights reserved Now that we got that out of the way I can just copy the actual jar to the server. Same exact thing
  • 4. $nano ~/rest-builder.properties Commands ✦ Edit the properties file, make sure the values are correct ✦ For now I set SERVER_URL to http:// server.ip.address © Codename One 2017 all rights reserved And now back on the server we can open a text editor and set the value of server URL to the current IP address. Nano is a reasonably easy to use text editor, at least when compared to vi. You can use ctrl-X to exit, you will be prompted to save.
  • 5. $mysql -p Commands ✦ Login to mysql and execute “create database backendapp” © Codename One 2017 all rights reserved Next lets login to mysql, we’ll be prompted for the password. We need to run the create database command, notice that the tables will be created implicitly by JPA.
  • 6. $wget http://apache.spd.co.il//ant/ binaries/apache-ant-1.10.1-bin.zip Commands ✦ Download Apache Ant © Codename One 2017 all rights reserved The next step is to download apache ant which we need in order to build the resulting application
  • 7. $unzip apache-ant-1.10.1-bin.zip Commands ✦ Unzip Apache Ant zip © Codename One 2017 all rights reserved We can unzip it in the users home directory thanks to the unzip command we installed previously
  • 8. $mv apache-ant-1.10.1 ant Commands ✦ We need ant to be in a directory with the name “ant” so the build script will find it © Codename One 2017 all rights reserved Since the version number for ant is a bit problematic I’m renaming the directory ant so the build process can find it. The mv command represents move and works as a rename.
  • 9. $mv AppBackendServer-0.0.1-SNAPSHOT.jar AppBackendServer.jar Commands ✦ I’d rather not have the 0.0.1 jar name… © Codename One 2017 all rights reserved I also rename the backend server. It shouldn’t include the version as we’ll update it in the future and we don’t want it to carry an outdated version number. Technically it might have been more “correct” to use a symlink but I want to keep things simple
  • 10. $exit Commands ✦ We need to go back to root. Notice using “su” would work if we changed something in the session © Codename One 2017 all rights reserved You might recall we did a su builder so I’m just exiting from that su command and returning to the root account. If I use exit from there I will logoff from the server
  • 11. #ln -s /home/builder/ AppBackendServer.jar /etc/init.d/ AppBackendServer Commands ✦ We create a symbolic link to the /etc/init.d directory which will allow us to start the app as a service © Codename One 2017 all rights reserved This command might be confusing to windows users since there is nothing like this one Windows. The Unix file system supports a feature called symbolic links. Essentially it creates what looks and acts like a file or a directory but it’s really a file system pointer at a file that resides elsewhere. In this case I created a symlink in /etc/init.d named AppBackendServer. Notice that it doesn’t have the jar extension! This points to the jar file we have in the builder home directory. If you know Linux or Unix this must look really weird…
  • 12. #service AppBackendServer start Commands ✦ This runs the server and it should now work, you can stop it using the same command with “stop” at the end © Codename One 2017 all rights reserved If you know Linux or Unix you might be thinking “what the hell just happened”? Well, the jar is really a linux shell script too. So by placing the symlink in the init.d directory it starts working as a service just like mysql! I can’t stress enough how amazing this is!
  • 13. #cat /var/log/AppBackendServer.log Commands ✦ Application logs are automatically stored under 
 /var/log with the right name © Codename One 2017 all rights reserved Everything works exactly like you would expect from any other service on Linux. For instance you can see the output logs for the service under the /var/log directory