• Skip to main content
  • Skip to primary sidebar

プログラミング入門ナビ

プログラミング学習初心者のための情報メディア

You are here: Home / Archives for サーバー

サーバー

Herokuアカウントの新規作成方法

2018-10-28 By プログラミング入門ナビ編集部

Railsアプリケーション等を簡単にインターネットに公開できるクラウドサービスHerokuのアカウント作成方法について説明いたします。
この記事は、Ruby on Railsを使いWebアプリケーションを開発して公開するのサポートと記事です。

HerokuのWebサイトを表示

Heroku
このURLから登録します。

新規登録ボタンをクリック

必要事項を記入

必要事項を記入します。

迷いそうな点について補足すると、
役職は、学習用途であれば「趣味でのご利用」、
主な開発言語は、「Ruby」、としておけば問題ないでしょう。

メールアドレス確認

登録したメールアドレスに、確認メールが届きます。
記載されたURLをクリックして、確認を完了させます。

パスワード

セキュアなパスワードを設定します。

Herokuへようこそ


アカウント作成が完了しました。
ボタンをクリックします。

ログイン完了

ログインが完了しました。

おわりに

オンライン講座「Ruby on Railsを使いWebアプリケーションを開発して公開する」では、
汎用性が高くPythonやPHPと同様に人気のあるRubyを使ってWebアプリ作成に挑戦します。
基礎からAWSでの開発環境構築、Herokuを使ってWebアプリをインターネット上で公開するまでを体系的に学びます。

>> いますぐ確認する

詳細は無料プレビュー動画を30分用意しましたので、ぜひUdemyのWebサイトでご覧ください! !

コース紹介動画

Bestseller はじめてのRuby on Rails入門-RubyとRailsを基礎から学びウェブアプリケーションをネットに公開しようはじめてのRuby on Rails入門-RubyとRailsを基礎から学びウェブアプリケーションをネットに公開しよう中村 祐太 Yuta Nakamura, Proglus (プログラス)Rails8対応。汎用性が高くPythonやPHPと同様に人気のある Rubyを使ってWebアプリケーション開発に挑戦しよう。基礎からCodespacesによる開発環境構築、Renderを使ってインターネットに公開するまでを体系的に学べる¥11,800 4.4 (1934 ratings)156 lectures, 8 hours

動画で学ぶプログラミング入門

オンラインスクールProglus(プログラス)でプログラミングを学んで、創れる人になろう!

在宅学習応援!今なら複数の基礎コースが無料!!

今すぐ詳細を確認する

Filed Under: ツールの使い方 Tagged With: Heroku, PaaS, Ruby on Rails, Udemy, サーバー, プログラミング入門

無料のSSL証明書Let’s Encryptを設定・更新・自動更新する方法(CentOS7, Apache2.4対応)

2018-03-10 By プログラミング入門ナビ編集部

無料のSSL証明書Let’s Encryptを設定・更新・自動更新する方法を初心者向けに解説します。
GoogleがSSL化されたWebサイトをSEOの評価として優遇すると発表しており、Webページのhttps化は必須の流れとなっています。

Linuxサーバー構築運用入門 (CentOS7, PHP7, Apache, MySQL, WordPress対応)サポート記事です。

Let’ Encryptについて

誰でも無料で使えるSSL/TLS証明書発行サービスです。
mozilla, Google Chrome, facebook, ciscoなどがメジャースポンサーとなっていて安心感が有ります。

公式サイト


Let’s Encrypt

Certbotについて

この記事では、certbot(サートボット)という、Let’s Encryptの自動化を行うためのソフトウェアを利用します。

公式サイト

Certbot

ドキュメントなどが掲載されています(英語)

