In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
WordPress is a very famous blog platform written by PHP, which has formed a huge website platform system so far. There are huge plug-ins and themes on WP that can help us quickly build a blog or even a website.
WordPress can be easily installed on Windows because WordPress's one-click installation package is integrated on IIS. Installing WordPress on Linux is more complicated, and we need to configure the PHP environment, Apache or Nginx server, MySQL database, and various permissions and access issues. So the best way to install WordPress on Linux is to use Docker.
In the first article in the series, "Docker practice", we have search and pull the official wordpress image, and then we will search an official mysql to combine the two to build a usable wordpress site.
First, take care of mysql.
1.search
$docker search mysql NAME DESCRIPTION STARS OFFICIAL AUTOMATED mysql MySQL is a widely used, open-source relati... 456 [OK]
2.pull
$docker pull mysql
Secondly, consider the combination of the two.
$docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE wordpress latest ecc04d6d638c 2 weeks ago 470 MB mysql latest aca96d9e6b5c 2 weeks ago 282.7 MB
The wordpress startup command goes like this:
The copy code is as follows:
$sudo docker run-- name some-wordpress-- link some-mysql:mysql-d wordpress
Some of the environment parameters that can be specified when starting the WordPress container include
-e WORDPRESS_DB_USER=... The default is "root"
-e WORDPRESS_DB_PASSWORD=... The default is the value of the environment variable MYSQL_ROOT_PASSWORD that connects to the mysql container
-e WORDPRESS_DB_NAME=... The default is "wordpress"
-e WORDPRESS_AUTH_KEY=...,-e WORDPRESS_SECURE_AUTH_KEY=...,-e WORDPRESS_LOGGED_IN_KEY=...,-e WORDPRESS_NONCE_KEY=...,-e WORDPRESS_AUTH_SALT=...,-e WORDPRESS_SECURE_AUTH_SALT=...,-e WORDPRESS_LOGGED_IN_SALT=...,-e WORDPRESS_NONCE_SALT=... The default is random sha1 string
For the startup command for wordpress, we need to target:
1. You can give wordpress a name. It's easy.
The 2.--link parameter, which requires us to start mysql first and then link its name to it
3. Port-p parameter, the default is port 80, but it is occupied by me, here we map to 8080
The command of the launched mysql:
The copy code is as follows:
$docker run-- name mysql_wordpress-e MYSQL_ROOT_PASSWORD=wordpress-d mysql
The password of mysql is exposed in this way.
The startup command for the corresponding mysql,wordpress is as follows:
The copy code is as follows:
$docker run-- name docker_wordpress-- link mysql_wordpress:mysql-p 8080 wordpress 80-d wordpress
Then you can type http://localhost:8080 into the browser to configure wordpress.
Enjoy!
Third, use fig to configure
Practice has proved that using fig configuration is the best way. Based on the above, we only need to create a new directory such as wordpress-docker under our docker directory, and then create the fig configuration file fig.yml as follows:
Wordpress: image: "wordpress:latest" ports:-"8080 links:-db:mysql db: image:" mysql:latest "expose: -" 3306 "environment:-MYSQL_ROOT_PASSWORD=wordpress
You only need to execute fig up-d in this directory for each startup!
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.