|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- ## Wordpress with docker-scripts
-
- #### 0. Diagram
-
- ![](img/wordpress-with-docker-scripts.png/wordpress-ds.png)
-
- <p/>
-
- #### 1. Install dependencies
-
- <details>
- <summary>1. Install docker</summary>
-
- ```
- curl -fsSL https://get.docker.com -o get-docker.sh
- sudo sh get-docker.sh
- ```
-
- Reference: https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script
-
- </details>
-
- <details>
- <summary>2. Install docker-scripts</summary>
-
- ```
- apt install m4
- git clone https://gitlab.com/docker-scripts/ds /opt/docker-scripts/ds
- cd /opt/docker-scripts/ds/
- make install
- ds -v
- ds -h
- ```
-
- Reference: https://gitlab.com/docker-scripts/ds#installation
-
- </details>
-
- <details>
- <summary>3. Install Webserver Proxy</summary>
-
- ```
- ds pull wsproxy
- ds init wsproxy @wsproxy
- cd /var/ds/wsproxy/
- vim settings.sh
- ds make
- ```
-
- Reference: https://gitlab.com/docker-scripts/wsproxy#installation
-
- </details>
-
- <details>
- <summary>4. Install MariaDB</summary>
-
- ```
- ds pull mariadb
- ds init mariadb @mariadb
- cd /var/ds/mariadb/
- vim settings.sh
- ds make
- ```
-
- Reference: https://gitlab.com/docker-scripts/mariadb#installation
-
- </details>
-
- <p/>
-
- #### 2. Install Wordpress sites
-
- <details>
- <summary>1. Install a wordpress container</summary>
-
- ```
- ds pull wordpress
- ds init wordpress @wordpress1
- cd /var/ds/wordpress1/
- vim settings.sh
- ds make
- ```
-
- Reference: https://gitlab.com/docker-scripts/wordpress#installation
-
- </details>
-
- <details>
- <summary>2. Install a site</summary>
-
- ```
- cd /var/ds/wordpress1/
- ds site
- ds site init site1.wp.fs.al
- ls
- ls site1.wp.fs.al
- ls apache2/sites-enabled/
- cat apache2/sites-enabled/site1.wp.fs.al.conf
- ls ../wsproxy/sites-enabled/
- cat ../wsproxy/sites-enabled/site1.wp.fs.al.conf
- ```
-
- ```
- vim site1.wp.fs.al/settings.sh
- ds site install site1.wp.fs.al
- ls site1.wp.fs.al/
- ```
-
- Try in browser https://site1.wp.fs.al and login as admin.
-
- Reference: https://gitlab.com/docker-scripts/wordpress#manage-a-website
-
- </details>
-
- <details>
- <summary>3. Install another site</summary>
-
- ```
- cd /var/ds/wordpress1/
- ds site init site2.wp.fs.al
- ls
- ls site2.wp.fs.al
- ls apache2/sites-enabled/
- ls ../wsproxy/sites-enabled/
-
- vim site2.wp.fs.al/settings.sh
- ds site install site2.wp.fs.al
- ls site2.wp.fs.al/
- ```
-
- Try in browser https://site2.wp.fs.al
-
- </details>
-
- <details>
- <summary>4. Install a second container</summary>
-
- ```
- ds init wordpress @wordpress2
- cd /var/ds/wordpress2/
- vim settings.sh
- ds make
- ```
-
- </details>
-
- <details>
- <summary>5. Install a site on the second container</summary>
-
- ```
- cd /var/ds/wordpress2/
- ds site init site3.wp.fs.al
- vim site3.wp.fs.al/settings.sh
- ds site install site3.wp.fs.al
- ls site3.wp.fs.al/
- ```
-
- Try in browser https://site3.wp.fs.al
-
- </details>
-
- <p/>
-
- #### 3. Manage a Wordpress site
-
- <details>
- <summary>1. Clone and delete a site</summary>
-
- ```
- cd /var/ds/wordpress2/
- ds site clone
- ds site clone site3.wp.fs.al site4.wp.fs.al
- ```
-
- Try in browser https://site4.wp.fs.al
-
- ```
- ds site del
- ds site del site4.wp.fs.al
- ```
-
- </details>
-
- <details>
- <summary>2. Backup and restore a site</summary>
-
- ```
- cd /var/ds/wordpress2/
- ds backup
- ds backup site3.wp.fs.al
- ls -lh backup/
- ```
-
- ```
- ds site del site3.wp.fs.al
- ```
-
- Try in browser https://site3.wp.fs.al
-
- ```
- ds site init site3.wp.fs.al
- ls site3.wp.fs.al/
- ds restore
- ds restore site3.wp.fs.al backup/wordpress-site3.wp.fs.al-2020-07-29.tgz
- ```
-
- Try in browser https://site3.wp.fs.al
-
- </details>
-
- <details>
- <summary>3. Using wp-cli</summary>
-
- ```
- cd /var/ds/wordpress2/
- ds wp
- ds wp site3.wp.fs.al
- ds wp site3.wp.fs.al option
- ds wp site3.wp.fs.al option list
- ds wp site3.wp.fs.al option get siteurl
- ds wp site3.wp.fs.al option get home
- ```
-
- </details>
-
- <details>
- <summary>4. Working inside the container</summary>
-
- ```
- ds shell
- ls
- cd site3.wp.fs.al
- wp
- wp option get siteurl
- wp option get home
- ```
-
- </details>
|