0x00 Foreword
Park wrote in a blog a year's blog, and also want a change of new flavors, wordpress themes and many personalized settings suits my preferences, so fiddle with it for a day can be considered to set the stage.
Wordpress built directly on the server you need to configure mysql, apache, php, these not too much trouble, after downloading the theme or plug-ins need to configure the ftp, php upload modify the size of many, if someday for a vps, there again configuration, is cumbersome
This blog will organize ideas docker built using wordpress, where the encounter many of the pit, I hope I can help to solve the problem for you
0x01 set up before the server configuration
Tencent Ali clouds or cloud servers to buy, the students have student price, January 10 bucks. Domain name purchase an additional, recently Tencent cloud engage in activities of certain domain name suffix few dollars a year, the domain name to the record.
After the cloud console manufacturers can bind to the domain name server, DNS can make to the service (in the sense of talking nonsense)
Server once the purchase is recommended open ports 22, 80, even using ssh past (I used here xshell)
If Tencent cloud of words (Ali cloud seems to be directly Gordon root, the following steps can be ignored), open the root user Reference: http: //bbs.qcloud.com/thread-11554-1-1.html
In short, the following steps
To root password
passwd root sudo // will be asked to enter a password 2 times
Ssh then modify the configuration file, the root can be ssh login
sudo vim /etc/ssh/sshd_config
The following figure PermitRootLogin value is set to yes, then ESC: wq to save and exit
Finally, restart the ssh service, this time ssh connection will be disconnected and re-connected with the root will be able to
service ssh restart
0x02 install docker
apt-get install docker docker-compose
After the installation is complete, you can enter docker command to check whether the installed
Image taken at 0x03
Here you must next two mirrors (as rare written Dockerfile, install additional database a)
2 provides a mirror for wordpress official mirror, a mirror is mysql. A docker generated image corresponds to a virtual machine container, where we should do legendary station libraries isolated
Take the mirror
docker pull wordpress docker pull mysql:5.6
After a long wait can not use the following command to see if the installed
docker image ls
Generating vessel 0x04
First, open container mysql database password is set to 123456
docker run --name w-mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6
Then enter the container to create a wordpress mysql database
docker exec -it w-mysql mysql -uroot -p
Of course, here to enter your password just set about 123456, and then create a database
create databases wordpress;
Once you've created can show it, then quit to exit the container
Then prepare before starting a wordpress container file uploads.ini
vim uploads.ini Enter the following # file_uploads = On memory_limit = 64M upload_max_filesize = 64M post_max_size = 64M max_execution_time = 600
Then restart wordpress, and put our uploads.ini loaded into the container, thus making the container itself wordpress configuration upload size limit from 2M to become a 64M
docker run --name w-wordpress --link w-mysql:db -v /root/docker/wordpress/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini -p 80:80 -d wordpress:latest
Note here
At this point you can access the page pleasant, and directly enter the public domain name or your server's ip to the browser
End of the first installation 0x05web
Direct access will let you choose the language, because here I have installed, here's a map reference reference blog, indicates how the database where the fill
After the background is set administrator account password, set here do not like too simple. It can work normally after
0x06 build their own pit when it came
I tried to ride directly on the server, the installation environment not much problem, after installing wordpress database, also changed the value of php upload_max_filesize, but it needs to meet ftp connections when downloading the theme, a wave of Internet search is changed the code is to create a folder, but also the authority to change something. The problem is that they take a ftp trouble (in fact, I'm lazy)
So I finally chose docker, but there are also docker upload size restrictions, more pit father is no php.ini file, I go change? And finally found two php-xxxxx.ini files in the directory /etc/php/7.0/cli/, changed after the restart apache2, exit the direct result of the container, the configuration is not saved successfully, Baidu for a long time can not be resolved. Finally, Google looked at the foreigner's article was finally resolved
The solution is to use the above-mentioned set uploads.ini
0xff Conclusion:
Crunching a few hours, though they do not learn what new knowledge, but encountered various problems, still quite receipt.
This means setting up the blog, mainly after writing articles on his blog, and blog Park will rarely updated ...
Finally, on a few new blog look like it
Home
article
Welcome to look
Reference article
https://www.jianshu.com/p/8c329800cbf2