LinMinquan's Blog

Experience technology to change life

在虚拟机中安装 discourse

环境:Mac, VirtualBox, Ubuntu 16.4 Desktop AMD64,

安装 VirtualBox,在虚拟机中安装 Ubuntu

先装 git

Sudo apt-get update

Apt-get install git-core

修改 host ,增加一条域名

sudo vi /etc/hosts
127.0.0.1 localhost discourseraw.pl
127.0.1.1  xxx-VirtualBox

主要按官方的教程安装

https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md

wget -qO- https://get.docker.com/ | sh

如果不是以 root 用户在操作时,会提示要敲个命令把这个用户加入到 某group 里

If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:

sudo usermod -aG docker leo

 

sudo -s
mkdir /var/discourse
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse

下面命令开始设置 discourse

./discourse-setup

要设置下面这几个问题

Hostname for your Discourse? [discourse.example.com]: 
Email address for admin account(s)? [me@example.com,you@example.com]: 
SMTP server address? [smtp.example.com]: 
SMTP port? [587]: 
SMTP user name? [user@example.com]: 
SMTP password? [pa$$word]: 
Let's Encrypt account email? (ENTER to skip) [me@example.com]:

第一个就填刚才 hosts 里加的域名 discourseraw.pl

最后一个问题我是直接回车 skip

然后它就开始 rebuild , 要好几分钟,build 完之后,就可以在浏览器中通过 discourseraw.pl 访问了

 

 

 

 


Share