前提条件

  • CentOS7
  • Apache 2.4
  • httpでWebページを表示できる状態(http://blog.example.com といったURLではブラウザで表示できている状態)
  • VirtualHost設定済み
  • 設定するドメインはblog.example.com (各自のドメインに読み替えてください)

動画で学習する

① SSL証明書の設定 Let’s Encrypt

② SSL証明書設定の動作確認 Let’s Encrypt

③ SSL証明書の更新 Let’s Encrypt

インストールされるcertbotのバージョンを確認

$ yum list available | grep certbot-apache
python2-certbot-apache.noarch             0.21.1-1.el7                   epel

certbotインストール

$  sudo yum install certbot-apache
・・・略・・・
Is this ok [y/d/N]: y
・・・略・・・
完了しました!

SSL証明書の取得

$ sudo certbot --apache

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): nakamura@example.com ← 各自のメールアドレスを入力してエンターキー。
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org

-------------------------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: A ← 利用規約を確認したら、Aを入力してエンターキー

-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: Y ←  Electronic Frontier Foundationからメールを受け取り場合はY, 受け取らない場合は、Nを入力してエンターキー。
Starting new HTTPS connection (1): supporters.eff.org

Which names would you like to activate HTTPS for?
-------------------------------------------------------------------------------
1: blog.example.com
-------------------------------------------------------------------------------
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1 ← 1を入力してエンターキー(ドメインの選択)
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for blog.example.com
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/httpd/conf.d/blog.example.com-le-ssl.conf
Deploying Certificate for blog.example.com to VirtualHost /etc/httpd/conf.d/blog.example.com-le-ssl.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2 ← 2を選択してエンターキー(リダイレクトの設定。httpでのアクセスをhttpsにリダイレクトする)
Redirecting vhost in /etc/httpd/conf.d/blog.example.com.conf to ssl vhost in /etc/httpd/conf.d/blog.example.com-le-ssl.conf

-------------------------------------------------------------------------------
Congratulations! You have successfully enabled https://blog.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=blog.example.com
-------------------------------------------------------------------------------

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/blog.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/blog.example.com/privkey.pem
   Your cert will expire on 2018-06-08. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

 - We were unable to subscribe you the EFF mailing list because your
   e-mail address appears to be invalid. You can try again later by
   visiting https://act.eff.org.

「Congratulations! You have successfully enabled https://blog.example.net」と表示されれば、設定完了です。

動作確認

httpsでアクセス

ブラウザでhttpsから始まるURLでWebサイトを表示。

httpでアクセス

ラウザでhttpsから始まるURLでWebサイトを表示。
httpsへリダイレクトすることを確認する。

SSL証明書の更新

証明書の有効期限を確認する

$ sudo certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log

-------------------------------------------------------------------------------
Found the following certs:
  Certificate Name: blog.example.com
    Domains: blog.example.com
    Expiry Date: 2018-06-03 10:31:54+00:00 (VALID: 88 days)
    Certificate Path: /etc/letsencrypt/live/blog.example.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/blog.example.com/privkey.pem
-------------------------------------------------------------------------------

あと、SSL証明書の有効期限は、2018-06-03まで。残り88日であることが分かる。
Let’ EncrytpのSSL証明書は、有効期限3ヶ月と短いので注意しましょう。

次のコマンドを実行すると更新できます。(エンターキーはまだおさないでください)

$sudo   certbot renew

ただし、有効期限が30日未満のときしか更新されません。

–dry-run オプションをつけた上でリハーサル。

ドライランとは、簡単にいうとリハーサルです。おためし的に証明書を更新するコマンドを実行してエラーが起きないかなどを確認できます。ドライランでは、データの更新は行われないので安全です。

$ sudo certbot renew --dry-run
・・・略・・・
Congratulations, all renewals succeeded. 
・・・略・・・

ドライランが成功しました。
手動でSSL証明書を有効期限が30日未満になったら、ドラインランを実行してから、

$ sudo certbot renew

します。

もし、有効期限までの残り日数に関係なく、すぐに証明書を更新したい場合は、

次のコマンドを実行します。

$ certbot renew --force-renew

Saving debug log to /var/log/letsencrypt/letsencrypt.log

-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/blog.example.com.conf
-------------------------------------------------------------------------------
Plugins selected: Authenticator apache, Installer apache
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for blog.example.com
Waiting for verification...
Cleaning up challenges

-------------------------------------------------------------------------------
new certificate deployed with reload of apache server; fullchain is
/etc/letsencrypt/live/blog.example.com/fullchain.pem
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------

