简体   繁体   English

在 AWS EC2 实例上配置 wiki.js(开源)

[英]Configure wiki.js(open source) on AWS EC2 instance

I've deployed wiki.js on AWS EC2 instance using docker. With installation Command as follows:我已经使用 docker 在 AWS EC2 实例上部署了 wiki.js。安装命令如下:

docker run -d -p 8080:3000 --name wiki --restart unless-stopped -e "DB_TYPE=mysql" -e "DB_HOST=172.0.0.1" -e "DB_PORT=3306" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" requarks/wiki:2

I've referred wiki.js installation .我已经提到了 wiki.js 安装 DB container and wiki containers are running in the same instance, When I check the above-created container logs, it shows the below output. DB 容器和 wiki 容器在同一个实例中运行,当我检查上面创建的容器日志时,它显示以下 output。

Loading configuration from /wiki/config.yml... OK
2021-07-21T16:13:45.924Z [MASTER] info: =======================================
2021-07-21T16:13:45.926Z [MASTER] info: = Wiki.js 2.5.201 =====================
2021-07-21T16:13:45.926Z [MASTER] info: =======================================
2021-07-21T16:13:45.927Z [MASTER] info: Initializing...
2021-07-21T16:13:47.149Z [MASTER] info: Using database driver mysql2 for mysql [ OK ]
2021-07-21T16:13:47.153Z [MASTER] info: Connecting to database...
2021-07-21T16:13:47.189Z [MASTER] info: Database Connection Successful [ OK ]
2021-07-21T16:13:47.237Z [MASTER] warn: DB Configuration is empty or incomplete. Switching to Setup mode...
2021-07-21T16:13:47.238Z [MASTER] info: Starting setup wizard...
2021-07-21T16:13:47.477Z [MASTER] info: Starting HTTP server on port 3000...
2021-07-21T16:13:47.478Z [MASTER] info: HTTP Server on port: [ 3000 ]
2021-07-21T16:13:47.482Z [MASTER] info: HTTP Server: [ RUNNING ]
2021-07-21T16:13:47.482Z [MASTER] info: 🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻🔻
2021-07-21T16:13:47.483Z [MASTER] info: 
2021-07-21T16:13:47.483Z [MASTER] info: Browse to http://YOUR-SERVER-IP:3000/ to complete setup!
2021-07-21T16:13:47.483Z [MASTER] info: 
2021-07-21T16:13:47.483Z [MASTER] info: 🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺

But when I run container IP + port into the browser it shows This site can't be reached I've already opened ports 80, 443, and 3000 inside the security group attached with this instance.但是当我在浏览器中运行容器 IP + 端口时,它显示This site can't be reached我已经在与此实例关联的安全组中打开了端口 80、443 和 3000。 Unable to figure out the reason, why it's not loading wiki.js on the running URL.无法找出原因,为什么它没有在运行时加载 wiki.js URL。

It works deliberately in a local docker container, but not in a remote container.它故意在本地 docker 容器中工作,而不是在远程容器中。 Can anyone please help me with this, any help would be appreciated.Thanks in advance.谁能帮我解决这个问题,我们将不胜感激。提前致谢。

Same log output but with Postgre in the version I got.相同的日志 output 但我得到的版本是 Postgre。 I managed to get it working by just running docker start wiki , following the installation process in Wiki.js website.按照 Wiki.js 网站上的安装过程,我设法通过运行docker start wiki来让它工作。

Have you set the inbound rules of the instance to allow you access over HTTP (not HTTPS)?您是否设置了实例的入站规则以允许您通过 HTTP(不是 HTTPS)访问? If yes, you access the instance by just browsing its IP address (No port either as suggested).如果是,您只需浏览其 IP 地址即可访问该实例(也没有建议的端口)。 This is consistent with the local container I set up too.这和我设置的本地容器也是一致的。

Make sure the instance has an inbound rule/security group that supports HTTP requests (IPv4 version, TCP protocol, Port range of 80 and the appropriate Source depending on your case).确保实例具有支持 HTTP 请求的入站规则/安全组(IPv4 版本、TCP 协议、端口范围 80 和适当的源,具体取决于您的情况)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM