Use docker mediawiki, wiki pages to build

 

I just want everyone can access a wiki for sharing among members and maintain some documents. Find mediawiki docker, where the record about how I take it.

 

First, if you are in a local area network, there is public access to the server, it can be set up directly on top of it, such as our lab server, as long as the campus network, can access. But this blog is implemented on my server cloud Ali, Ali cloud my rent is a lightweight application server type, because the cheap.

 

mediawiki need to have some knowledge and knowledge of php mysql database, for which I also spent a day learning these two things. I was a rookie learning tutorial website. If you just want simple, in fact, it is not difficult to learn.

 

1, ssh login server (server is ubuntu16.04)

slightly

 

2, for the server installation docker environment

A lot of online tutorials, I installed the docker-ce, using this tutorial: https://blog.csdn.net/bingzhongdehuoyan/article/details/79411479

 

3, mysql download and mirroring mediawiki

What to look for on these two mirrors docker hub

MySQL:https://hub.docker.com/_/mysql

media:https://hub.docker.com/_/mediawiki

 

Then select the appropriate version, I use these two:

 

 

So according to the command pull down:

docker pull mysql:5.7
docker pull mediawiki:stable

 

 

4, install mysql container (mysql involves a little knowledge, a good idea to learn about)

docker run --name mysql_wiki -p 3307:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7

 

Explain the above command:

MYSQL_ROOT_PASSWORD = 123456 represents a generation of container in the root account password is 123456

-p port mapping representation, mysql default port is 3306, then you have to connect remotely mysql internal docker, so it is necessary to map the interior of the docker port 3306 to a server port, I just mapped to the server's 3307 port.

mysql: 5.7 means your mirror, mirror id can also be written.

 

Then enter your mysql containers, configure a remote connection

docker exec -it mysql_wiki bash

 

Note that this does not enter into the attach command, I attach, stuck on the end, I do not know why, you know, you can leave a message.

 

After entering the container, log root

mysql -u root -p

 

 

Enter the mysql database

use mysql

 

 

Create a root account can connect remotely

grant all privileges on *.*  to 'root'@'%';

 

 

Refresh permission

flush privileges;

 

 

Check to see if the entry into force

SELECT User,Host FROM mysql.user;

 

The above two can be seen the root, is a localhost, for local connection is a%, it is a remote connection.

 

Then your firewall Ali cloud server port 3307 open

That is, add a custom port 3307

 

Finally, on your own computer at your remote connections on mysql Ali cloud (their first computer installed mysql environment)

mysql -h xxx.xxx.xxx.xxx -P 3307 -u root -p

 

xxx.xxx.xxx.xxx represents the ip address of your server

-P indicates the port mapping

 

The connection is successful, mysql environment has been doing a good job description.

 

 

5, the installation vessel mediawiki

docker run --name mywiki --link mysql_wiki:mysql -p 1030:80 -d mediawiki:stable

 

--link mysql_wiki: mysql represent mywiki this container and mysql_wiki this container will communicate, and to mysql as another name.

Of course, do not forget to open your port, I am using a 1030 port.

 

6, using a browser to log

Enter directly into your browser

xxx.xxx.xxx.xxx:1030

 

 

 

 

(to be continued...)

 

Guess you like

Origin www.cnblogs.com/yongy1030/p/11872063.html