Congratulations, all renewals succeeded. The following certs have been renewed:
  /etc/letsencrypt/live/blog.example.com/fullchain.pem (success)
-------------------------------------------------------------------------------

更新できました。

SSL証明書の自動更新。

更新を3ヶ月に一回手動でおこなっていると、いつか忘れてしまうので、自動で更新する方法を学習します。
「cron」クロンという、定期的に指定したプログラムを実行できる仕組みを使います。
クロンの読み方ですが、英語のカタカタ読みですので、なにが正しいとかは無いのですが、
実務上、クーロンと呼ぶこともあります。

スケジュールを設定するファイルを開く

$ sudo vim /etc/crontab

例えば、毎朝3:10に、rootユーザでcertbot renewを実行するには。

下記を追記。

10 3 *  *  * root /usr/bin/certbot renew

※ 注意点としては、ここでは、–force-renewalオプションはつけないでください、let’s encryptの使用量制限に引っかかる可能性があります。

これで、毎日更新がこころみられて、有効期限が30日未満だと、証明書の更新が実際に行われます。

注意点

特に初めてSSL証明書の更新が行われるまでは、

時々、証明書の有効期限を確認して、期限切れにならないように注意しましょう。

$ sudo certbot certificates

cronによって自動で証明書が更新されているか、確認してください。残り30日を切っているのに、数日様子を見ても、更新がされない場合は、なにかトラブルが起きている可能性があります。

その場合は、手動で更新を試みてみるのも一つの手です。

$sudo certbot renew

ログを確認して、トラブルシューティングをする方法もあります。
letsencryptのログは、このディレクトリにありますのでトラブルが起きたときに確認します。

$ sudo ls -la /var/log/letsencrypt/

例えば、最新のログを確認するには、

sudo less  /var/log/letsencrypt/letsencrypt.log

とします。表示されている、エラーメッセージをgoogleで検索したりしながら、解決を試みます。

SSL証明書の有効期限が切れると、ユーザーがサイトをブラウザで表示した時に、ブラウザにエラーが表示されて、ユーザから不審に思われてしまいますので、注意しましょう。

動作確認環境

  • CentOS Linux release 7.4.1708 (Core)
  • Server version: Apache/2.4.6 (CentOS)
  • python2-certbot-apache 0.21.1-1.el7
  • さくらのVPS 1Gプラン

おわりに

この記事では、無料のSSL証明書Let’s Encryptを設定・更新・自動更新する方法を学習しました。

オンライン講座、Linuxサーバー構築運用入門 (CentOS7, PHP7, Apache, MySQL, WordPress対応)では、Linuxの操作に慣れていない方向けに、無料のSSL証明書Let’s Encryptを設定・更新・自動更新する方法を説明しています。

動画で1からわかりやすく説明していますので、ぜひご利用ください。

Bestseller はじめてのLinuxサーバー構築運用入門 - Linuxコマンドを基礎から学ぶはじめてのLinuxサーバー構築運用入門 - Linuxコマンドを基礎から学ぶ中村 祐太 Yuta Nakamura, Proglus (プログラス)Linuxコマンド操作を基礎から学習してLAMPを構築できる. Linux, Apache MySQL(MariaDB), PHP, WordPressのインストールを実施.¥11,800 4.3 (1944 ratings)99 lectures, 5 hours

動画で学ぶプログラミング入門

オンラインスクールProglus(プログラス)でプログラミングを学んで、創れる人になろう!

在宅学習応援!今なら複数の基礎コースが無料!!

今すぐ詳細を確認する

Filed Under: ツールの使い方 Tagged With: Certbot, Let's Encrypt, Linux, SSL証明書, Udemy, サーバー

無料で日本語のセキュリティ情報を入手する方法

2018-03-09 By プログラミング入門ナビ編集部

Linuxサーバーを保守運用していくには、日頃からセキュリティ情報を入手することが必要です。
下記のサイトから有益な情報が入手できるので、チェックするのがおすすめです。

Linuxサーバー構築運用入門サポート記事です。

JPCERT コーディネーションセンター

情報セキュリティ対策活動を実施

