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/03 Report--
First, quickly install Wordpress on linux by using Dokcer
1. Install Docker and docker-compose
Install using the official installation script
Curl-sSL https://get.docker.com/ | sh
Version query
Docker-v
Start the Docker engine
Systemctl enable docker
Systemctl start docker
two。 Install Docker-compose
1) install the epel extension source first:
Sudo yum-y install epel-release
2) then install python-pip
Sudo yum-y install python-pip
Pip install docker-compose
3) version query
Docker-compose-v
3. Create a stack.yml file and save it
Vim stack.yml
Write the following and save:
Version: '3.1'services: wordpress: p_w_picpath: wordpress ports:-8080 wordpress 80 environment: WORDPRESS_DB_PASSWORD: example mysql: p_w_picpath: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: example
Where:
Port 80 of the-8080 wordpress container is mapped to port 8080 of the physical server. You can change 8080 to 80.
WORDPRESS_DB_PASSWORD: access password for wordpress database in example # mysql, which needs to be modified in production environment. You can
MYSQL_ROOT_PASSWORD: root access password for example # mysql database, which needs to be modified in production environment
4. Run the docker-compose download image and run the container.
Docker-compose-f stack.yml up
OK, the website is set up, and you can log in to manage it: http://192.168.2.18/wp-admin/( installs CentOS server IP:192.168.2.18)
Website official visit page: http://192.168.2.18/
II. Website initialization
1. Login access
2. Some general settings
There are also date, time format and language settings below. Finally, don't forget to "save changes".
Other settings under the settings class can be set according to the needs of your own website.
3. Add and apply themes
Find the topic you need and enable it
If the theme is enabled, but the home page of the Demo site does not come out, you need to set the home page in the theme "Custom" static home page to display: a static page, and select a page as the home page
4. Create the top and bottom menus
First add a few pages to do the navigation menu, and then change it when the content is rich.
4.1 create a custom menu, customize a URL jump menu or home page positioning menu
Need to mark core in page editing
Put the defined menu in the corresponding position on the page, and some topics may only be Primary Menu.
5. Install the necessary plug-ins (contact form, cache, visual page editing, broadcast production plug-in). If you are prompted that the file cannot be uploaded when uploading the plug-in, refer to the last solution)
The plug-in WP Acceleration for China can be searched and installed in the system, which can speed up the editing and access of the entire website.
6. Create a new page to build the content of the website
6.1 use Visual Composer to edit the page
Various elements that can be added
You can customize the number of columns as needed.
7. Adjust the theme setting according to the style of the whole website (using different themes, the theme settings are not exactly the same. Generally, there are special settings in the appearance, or in the customization of the theme)
The above image can set the navigation bar, footer, color, background, font and other parameters of the website theme, and the following image can set the parameters of the theme in the custom.
8. Use Slider Revolution to make the carousel map.
8.1 New Slider
8.2 set content source, title, type, layout, etc.
Automatically enter the editing slide after saving
If you do a page, you have to save it separately, otherwise it will be gone, and finally, you have to insert this rotation picture into the page.
Almost, after the operation of this sequence, a website has been built, it can have its own management background, which is much more convenient than its own development, and it has many themes and plug-ins, such as corporate websites, e-commerce websites, and so on.
Backup features:
Spare parts and migration of wordpress website
The main folders are as follows, and you can directly back up these three folders using third-party tools.
Theme file location: site root\ wp-content\ themes\ your theme folder
Plug-in file location: website root directory\ wp-content\ plugins\
Attachment location: website root directory\ wp-content\ uploads\
Second, you can also use the wordpress plug-in to do this:
1. Export all the content of the website (excluding website pictures, audio and video multimedia files) for backup or migration of the server. Of course, the MYSQL database needs to be backed up separately.
2. Export multimedia files
Install the plug-in "File Manager" and export the entire wordpress/wp-content/uploads folder in its panel
The same method is used for import, but if you migrate to a new environment, you need to use the "Add From Server" plug-in to import these original images into the library and put them under the "jurisdiction" of WordPress.
(if you can't find it, you can download https://wordpress.org/plugins/add-from-server/ directly from the official website, and then install the plug-in manually in the plug-in.)
Specify the images in the imported uploads file in the following figure and import them into the library.
Restore all imported files
After installation, you can import the backup directly.
3. Solve the problem that the maximum size of the local upload plug-in cannot exceed 2m (the main reason for this problem is that the maximum uploaded file is limited to 2m by default in php.ini files, but there is no such problem by default, so the solution is to set the maximum limit for writing new info.php files by performing "find php.ini storage location" and "new php.ini file" in the browser.
1. First, create an info.php file under the root directory of the website in the Docker container, as follows:
Docker-compose exec wordpress bash (enter the docker container to execute the command)
Cd / var/www/html
Touch info.php
Echo "" > info.php
Open a browser to run this file and find out where the php.ini file is stored
2. The maximum limit for creating a php.ini file and writing an uploaded file is 64m.
Cd / usr/local/etc/php
Touch php.ini
Echo "upload_max_filesize = 64m" > php.ini (modify the maximum uploaded file to 64m)
Echo "post_max_size = 64m" > > php.ini (the maximum size of the modified article is 64m)
Echo "max_execution_time = 300" > > php.ini (the maximum execution time of modification is 300, that is, page waiting time)
Exit (exit container)
Docker-compose restart (restart Container)
Finally, you can upload plug-ins of more than 2m and less than 64m.
4. About the extremely slow opening of wordpress users' websites, or the fact that there is no problem with the rowing pictures for a long time (the actual measurement is very effective)
1. Search for WP Acceleration for China plug-ins by installing plug-ins in wordpress
2. Install in the "wordpress plug-in" installation plug-in, and finally enable the plug-in.
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.