WordPress 谷歌云主机建站教程

摘要:本篇文章将讲述谷歌云主机(Google Cloud Hosting)的建站教程,选择谷歌云主机来建站是需要带点技术含量的,但本文会把所有需要用的的代码按步骤放在这里,因此那怕是不懂技术的人,也一样轻松学会使用。 我们的建站教程一定是经过千锤百炼的,大家尽管跟着一步一步学习,一定令你喜出望外。 各位站长们可能会厌倦依赖单个服务器,停机时间长、加载慢和成本高都是使用单个服务器与其他公司遇到的所有故障。 然而,“云计算”允许你在多台服务器上托管你的网站,从而节省资金并确保永久可用性。 谷歌云是云托管提供商中最具竞争力的定价政策之一。在本篇文章中,我们将向你展示如何使用谷歌云配置 WordPress。

一、进入谷歌云官网

有账号就直接登录,没有就按照页面提示注册,免费试用谷歌云的300$赠金。(首次开通有活动)
领取赠金需要有国际信用卡认证,这个在中国区没有服务,只能选择其它国家,这里我们选择的是美国。注:虽然选择的是美国 ,但是可以直接用任何国家的Visa, Mestaer 的信用卡认证。这里就不详细说明。

注册成功后,进入控制台,菜单左侧有个结算,点击就会出现账户余额。

二、创建实例(搭建WordPress网站)

进入谷歌云后台之后,可以创建新的项目组,也可以使用现有项目组来创建实例。

接下来我们来一一讲解上图中的步骤:

1. 进入市场应用中心

2. 搜索WordPress,或者选择“博客与内容管理系统”。 这里我们选择的是安装“WordPress Certified by Bitami”,并点击部署应用。

3.填写 Developmentname 、 Zone 、 Machine type 、 Boot disk size inGB 等相关信息。

  • 实例名称(Developmentname)

实例名称可选默认,也可以自己命名。如果在谷歌云上搭建的网站很多,此名称是为了快速查找识别。
注:名称组合规则只能是小写字母数字以及“-”,不能有大写字母

  •  服务器位置(Zone)

这里的位置说的是你的WordPress网站位置,也就是你的主机位置 ——谷歌云服务器的位置(因为网站是搭建在服务器上的,这一关系大家要理清楚哦)。
这一选项是任意选择的,就看你目标客户群体的位置在哪,你就把网站位置定位在附近,因为这样肯定更有利于网速。
一般做外贸建议选择美国(一旦确认后不可更改),但是美国也分为好几个区,你的客户没有集中分布的话就随意选择即可。

谷歌云全球数据中心位置:https://cloud.google.com/about/locations/

选择需要区域数据中心:https://cloud.google.com/compute/docs/regions-zones/

  • 主机类型 / 服务器配置(Machine type)

根据自己网站实际情况选择主机类型 / 服务器配置。一般默认的1.7GB内存足够了,若是网站流量很大,那就需要选择更大的内存,因为内存越大,网速越快。1个vCPU一般也可以选。

不同的配置不同的价格,会在右边显示大概费用。

但是这里要提及的就是,谷歌云会赠送每年300美元的试用金,也就意味着在第一年你可以任性一点,选择好一点的主机类型,等到第二年交费的时候再换也是可以的啦~~

  • 硬盘大小(Boot disk size inGB)

