TzuTzu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
--- tags: bug , --- # HTTPS 的問題 主機 : 使用 GCP 作業系統 : ubuntu --- 打一下目前嘗試過的: 感覺網路上有很多自動獲取 Let’s Encrypt 憑證 我使用的是 [SSL For Free](https://www.sslforfree.com/),不過開始操作他是跳到 [ZeroSSL](https://manage.sslforfree.com/dashboard) > zerossl併購了sslforfree,所以從www.sslforfree.com登入後,它給你直接切換到zerossl的登入界面 目前是操作到憑證可以下載,一開始我選擇 Google App Engine ![](https://i.imgur.com/mUW2qWL.png) 不過照著 [Installing SSL Certificate on Google App Engine](https://help.zerossl.com/hc/en-us/articles/360015629359-Installing-SSL-Certificate-on-Google-App-Engine) 這個文件設定,下載憑證時確實有三個檔案 * certificate.crt * ca_bundle.crt * private.key 但在 GCP 上傳 SSL 憑證,我只上傳了`certificate.crt` 和 `private.key` 但最後它還是說`您不是這個憑證的網域授權擁有者` ![](https://i.imgur.com/2CcxN61.png) ![](https://i.imgur.com/ks86U8c.png) 因為在 GCP 上傳 SSL 憑證宣告失敗,我想說我作業系統是 ubuntu ,照著另一份 [Installing SSL Certificate on Ubuntu](https://help.zerossl.com/hc/en-us/articles/360015629419-Installing-SSL-Certificate-on-Ubuntu) 文件設定 不過現在是卡在它有一個步驟說 : > Next, you will need to find the Apache configuration file on your server. Typically, you will find the configuration file in /etc/apache2/sites-enabled/your_site_name. In case you cannot find your configuration file, you can run the following command: sudo a2ensite your_site_name Once the Apache configuration file is located, you will need to configure the virtual host section of your website. Before you do so, please make sure to create a backup of your current *.conf file. This way, you will be able to undo any changes in case something goes wrong. A typical Virtual Host file looks like the file below: <VirtualHost *:443> DocumentRoot /var/www/site ServerName www.domain.com SSLEngine on SSLCertificateFile /path/to/certificate.crt SSLCertificateKeyFile /path/to/private.key SSLCertificateChainFile /path/to/ca_bundle.crt </VirtualHost> 我不太確定當它要叫我去`/etc/apache2/sites-enabled/your_site_name.` 那個 `your_site_name` 是什麼,因為在 `sites-enabled` 這個資料夾底下就只有 `000-default.conf` ,我就先當 `your_site_name` 是 `000-default.conf` 執行命令如下 ![](https://i.imgur.com/quAwh4q.png) `000-default.conf` 裡面內容是 : ``` <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet ``` 我多增加 ``` <VirtualHost *:443> DocumentRoot /var/www/html ServerName 34.105.41.98 SSLEngine on /etc/ssl/certificate.crt /etc/ssl/private/private.key /etc/ssl/ca_bundle.crt </VirtualHost> ``` 所以整份變成 : ``` <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet <VirtualHost *:443> DocumentRoot /var/www/html ServerName 34.105.41.98 SSLEngine on /etc/ssl/certificate.crt /etc/ssl/private/private.key /etc/ssl/ca_bundle.crt </VirtualHost> ``` 不過照著下一個步驟執行 `apachectlConfigtest` 出現 : ![](https://i.imgur.com/cpLY4lk.png) 所以我就先跳過直接 `apachectl stop` ,但出現 : ![](https://i.imgur.com/HyQYjoR.png) 原本這邊就卡住了,不知道該怎麼辦 --- 謝謝 John 給的參考文章 [Setting up Apache Server with SSL on Google Cloud Platform](https://dev.to/brandonbrown4792/setting-up-apache-server-with-ssl-on-google-cloud-platform-mh9) > First, let's make sure SSL is enabled for Apache. In the "/etc/apache2/sites-enabled" directory, you should find a file called "default-ssl.conf". In this file, verify that "SSLEngine on" exists. If you find "SSLEngine off", change it to "SSLEnging on". 其實我沒有確定 `SSL is enabled for Apache` ,反正就先找 `default-ssl.conf` 這個檔案,但它沒有放在 `/etc/apache2/sites-enabled` 所以用搜尋的 ![](https://i.imgur.com/X1HcG7K.png) 在 `/etc/apache2/sites-available/default-ssl.conf` 這邊,打開 `default-ssl.conf` 來看 `SSLEngine on` 是存在的 > Towards the end of the "default-ssl.conf" file, verify that there is a line similar to "SSLCertificateFile /etc/letsencrypt/live/...". If this line does not exist, try running the Certbot instructions again. 不過我沒有在底下找到類似 `SSLCertificateFile /etc/letsencrypt/live/...` --- 然後又嘗試了把 "default-ssl.conf" 複製一份在 `/etc/apache2/sites-enabled` ,再去執行 `apachectl restart` 這行指令,以為他就不會出 `Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration` 這個錯誤 ![](https://i.imgur.com/PwMQLDL.png) 其實我不知道 `sites-enabled` 和 `sites-available` 兩個資料夾差別,它們都有 `000-default.conf` 這個檔案,但 `sites-enabled` 沒有 `default-ssl.conf` 檔案 ![](https://i.imgur.com/T2qnkeU.png) --- 看到文章說不行要 try running the Certbot instructions again. 最後只好安裝 [Certbot](https://certbot.eff.org/) ,然後 5 行指令就成功解決 HTTPS 事情

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully