Last time, I proceeded to create an AWS account.
This time, I will proceed with the tutorial "Start Linux Virtual Machine" that can be viewed from the following URL.
It is explained as follows on the AWS official website.
The easy-to-use cloud platform Lightsail offers everything you need to build applications and websites, plus a cost-effective monthly plan. Whether you're new to the cloud or want to access the cloud right away using your trusted AWS infrastructure, we can help.
I understand that it is a platform, but it seems that it is quick to actually use it to know the details.
When you sign in to your AWS account on the tutorial page, you'll be taken to the Lightsail home page.
Select "Linux / Unix" in "Select Instance Image", click "OS Only" in "Select Blueprint", and then select "Amazon Linux 2".
Select Instance Plan. It seems that you can try the "3.50 USD" Lightsail plan for free for one month.
Enter a name for your instance.
Click Create Instance.
The Instances tab on the Lightsail home page opens, displaying the instances you created. Click on the top right of the displayed instance and select Connect.
A browser-based terminal window will appear where you can enter Linux commands to manage your instances without configuring an SSH client.
Install nginx with the following command.
sudo amazon-linux-extras install nginx1
Start nginx with the service
command.
sudo service nginx start
Once you have installed and started nginx, you will be able to access your web server. Open a browser and enter the EIP of the instance (example: http://xxx.xxx.xxx.xxx/) to open it. If the following page is displayed in your browser, the installation of the web server is complete.
Refer to the following article and change the password after installing MySQL.
Connect to MySQL with the changed password.
mysql -u root -p
After that, you will be asked for a password, which you can enter to access MySQL.
Next, let's get a list of databases. Execute the following command.
show databases;
If the following message is displayed, MySQL installation and startup is complete.
Finally, install the application. Here, we'll use Rails to run a simple CRUD application that works with the MySQL we just built. To use Rails, you need an environment where you can build, so install the package used for build.
sudo yum -y groupinstall 'Development Tools'
You will also need the Ruby and MySQL libraries, so perform the installation.
sudo yum -y install ruby-devel mysql-devel
Rails requires Node.js as the JavaScript runtime. (1) Enter the following on the command line to install the node version manager (nvm).
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
You can install multiple versions of Node.js with nvm, and you can switch between them, so use nvm to install Node.js.
(2) Enable nvm by entering the following on the command line.
. ~/.nvm/nvm.sh
③ At the command line, type the following and use nvm to install the latest version of Node.js.
nvm install node
④ Enter the following on the command line to test that Node.js is installed and running correctly.
node -e "console.log('Running Node.js ' + process.version)"
Recommended Posts