默认是10GB,大多数网站都够用,如果网站需要上传大量文件,可以根据情况增加。    (实例配置内存及硬盘大小后面随时可以自己任意调整

  • 其它选项

其他选择项 (两个勾选框) 默认,直接“部署”,部署完成需等待一分钟左右。

部署完成后, WordPress 相关信息就显示在右边,其中包含谷歌自动分配的一个IP地址及管理后台网址,这个后面需要再绑定域名。

到此,WordPress网站的基础模型就搭建好了。

三、去除商家图标

打开网站可以看到这右下角有一个图标,这是提供商Bitnami的信息

我们可以通过SSH连接服务器用代码去掉。

在SSH窗口光标处输入下面代码框最后一行,也就是第25行hi@aucacom-vm:~$ 后面代码,可直接复制粘贴,然后按 Enter 键。

[code] Connected, host fingerprint: ssh-rsa 0 40:88:3E:E9:35:EB:3A:47:0E:21:87:BC:71:04:B0:84:6C:C2:35:47:C6:E9:D6:08:50:6A:7D:82:2B:B7:A7:F7
Linux aucacom-vm 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
___ _ __
| _ |_) |_ _ ___ _ _ __ (_)
| _|_| ‘ / _` | ‘| |
|___/_|__|_|_|__,_|_|_|_|_|

*** Welcome to the Bitnami WordPress 5.3-0 ***
*** Documentation:https://docs.bitnami.com/google/apps/wordpress/ ***
***https://docs.bitnami.com/google/ ***
*** Bitnami Forums: https://community.bitnami.com/ ***

#######################################################
###For frequently used commands, please run:###
###sudo /opt/bitnami/bnhelper-tool###
#######################################################

hi@aucacom-vm:~$ sudo /opt/bitnami/apps/wordpress/bnconfig –disable_banner 1
[/code]

运行代码后,我们再打开网站,可以看出图标已经消失。

四、IP地址绑定域名——域名解析

我们先了解一下什么是域名解析?

域名解析就是域名申请后做的到IP地址的转换过程。IP地址是网路上标识您站点的数字地址,为了简单好记,采用域名来代替ip地址标识站点地址。域名的解析工作由DNS服务器(域名服务器:是进行域名与对应IP地址转化的服务器 )完成。

在解析之前,我们还需要把部署的WordPress随机配的临时IP更改为静态IP

进入域名管理控制面板(登陆需要使用的域名管理后台,关于怎么使用域名,请参考我们的文章【好的域名选择建议】

域名A记录值指向网站IP,填写网站IP地址。

IP地址从创建实例中获取,也就是网站唯一IP。首个域名指向这个IP时,网站会自动默认此域名为这个网站的使用域名,这时我们网站已经完成域名解析。

  • 也可以使用谷歌DNS

使用谷歌DNS,那就需要把Godaddy默认的DNS更改为谷歌的DNS,具体步骤如下:

1. 在谷歌云后台增加域名服务,进入Google Cloud  DNS

 2. 创建DNS地区:地区名称随便命名,DNS名称就是域名,不带www

 3. 创建好谷歌地区DNS之后,会出现4个DNS默认路径,然后把这4个DNS复制到Godaddy上,更改Godaddy默认DNS。

这是Godaddy更改界面

4. 选择Custom定制,然后输入相关DNS,并且保存提交。

此时,Godaddy默认的DNS已经被更改,Godaddy的界面发生变化。

 5. 然后回到谷歌云,在 Google Cloud DNS上添加域名记录

6. 添加主域名指向

 7. 添加二级域名指向(www.)

Google Cloud  DNS完成配置,域名解析完成。

但网站IP还并没有跳转到主域名,这时我们可以和SSL安装证书一起搞定。

五、获取SSL证书

进入VM实例,点击SSH连接到服务器,在SSH窗口光标处输入下面代码框最后一行,然后按 Enter 键。

[code] wget https://dl.eff.org/certbot-auto && chmod a+x certbot-auto
[/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] ./certbot-auto certonly –webroot -w /opt/bitnami/apps/wordpress/htdocs/ -d auca.com -d www.auca.com
[/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] hi@aucacom-vm:~$ ./certbot-auto certonly –webroot -w /opt/bitnami/apps/wordpress/htdocs/ -d auca.com -d www.auca.comRequesting to rerun ./certbot-auto with root privileges…
Bootstrapping dependencies for Debian-based OSes… (you can skip this with –no-bootstrap)
Hit:1 http://security.debian.org stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease
Hit:3 http://packages.cloud.google.com/apt google-cloud-monitoring-stretch InRelease
Hit:4 http://deb.debian.org/debian stretch-updates InReleaseHit:5 http://packages.cloud.google.com/apt cloud-sdk-stretch InReleaseHit:6 http://deb.debian.org/debian stretch-backports InReleaseHit:7 http://deb.debian.org/debian stretch ReleaseHit:8 http://packages.cloud.google.com/apt google-compute-engine-stretch-stable InRelease
Hit:9 http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-stretch InRelease
Reading package lists… DoneReading package lists… Done
Building dependency treeReading state information… Done
ca-certificates is already the newest version (20161130+nmu1+deb9u1).
gcc is already the newest version (4:6.3.0-4).
gcc set to manually installed.
python is already the newest version (2.7.13-2).
openssl is already the newest version (1.1.0l-1~deb9u1).
openssl set to manually installed.
The following additional packages will be installed:libexpat1-dev libpython-dev libpython2.7-dev python-pip-whl python2.7-dev python3-virtualenv
Suggested packages:augeas-doc augeas-tools
Recommended packages:libssl-doc
The following NEW packages will be installed:augeas-lenses libaugeas0 libexpat1-dev libffi-dev libpython-dev libpython2.7-dev libssl-dev python-devpython-pip-whl python-virtualenv python2.7-dev python3-virtualenv virtualenv
0 upgraded, 13 newly installed, 0 to remove and 4 not upgraded.
Need to get 32.6 MB of archives.
After this operation, 54.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
[/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] Processing triggers for libc-bin (2.24-11+deb9u4) …
./certbot-auto has insecure permissions!
To learn how to fix them, visit https://community.letsencrypt.org/t/certbot-auto-deployment-best-practices/91979/
Creating virtual environment…
Installing Python packages…
Installation succeeded.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Enter email address (used for urgent renewal and security notices) (Enter ‘c’ to
cancel): hi@auca.com
[/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
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-v02.api.letsencrypt.org/directory
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
(A)gree/(C)ancel: a
[/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] 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-v02.api.letsencrypt.org/directory
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
(A)gree/(C)ancel: 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 our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
(Y)es/(N)o: n
[/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] IMPORTANT NOTES:- Congratulations! Your certificate and chain have been saved at:/etc/letsencrypt/live/auca.com/fullchain.pemYour key file has been saved at:/etc/letsencrypt/live/auca.com/privkey.pemYour cert will expire on 2020-02-17. To obtain a new or tweakedversion of this certificate in the future, simply run certbot-autoagain. To non-interactively renew *all* of your certificates, run”certbot-auto renew”- Your account credentials have been saved in your Certbotconfiguration directory at /etc/letsencrypt. You should make asecure backup of this folder now. This configuration directory willalso contain certificates and private keys obtained by Certbot somaking 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/donateDonating to EFF:https://eff.org/donate-lehi@aucacom-vm:~$
[/code]
[code] IMPORTANT NOTES:- Congratulations! Your certificate and chain have been saved at:/etc/letsencrypt/live/auca.com/fullchain.pemYour key file has been saved at:/etc/letsencrypt/live/auca.com/privkey.pemYour cert will expire on 2020-02-17. To obtain a new or tweakedversion of this certificate in the future, simply run certbot-autoagain. To non-interactively renew *all* of your certificates, run”certbot-auto renew”- Your account credentials have been saved in your Certbotconfiguration directory at /etc/letsencrypt. You should make asecure backup of this folder now. This configuration directory willalso contain certificates and private keys obtained by Certbot somaking 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/donateDonating to EFF:https://eff.org/donate-lehi@aucacom-vm:~$ ./certbot-auto renew –dry-run
[/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] hi@aucacom-vm:~$ ./certbot-auto renew –dry-run
Requesting to rerun ./certbot-auto with root privileges…
./certbot-auto has insecure permissions!
To learn how to fix them, visit https://community.letsencrypt.org/t/certbot-auto-deployment-best-practices/91979/
Saving debug log to /var/log/letsencrypt/letsencrypt.log- – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Processing /etc/letsencrypt/renewal/auca.com.conf
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for auca.com
http-01 challenge for www.auca.com
Using the webroot path /opt/bitnami/apps/wordpress/htdocs for all unmatched domains.
Waiting for verification…
Cleaning up challenges- – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
new certificate deployed without reload, fullchain is
/etc/letsencrypt/live/auca.com/fullchain.pem
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
** DRY RUN: simulating ‘certbot renew’ close to cert expiry
**(The test certificates below have not been saved.)Congratulations, all renewals succeeded. The following certs have been renewed:/etc/letsencrypt/live/auca.com/fullchain.pem (success)
** DRY RUN: simulating ‘certbot renew’ close to cert expiry
**(The test certificates above have not been saved.)
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – -IMPORTANT NOTES:- Your account credentials have been saved in your Certbotconfiguration directory at /etc/letsencrypt. You should make asecure backup of this folder now. This configuration directory willalso contain certificates and private keys obtained by Certbot somaking regular backups of this folder is ideal.
hi@aucacom-vm:~$ sudo mv certbot-auto /etc/letsencrypt/
[/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] IMPORTANT NOTES:- Your account credentials have been saved in your Certbotconfiguration directory at /etc/letsencrypt. You should make asecure backup of this folder now. This configuration directory willalso contain certificates and private keys obtained by Certbot somaking regular backups of this folder is ideal.
hi@aucacom-vm:~$ sudo mv certbot-auto /etc/letsencrypt/
hi@aucacom-vm:~$ sudo crontab -e
[/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] IMPORTANT NOTES:- Your account credentials have been saved in your Certbotconfiguration directory at /etc/letsencrypt. You should make asecure backup of this folder now. This configuration directory willalso contain certificates and private keys obtained by Certbot somaking regular backups of this folder is ideal.
hi@aucacom-vm:~$ sudo mv certbot-auto /etc/letsencrypt/
hi@aucacom-vm:~$ sudo crontab -eno crontab for root – using an empty oneSelect an editor.To change later, run ‘select-editor’.1. /bin/nano<---- easiest2. /usr/bin/vim.basic3. /usr/bin/vim.tinyChoose 1-3 [1]: 1 [/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] # Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use ‘*’ in these fields (for ‘any’).#
# Notice that tasks will be started based on the cron’s system
# daemon’s notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m hdom mon dowcommand
45 2 * * 6 cd /etc/letsencrypt/ && ./certbot-auto renew && /opt/bitnami/ctlscript.sh restart
[/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] Select an editor.To change later, run ‘select-editor’.1. /bin/nano<---- easiest2. /usr/bin/vim.basic3. /usr/bin/vim.tinyChoose 1-3 [1]: 1 crontab: installing new crontab hi@aucacom-vm:~$ sudo -i [/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] Select an editor.To change later, run ‘select-editor’.1. /bin/nano<---- easiest2. /usr/bin/vim.basic3. /usr/bin/vim.tinyChoose 1-3 [1]: 1 crontab: installing new crontab hi@aucacom-vm:~$ sudo -i [/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] Select an editor.To change later, run ‘select-editor’.1. /bin/nano<---- easiest2. /usr/bin/vim.basic3. /usr/bin/vim.tinyChoose 1-3 [1]: 1 crontab: installing new crontab hi@aucacom-vm:~$ sudo -i root@aucacom-vm:~# cd /etc/letsencrypt/ && ./certbot-auto renew --dry-run && /opt/bitnami/ctlscript.sh restart [/code]

输入下面代码框最后一行,然后按 Enter 键。

[code] hi@aucacom-vm:~$ sudo -i
root@aucacom-vm:~# cd /etc/letsencrypt/ && ./certbot-auto renew –dry-run && /opt/bitnami/ctlscript.sh restart
./certbot-auto has insecure permissions!
To learn how to fix them, visit https://community.letsencrypt.org/t/certbot-auto-deployment-best-practices/91979/
Saving debug log to /var/log/letsencrypt/letsencrypt.log- – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Processing /etc/letsencrypt/renewal/auca.com.conf
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for auca.com
http-01 challenge for www.auca.com
Using the webroot path /opt/bitnami/apps/wordpress/htdocs for all unmatched domains.
Waiting for verification…
Cleaning up challenges- – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
new certificate deployed without reload, fullchain is
/etc/letsencrypt/live/auca.com/fullchain.pem
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – — – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
** DRY RUN: simulating ‘certbot renew’ close to cert expiry
**(The test certificates below have not been saved.)Congratulations, all renewals succeeded. The following certs have been renewed:/etc/letsencrypt/live/auca.com/fullchain.pem (success)
** DRY RUN: simulating ‘certbot renew’ close to cert expiry
**(The test certificates above have not been saved.)
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Syntax OK
/opt/bitnami/apache2/scripts/ctl.sh : httpd stopped
/opt/bitnami/php/scripts/ctl.sh : php-fpm stopped
/opt/bitnami/mysql/scripts/ctl.sh : mysql stopped
/opt/bitnami/mysql/scripts/ctl.sh : mysqlstarted at port 3306
/opt/bitnami/php/scripts/ctl.sh : php-fpm started
Syntax OK
/opt/bitnami/apache2/scripts/ctl.sh : httpd started at port 80
root@aucacom-vm:/etc/letsencrypt#
[/code]

把所有的地址捆绑到主域名上(固定主域名)

这里我们可以继续从刚刚的SSH中操作,也可以重新打开SSH操作

[code] Connected, host fingerprint: ssh-rsa 0 40:88:3E:E9:35:EB:3A:47:0E:21:87:BC:71:04:B0:84:6C:C2:35:47:C6:E9:D6:08:50:6A:7D:82:2B:B7:A7:F7
Linux aucacom-vm 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.___ _ __| _ |_) |_ _ ___ _ _ __ (_)| _|_| ‘ / _` | ‘| ||___/_|__|_|_|__,_|_|_|_|_|*** Welcome to the Bitnami WordPress 5.3-0 ****** Documentation:https://docs.bitnami.com/google/apps/wordpress/ ******https://docs.bitnami.com/google/ ****** Bitnami Forums: https://community.bitnami.com/ ***#######################################################
###For frequently used commands, please run:###
###sudo /opt/bitnami/bnhelper-tool###
#######################################################hi@aucacom-vm:~$ sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami.conf
[/code] [code] # Default Virtual Host configuration.NameVirtualHost *:80NameVirtualHost *:443DocumentRoot “/opt/bitnami/apache2/htdocs”Options Indexes FollowSymLinksAllowOverride AllOrder allow,denyAllow from all= 2.3 >Require all granted# Error DocumentsErrorDocument 503 /503.html# Bitnami applications installed with a prefix URL (default)Include “/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf”
[/code] [code] # Default Virtual Host configuration.NameVirtualHost *:80NameVirtualHost *:443DocumentRoot “/opt/bitnami/apache2/htdocs”ServerName www.auca.com
ServerAlias auca.com
Redirect permanent / https://auca.com/Options Indexes FollowSymLinksAllowOverride AllOrder allow,denyAllow from all= 2.3 >Require all granted
[/code]

