[LINUX] Until the web application is released on Sakura VPS


I will summarize the flow of uploading what was created in the local environment on the server and publishing it. I will summarize the clogged parts etc. in a memorandum.

Rough flow

1 Contract for Sakura VPS 2 Construction of Linux environment 3 Domain acquisition 4 Document route change 5 SSL

1 Sakura VPS contract

First of all, from the Sakura VPS contract. Click here to apply for Sakura VPS スクリーンショット 2020-03-19 20.49.44.png

There is a 14-day trial period, so if you can complete it during that period, you can study for free.

Registration is complete Log in to the control panel as shown below. スクリーンショット 2020-03-19 20.54.35.png

Information on the contracted VPS is described.

Linux environment construction

Purchase the Udemy course below to study Linux. [Can be done in 3 days] Introduction to Linux server construction for the first time (CentOS 7, PHP 7, Docker compatible)

I personally recommend it because I was able to study the flow from installing CentOS on VPS to building a LAMP environment in an easy-to-understand manner.

Points that stumbled upon building a Linux environment

**-Set up a firewall and log in with SSH ** → Check the port where the firewall is set → Reload and reflect the updated content → Restart the daemon to reflect on the SSH server

** ・ What can be done by general users and privileged (root) users on the server ** General user = Can read and write files under your own directory Privileged (root) user = User with administrator privileges

Give general users administrator privileges Since the instructions of the root user are absolute and there is a possibility that system files etc. may be deleted by mistake, it is basically preferable to give the general user administrator privileges to perform operations.

**-Change firewall settings so that the server can be accessed from the outside ** → Cannot access if this cannot be set

Once this is done and you connect to your VPS IP address, you'll be taken to the Apache standard page.

Because the default document root is / var / www / html For example, if you put ʻindex.htmlunder this, the contents will be displayed. The URL looks like thisxx.xx.xx.xx/index.html`

Domain acquisition

You can display the IP address as it is, but you need to acquire a domain in order to recognize the service when publishing the web application.

Obtain a domain from Sakura Internet or Name.com.

See the link below for how to set up your domain [Domain setting] Use the domain acquired and managed by Sakura Internet

In short, link the IP address of the server with the acquired domain.

When the setting is completed, it is the same even if you rewrite the domain that acquired the IP address part (xx.xx.xx.xx) that was displayed in the above xx.xx.xx.xx / index.html. You will be able to access.

Issue a free SSL certificate with Let's encrypt and make it SSL

Lets encrypt this time to issue SSL certificate for free

** Stumble points ** I installed it and issued a certificate, but it is not SSL-enabled ** → Apache needs to be set after issuing the certificate ** In /etc/httpd/conf.d/ssl.conf

SSLCertificateFile /etc/letsencrypt/live/[Server domain]/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/[Server domain]/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/[Server domain]/chain.pem

Set each Reference article https://weblabo.oscasierra.net/letsencrypt-2/

Document route change

Change the default document root so that the site is displayed when you access the acquired domain.

Without this change, for example, if you create a ʻexample directory under the default / var / www / html and put ʻindex.html under that, the URL will bedomain /example/index.html. It becomes a little ugly with.

Make the following settings so that the top page is displayed when only the domain is entered.

Located in <VirtualHost *: 80> at the bottom of /etc/httpd/conf/httpd.conf Change DocumentRoot to the directory you want to see.

In the above example, by changing the document root that is / var / www / html to / var / www / html / example, the contents of ʻindex.html` will be displayed when accessing the domain. To.

Recommended Posts

Until the web application is released on Sakura VPS
Until the Sphinx documentation is published on GitHub
Test.py is not reflected on the web server in Python3.
Until Python [Django] de Web service is released [Tutorial, Part 1]
Until Python [Django] de Web service is released [Environment construction]
The road to web application development is a long way off
Settings until the Dango project is started on the server with Pycharm
Sakura Use Python on the Internet
Until you publish (deploy) a web application made with bottle on Heroku
# 1 Until you deploy Django's web application (instance construction with EC2 on AWS)
Try using the web application framework Flask
The one who is not on DVD
Download files on the web with Python
Until pix2 pix-tensorflow is run on GCML
Publish the current directory on the web server
[Ossan who is over 50 years old] Until he made the first WEB application in his life. (Deep learning)
The epidemic forecast of the new coronavirus was released on the Web at explosive speed
Execution environment on the Web by "Project Jupyter"
Let's simulate the Izhikevich neuron model on the web!
The .pyd file is the DLL itself on Windows
Have pandas read the zip file on the web
Building a Python environment on a Sakura VPS server
[Ruby on Rails] From application creation to server startup & what is the port number?
Until you run a Flask application on Google App Engine for the time being
Solve the problem that CSS is not reflected during web application development in Flask