In the past few days, I have been thinking about reducing the Data Transfer fee for AWS RDS. Since the file server is not in AWS, connecting to RDS will be charged Data Transfer Fee based on traffic, and the fee is extremely high. I thought of several solutions:
- Moved the file server to EC2, but the price is a bit too much
- Use Elastic Beanstalk or EC2 Container Service to make a Dock to run php
- Move the database out of RDS
During various struggles and research, I suddenly discovered that Amazon has added a Lightsail service, which has a fixed price per month and is very low (the lowest is only per month). I researched it in depth and found it to be very good. I would like to share my practical experience.
First of all, he has the US East, US West, Japan and other computer rooms to choose from, especially the Japanese computer room, which should be very in line with domestic needs. Secondly, he directly provides installed service packages, including popular wordpress, LAMP, and Nginx. I tried wordpress and nginx.
Supplement: He also has the option of independent IP
The feeling of wordpress is that lamp adds a wordpress installation package, which can be accessed directly after installation. If integration is needed, just import files and databases directly.
I am an nginx controller, and I wanted to see if it could have multiple sites, so I mainly researched nginx VPS.
The control platform on the web page is very simple, so I won’t introduce it much. The key points are 1. Bind IP, 2. Open SSH, 3. Port switch. The server uses bitnami (it doesn’t matter if you are not familiar with it, the operation instructions are almost the same as those of Ubuntu). Here are a few important operations:
backup
The reason why I put this at the top of my list is because it was just hacked. Unfortunately, LightSail does not provide an automatic backup service (there is no charge). It is expected that it will be available in the future. However, it has the function of manually creating snapshots. If you are not afraid of trouble, you can often manually back up by yourself. Due to the trust in AWS security and the fact that the server is officially configured, it should be so easy to be hacked.
However, snapshot has an advantage. It can be used as an AMI to take a snapshot of the configured server and then deploy it directly to the new server, saving a lot of time.
root password
I didn't understand it at first, but I figured it out after reading his documentation. It was automatically generated. Enter SSH and enter
cat bitnami_application_password
SSH Key
This thing is the basis for many operations below. Go to the account to download it. Just like ec2, put it in a safe place and set the permissions to 400.
PHPMyadmin
His database is local, but cannot be accessed externally by default. All database operations are done through phpmyadmin. The connection method is as follows (for mac):
1. Create an ssh tunnel
ssh -N -L 8888:127.0.0.1:80 -i your pem file bitnami@serverIP
2. Just access localhost:8888/phpmyadmin with your browser
3. The username is root and the password is the password mentioned above
Officially, it supports changing passwords and external 3306 access. If you are interested, you can read the official documentation: https://docs.bitnami.com/aws/components/phpmyadmin/?utm_source=bitnami&utm_medium=cloudimage&utm_campaign=aws
SFTP login file system
Address: IP
Port: 22
Username: bitnami
Remember to bind the certificate first (google it if you don’t know how)
multisite/https
In fact, with such a cheap price, one machine and one site is not an exaggeration, but now that we have researched it, let’s introduce how to set up multiple sites.
In fact, if you know how to set up nginx, it is not difficult. The main thing is to figure out its directory structure:
Website file directory(The default user has write permission): /opt/bitnami/nginx/html. You can create directories for each website here. In addition, it is best to put the nginx conf here (otherwise you have to use ssh to do it yourself). I also put the https certificate here (not safe, leave it for testing)
Nginx configuration:/opt/bitnami/nginx/conf/nginx.conf, add include "directory/*.conf" at the bottom
Restart Nginx: At this time, you need to ssh. This is different from the normal restart. You need to use the following command:
sudo /opt/bitnami/ctlscript.sh restart nginx
PHP7
The default PHP is 5.4, which makes people who are used to 7 very unhappy. I searched online and found that upgrading is a bit troublesome, so I decided not to do it myself. Friends who are interested can do it themselves. If you can write a guide to share, I would be grateful. The official responded in June that it was already working on it, but there was no time for release yet. I choose to wait. After all, I use this for convenience. It’s too complicated to get EC2.
Other questions
WordPress can be updated without FTP:
define('FS_METHOD', 'direct'); But remember to change the directory owner and permissions:
sudo chmod 775 -R /opt/bitnami/nginx/html/your directory address/wp-content/plugins/ sudo chown -R bitnami:daemon /opt/bitnami/nginx/your directory address/wp-content/
When importing sql, it inexplicably prompts 413 Request Entity Too Large nginx. The reason has not been found yet. It can be imported using the following methods
mysql -u root -p jing_blog < /opt/bitnami/ngi nx/html/Untitled.sql
Summarize
As a low-end market product, Amazon Lightsail is still very attractive to me. It has low prices, stable services based on AWS, computer rooms around the world, and simple deployment (not fool-proof, it still requires technical skills). Moreover, it changes the complex operation interface of AWS. The web page is very generous and intuitive, and the user experience is very good. However, compared with naked servers like linode, it still lacks a lot of playability. In addition, it is almost independent of AWS and cannot integrate load balance, cloudfront and other services (but it has VPC peering). However, based on its advantages, I plan to test it for a while and slowly move the small site over. If there are new discoveries, we will continue to update. Welcome to leave a message for communication.
This siteOriginal articleAll follow "Attribution-NonCommercial-ShareAlike 4.0 License (CC BY-NC-SA 4.0)". Please keep the following tags for sharing and interpretation:
Original author:Jake Tao,source:"Amazon LightSail Practical Experience"

Comment list (8 items)
[…] | AWS LightSail (Details:https://blog.jing.do/5632); | […]
Which of the LightSail servers in Japan and Singapore is faster? Have you tested it?
@Bin:I haven't tested it in China. Just open WordPress and test the opening speed.
@Jake Tao:I'll open a Japanese store to try for the time being.
It doesn’t feel like it’s an AWS thing
@ Papa Smurf:It does seem to be affiliated
What do bloggers think of the stability?
@anonymous:After using it, it's okay. But it feels a bit slow