1. 插入代码到此位置,注意把域名更改成自己的域名,此代码主域名为不带www,如果需要www做为主域名,只需要把 Redirect permanent / https://auca.com/ 更改为 Redirect permanent / https://auca.com/ 即可。

[code] Listen 443
SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite “EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+a$
SSLPassPhraseDialogbuiltin
SSLSessionCache “shmcb:/opt/bitnami/apache2/logs/ssl_scache(512000)”
SSLSessionCacheTimeout300DocumentRoot “/opt/bitnami/apache2/htdocs”SSLEngine on
SSLCertificateFile “/opt/bitnami/apache2/conf/server.crt”
SSLCertificateKeyFile “/opt/bitnami/apache2/conf/server.key”
[/code] 继续光标下移,找到此代码段
[code] Listen 443
SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite “EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+a$
SSLPassPhraseDialogbuiltin
SSLSessionCache “shmcb:/opt/bitnami/apache2/logs/ssl_scache(512000)”
SSLSessionCacheTimeout300DocumentRoot “/opt/bitnami/apache2/htdocs”SSLEngine on
#SSLCertificateFile “/opt/bitnami/apache2/conf/server.crt”
#SSLCertificateKeyFile “/opt/bitnami/apache2/conf/server.key”
SSLCertificateFile “/etc/letsencrypt/live/auca.com/cert.pem”
SSLCertificateKeyFile “/etc/letsencrypt/live/auca.com/privkey.pem”
SSLCertificateChainFile “/etc/letsencrypt/live/auca.com/chain.pem”Options Indexes FollowSymLinksAllowOverride AllOrder allow,deny
[/code] 并且在前面加“#”,然后在紧随下一行输入代码 (然后按“回车键”),再按 Ctrl+X 退出当前界面,按 Y 保存,再按 Enter 回到主界面。

