极
极核实验室
Answer Installation

Answer Installation

AI summary
文章介绍了Answer问答社区平台的部署教程,主要内容包括云服务器选购、域名购置、宝塔面板安装、Docker部署以及反向代理设置等步骤。文章详细阐述了如何通过Docker Compose方式部署Answer,并提供了从宝塔面板配置反向代理、设置语言和数据库连接等具体操作方法。此外,还提及了Answer的登录方式、网站信息修改以及升级和常见问题解答。整体上,文章以实用指南的形式,指导读者完成Answer的安装和基本配置。

Repost license

Request authorization before reposting and retain the authorization code, original URL, and go/affiliate links.

Original URL:https://www.geekcorelab.com/post/answer-installation

The commercial link is an authorized go short link that must stay on the reposted page. It records the source before sending readers to the original article.

本文由原作者(https://forum.rainyun.com/u/LIFL)投稿

原地址:Answer Installation Tutorial | 星空'Blog (chacks.top)

Originality Statement

Originality Statement

This article is simultaneously published on 风屿岛, 雨云论坛, and 星空'Blog

Please indicate the original address when reposting

Introduction

What is Answer?

Answer helps you build a Q&A community among users or teams. You can share knowledge here and help users solve problems.

Answer Official

Answer Official Documentation

How to Deploy Answer?

Answer has three different deployment methods: Docker Compose deployment, Docker deployment, and Binary deployment. In this article, we will only choose one of them for deployment: Docker Compose deployment

Set Sail -- Main Text Begins

Purchasing Products

Cloud Server Purchase

To create a website of your own, you need to purchase a server of your own. Virtual hosting probably won't work, because Answer needs to be deployed using Docker containers, and ordinary virtual hosting probably won't provide such a service.

How to Purchase a Cloud Server?

Cloud servers can be purchased through 雨云. Click the hyperlink above to open the official 雨云 website. If you register through the discount channel above and bind WeChat, you can get a 50% off coupon.

Registration Process

If you have already registered, you can skip this step

After entering the official 雨云 website, click Login/Register
雨云 website screenshot
Next, click Register
Register
Next, two situations may occur. If you entered the 雨云 official website by clicking the link above, the following situation will appear:
Snipaste_2024-05-07_11-51-00.png
In this case, you only need to fill in the username, password, and repeat password. However, if you entered from Bing or another search engine, the following situation will appear
Snipaste_2024-05-07_11-53-57.png
In the discount code field, you can fill in chacks, then fill in the username, password, and repeat password, and finally click Register Now.

Backend Management

After entering the backend, look at the row at the top
1715054304295.png
Click Cloud Products, then click Buy Cloud Server
1715056063350.png
Select a configuration
1715056162659.png

Difficulty Choosing —— How to Choose a Cloud Server

If you don't know how to choose a cloud server, you can refer to the official article. Enter the server page
1715056439776.png
Select the server you purchased, click Manage to enter, and you can view the server information. If you don't understand it, you can refer to the official article

Purchasing a Domain Name

雨云 provides free second-level domains for your reference. Click this link to reach the domain purchase page

Search for the domain name you want to buy in the search box
1715056696047.png
Then click Search. When purchasing a domain name, a template is required: A domain template refers to the real-name information template that users need to provide when purchasing a domain name. According to the 'Measures for the Administration of Internet Domain Names', users need to provide real-name information before they can register a domain name. You can select an existing template here, or create a new template.
1715057009401.png
After purchasing a domain name, you can connect it to CloudFlare. For details, see my article

Start Deploying Answer

To simplify the deployment process, the server in this article is managed using 宝塔面板

What is 宝塔面板?

宝塔Linux面板 is server management software that improves O&M efficiency. It supports one-click LAMP/LNMP/cluster/monitoring/website/FTP/database/JAVA and more than 100 server management functions. It is developed and maintained by a professional team of 30 people. After more than 200 version iterations, it has comprehensive functions, is less error-prone, and is sufficiently secure. It has been recognized and installed by millions of users worldwide.

How to Deploy 宝塔面板?

雨云 has a Centos7.9 system with 宝塔 preinstalled. If there is no important information, you can reinstall the system. Centos installation script

yum install -y wget && wget -O install.sh https://download.bt.cn/install/install_6.0.sh && sh install.sh ed8484bec

Ubuntu/Deepin installation script

wget -O install.sh https://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh ed8484bec

Debian installation script

wget -O install.sh https://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh ed8484bec

Universal installation script

if [ -f /usr/bin/curl ];then curl -sSO https://download.bt.cn/install/install_panel.sh;else wget -O install_panel.sh https://download.bt.cn/install/install_panel.sh;fi;bash install_panel.sh ed8484bec

Domestic Loongson architecture installation script (do not use for other CPUs)

wget -O install_panel.sh https://download.bt.cn/install/0/loongarch64/loongarch64_install_panel.sh && bash install_panel.sh ed8484bec

Tip: Because 宝塔面板 has the highest compatibility with Centos7 systems

After successfully installing 宝塔面板, copy the account and password. After successfully logging in, install the LNMP environment.

Install Docker

If Docker is already installed, you can ignore this step

Open 宝塔面板

Look at the column on the left, and click Docker

1715058114096.png
Click Install

1715058233278.png
Wait until installation is complete

Connect to SSH

Because there are many SSH connection tools on the market, detailed connection configuration is not provided

After connecting, you need to choose one of the following two installation methods. The first: do not modify the configuration and use port 8090. The second: modify the configuration and customize the port

The First Method (Recommended)

Enter the command in SSH

curl -fsSL https://raw.githubusercontent.com/apache/incubator-answer/main/docker-compose.yaml | docker compose -p answer -f - up

The Second Method (Not Recommended)

Enter the command in SSH

curl -O -fsSL https://raw.githubusercontent.com/apache/incubator-answer/main/docker-compose.yaml

Download its configuration file

Install Vim

If you do not need Vim or use another editor, you can skip this step

Enter the command

yum -y install vim

Then enter:

vim docker-compose.yaml

You will see this

1715059014786.png
The 9080 in it is the host port mapped by Docker. You can change it to another port (using port 80 is not recommended, because this may cause a port conflict)

If you want to modify the code, press i to enter edit mode. After editing, press the Esc key on the keyboard, then enter :wq to save the changes.

Then run manually

docker compose -p answer up

Wait for the image pull to complete......

Configure Answer from 宝塔面板

After the image pull is complete, the container is started by default. You can use Ctrl + C to stop it

1715077726487.png
Open the Docker management page

As shown in the figure, restart the container
1715077804217.png
Remember the container's IP
1715079604626.png

Reverse Proxy

Create a Website

1715078155854.png
Open the website page

Add a website
1715080435510.png
Click Submit

Open the website settings and enter the reverse proxy settings
1715079776277.png
As shown in the figure, add a reverse proxy

1715079715345.png

Continue the Answer Installation Process

Language Configuration

1715079839943.png
Click English(100%) to expand it, then click Simplified Chinese. Click Next

Database Connection Information Configuration

Answer supports the following databases

1715079994286.png
This article uses SQLite for demonstration
1715080542166.png

Create the config.yaml file

1715080577876.png
Click Next

Basic Website Information Configuration

1715089497193.png
!

It looks very complicated, right? Don't worry, let's translate them one by one:

  • Site Information:Website information
  • Site URL:The access address of your website; this is filled in correctly by default
  • Contact email:The email address of the main contact for the website
  • Privte:Private
  • Login required:Login required
  • Only logged in users can access this community:Only logged-in users can access this community.
  • Admin Account:Administrator account
  • Name:Account name
  • Password:Account password
  • Email:Email address
  • You will need this email to log in:You need this email address to log in

If you don't understand it, you can use the browser's built-in translation:

For example:

1715089902616.png
After configuration, click Next

Complete Configuration

1715089983134.png
Click Done

Answer

Preview —— Display After Deployment

1715090233464.png
How to Log In to Answer?

You can click Login in the upper right corner to log in

1715090313628.png
Changed Your Mind —— Need to Modify Basic Website Information

You can visit:

https://<你的站点访问地址>:<端口(选填)>/admin

If your site does not have an SSL certificate:

http://<你的站点访问地址>:<端口(选填)>/admin

Upgrade Answer

The following content comes from the Answer official documentation

We recommend backing up the database and configuration file before upgrading. Normally, we guarantee that upgrades will not affect existing data. Backing up data means that even if the upgrade fails or you do not want to use an advanced version, you still have the option to roll back.

If you install Answer using Docker Compose, upgrading is very simple.

docker-compose pull
docker-compose down
docker-compose up -d

Tip

When upgrade exceptions or other unexpected situations occur, we provide a command to manually force upgrade Answer. answer upgrade -f v1.1.0. Executing this command will force an upgrade starting from the specified version, even if your current Answer is already the latest version. If you encounter upgrade exceptions, you can try executing this command, or re-pull the latest Docker image and then enter the container to execute this command.

FAQ

The following content comes from the Answer official documentation

FAQ

How do I access the installation page?

Please go to http://localhost:9080/install to access the installation page.

Why can't I receive registration emails?

You need to configure your own SMTP in Admin Backend -> Settings -> SMTP.

How do I switch the default language?

The site default language can be switched in . Admin Backend -> Settings -> Interface. Users can switch languages in their own . Settings -> Interface

Which database types are currently supported? Is migration supported?

We support MySQL, PostgreSQL, and SQLite3 databases. Unfortunately, we currently do not support data migration. Therefore, we recommend using SQLite3 only for trying it out, and choosing MySQL for actual use.

Comments

Discussion

Be kind and keep the discussion friendly.

Complete your profile details to improve the chance of approval.

Your email will not be shown publicly.

Loading...

Markdown supported.

Discussion

0 comments

Internal link graph

Loading internal links…

View linked articles