公式サイト

https://www.jpcert.or.jp/

Twitter

https://twitter.com/jpcert

メーリングリスト

https://www.jpcert.or.jp/announce.html

Japan Vulnerability Notes

脆弱性対策情報ポータルサイト

公式サイト

http://jvn.jp/

Twitter

https://twitter.com/jvnjp

「IPA 独立行政法人情報処理推進機構」
日本におけるIT国家戦略を技術面、人材面から支えるために設立。

公式サイト

https://www.ipa.go.jp/security/index.html

メールニュース

https://www.ipa.go.jp/about/mail/index.html

おわりに

この記事では、無料で日本語のセキュリティ情報を入手する方法について学習しました。
これからLinux操作を覚えたい初心者向けに、オンライン講座を公開中です。
Linuxサーバー構築運用入門 (CentOS7, PHP7, Apache, MySQL, WordPress対応)
Linux操作を基礎から学習。 さくらのVPSを設定して独自ドメインのhttps対応オリジナルブログをWordPressを使って公開できるようになります。
無料プレビューを提供していますので、ぜひご確認ください。

Bestseller はじめてのLinuxサーバー構築運用入門 - Linuxコマンドを基礎から学ぶはじめてのLinuxサーバー構築運用入門 - Linuxコマンドを基礎から学ぶ中村 祐太 Yuta Nakamura, Proglus (プログラス)Linuxコマンド操作を基礎から学習してLAMPを構築できる. Linux, Apache MySQL(MariaDB), PHP, WordPressのインストールを実施.¥11,800 4.3 (1944 ratings)99 lectures, 5 hours

動画で学ぶプログラミング入門

オンラインスクールProglus(プログラス)でプログラミングを学んで、創れる人になろう!

在宅学習応援!今なら複数の基礎コースが無料!!

今すぐ詳細を確認する

Filed Under: ツールの使い方 Tagged With: Linux, Udemy, サーバー, セキュリティ

Primary Sidebar

Twitter

Follow @programmingnavi Tweets by programmingnavi

Facebookページ

プログラミング入門ナビ

メルマガに今すぐ登録!

ブログの更新情報やお得なクーポン情報などをお知らせします。

登録はこちらから。

人気の記事

まだデータがありません。

最近の投稿

  • 【7/9更新】Udemyプログラミング入門講座等の割引クーポン配布
  • JavaScriptの「this」は呼び出し方によって値が変わる?違いを徹底解説!
  • JavaScriptのfor文で配列要素の足し算をするとNaNが出るのはなぜ?原因と対処法を解説!
  • プログラミング学習を成功させるポイントを3つお送りいたします
  • 初心者がスマホアプリを開発するには?iOSとAndroidの両方について必要なスキルを確認しよう

カテゴリー

  • エンジニアのしごと
  • エンジニアへの道
  • ツールの使い方
  • ニュース
  • プログラミング入門

タグクラウド

AI AWS AWS Cloud9 Bootstrap Cloud9 CodeWing CSS Git GitHub Heroku HTML JavaScript Linux macOS MySQL MySQL Workbench node.js Nuxt.js Proglus Python Ruby Ruby on Rails SQL Udemy Vue.js Web開発 Windows Windows10 エラー エンジニア オンライン学習 サーバ サーバー スクリーンショット セキュリティ セール データベース プログラミング プログラミング入門 プログラミング学習 ユーデミー 初心者 未経験 機械学習 開発環境構築

アーカイブ

  • 2020年7月
  • 2020年5月
  • 2020年4月
  • 2020年3月
  • 2020年2月
  • 2020年1月
  • 2019年11月
  • 2019年9月
  • 2019年7月
  • 2019年6月
  • 2019年5月
  • 2019年4月
  • 2019年3月
  • 2019年2月
  • 2019年1月
  • 2018年12月
  • 2018年11月
  • 2018年10月
  • 2018年9月
  • 2018年8月
  • 2018年7月
  • 2018年6月
  • 2018年5月
  • 2018年4月
  • 2018年3月

検索

Copyright © 2025 · programmingnavi.com ・About・プライバシーポリシー