[code] Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.___ _ __| _ |_) |_ _ ___ _ _ __ (_)| _|_| ‘ / _` | ‘| ||___/_|__|_|_|__,_|_|_|_|_|*** Welcome to the Bitnami WordPress 5.3-0 ****** Documentation:https://docs.bitnami.com/google/apps/wordpress/ ******https://docs.bitnami.com/google/ ****** Bitnami Forums: https://community.bitnami.com/ ***#######################################################
###For frequently used commands, please run:###
###sudo /opt/bitnami/bnhelper-tool###
#######################################################hi@aucacom-vm:~$ sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami.conf
hi@aucacom-vm:~$ sudo nano /opt/bitnami/apps/wordpress/htdocs/wp-config.php
[/code] [code] define(‘FS_METHOD’, ‘direct’);/*** The WP_SITEURL and WP_HOME options are configured to access from any hostname or IP address.* If you want to access only from an specific domain, you can modify them. For example:*define(‘WP_HOME’,’http://example.com’);*define(‘WP_SITEURL’,’http://example.com’);*
*/if ( defined( ‘WP_CLI’ ) ) {$_SERVER[‘HTTP_HOST’] = ‘localhost’;
}define(‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/’);
define(‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/’);
[/code] [code] define(‘FS_METHOD’, ‘direct’);/*** The WP_SITEURL and WP_HOME options are configured to access from any hostname or IP address.* If you want to access only from an specific domain, you can modify them. For example:*define(‘WP_HOME’,’http://example.com’);*define(‘WP_SITEURL’,’http://example.com’);*
*/if ( defined( ‘WP_CLI’ ) ) {$_SERVER[‘HTTP_HOST’] = ‘localhost’;
}define(‘WP_HOME’,’https://auca.com’);
define(‘WP_SITEURL’,’https://auca.com’);/** Absolute path to the WordPress directory. */
if ( ! defined( ‘ABSPATH’ ) ) {define( ‘ABSPATH’, dirname( __FILE__ ) . ‘/’ );
[/code] [code] *** Welcome to the Bitnami WordPress 5.3-0 ****** Documentation:https://docs.bitnami.com/google/apps/wordpress/ ******https://docs.bitnami.com/google/ ****** Bitnami Forums: https://community.bitnami.com/ ***#######################################################
###For frequently used commands, please run:###
###sudo /opt/bitnami/bnhelper-tool###
#######################################################hi@aucacom-vm:~$ sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami.conf
hi@aucacom-vm:~$ sudo nano /opt/bitnami/apps/wordpress/htdocs/wp-config.php
hi@aucacom-vm:~$ sudo /opt/bitnami/ctlscript.sh restart apache
[/code] [code] hi@aucacom-vm:~$ sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami.conf
hi@aucacom-vm:~$ sudo nano /opt/bitnami/apps/wordpress/htdocs/wp-config.php
hi@aucacom-vm:~$ sudo /opt/bitnami/ctlscript.sh restart apache
Unmonitored apache
Syntax OK
/opt/bitnami/apache2/scripts/ctl.sh : httpd stopped
Syntax OK
/opt/bitnami/apache2/scripts/ctl.sh : httpd started at port 80
Monitored apache
hi@aucacom-vm:~$
[/code]

发表评论

电子邮件地址不会被公开。 必填项已用*标注

Do NOT follow this link or you will be banned from the site!