Tech and non-tech docs related to the "infra" group.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

wordpress-with-docker-scripts.md 3.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. #### Wordpress with docker-scripts
  2. ##### 1. Install dependencies
  3. <details>
  4. <summary>1. Install docker</summary>
  5. ```
  6. curl -fsSL https://get.docker.com -o get-docker.sh
  7. sudo sh get-docker.sh
  8. ```
  9. Reference: https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script
  10. </details>
  11. <details>
  12. <summary>2. Install docker-scripts</summary>
  13. ```
  14. apt install m4
  15. git clone https://gitlab.com/docker-scripts/ds /opt/docker-scripts/ds
  16. cd /opt/docker-scripts/ds/
  17. make install
  18. ds -v
  19. ds -h
  20. ```
  21. Reference: https://gitlab.com/docker-scripts/ds#installation
  22. </details>
  23. <details>
  24. <summary>3. Install Webserver Proxy</summary>
  25. ```
  26. ds pull wsproxy
  27. ds init wsproxy @wsproxy
  28. cd /var/ds/wsproxy/
  29. vim settings.sh
  30. ds make
  31. ```
  32. Reference: https://gitlab.com/docker-scripts/wsproxy#installation
  33. </details>
  34. <details>
  35. <summary>4. Install MariaDB</summary>
  36. ```
  37. ds pull mariadb
  38. ds init mariadb @mariadb
  39. cd /var/ds/mariadb/
  40. vim settings.sh
  41. ds make
  42. ```
  43. Reference: https://gitlab.com/docker-scripts/mariadb#installation
  44. </details>
  45. <p/>
  46. ##### 2. Install Wordpress sites
  47. <details>
  48. <summary>1. Install a wordpress container</summary>
  49. ```
  50. ds pull wordpress
  51. ds init wordpress @wordpress1
  52. cd /var/ds/wordpress1/
  53. vim settings.sh
  54. ds make
  55. ```
  56. Reference: https://gitlab.com/docker-scripts/wordpress#installation
  57. </details>
  58. <details>
  59. <summary>2. Install a site</summary>
  60. ```
  61. cd /var/ds/wordpress1/
  62. ds site
  63. ds site init site1.wp.fs.al
  64. ls
  65. ls site1.wp.fs.al
  66. ls apache2/sites-enabled/
  67. cat apache2/sites-enabled/site1.wp.fs.al.conf
  68. ls ../wsproxy/sites-enabled/
  69. cat ../wsproxy/sites-enabled/site1.wp.fs.al.conf
  70. ```
  71. ```
  72. vim site1.wp.fs.al/settings.sh
  73. ds site install site1.wp.fs.al
  74. ls site1.wp.fs.al/
  75. ```
  76. Try in browser https://site1.wp.fs.al and login as admin.
  77. Reference: https://gitlab.com/docker-scripts/wordpress#manage-a-website
  78. </details>
  79. <details>
  80. <summary>3. Install another site</summary>
  81. ```
  82. cd /var/ds/wordpress1/
  83. ds site init site2.wp.fs.al
  84. ls
  85. ls site2.wp.fs.al
  86. ls apache2/sites-enabled/
  87. ls ../wsproxy/sites-enabled/
  88. vim site2.wp.fs.al/settings.sh
  89. ds site install site2.wp.fs.al
  90. ls site2.wp.fs.al/
  91. ```
  92. Try in browser https://site2.wp.fs.al
  93. </details>
  94. <details>
  95. <summary>4. Install a second container</summary>
  96. ```
  97. ds init wordpress @wordpress2
  98. cd /var/ds/wordpress2/
  99. vim settings.sh
  100. ds make
  101. ```
  102. </details>
  103. <details>
  104. <summary>5. Install a site on the second container</summary>
  105. ```
  106. cd /var/ds/wordpress2/
  107. ds site init site3.wp.fs.al
  108. vim site3.wp.fs.al/settings.sh
  109. ds site install site3.wp.fs.al
  110. ls site3.wp.fs.al/
  111. ```
  112. Try in browser https://site3.wp.fs.al
  113. </details>
  114. <details>
  115. <summary>6. Clone and delete a site</summary>
  116. ```
  117. cd /var/ds/wordpress2/
  118. ds site clone
  119. ds site clone site3.wp.fs.al site4.wp.fs.al
  120. ```
  121. Try in browser https://site4.wp.fs.al
  122. ```
  123. ds site del
  124. ds site del site4.wp.fs.al
  125. ```
  126. </details>
  127. <details>
  128. <summary>7. Backup and restore a site</summary>
  129. ```
  130. cd /var/ds/wordpress2/
  131. ds backup
  132. ds backup site3.wp.fs.al
  133. ls -lh backup/
  134. ```
  135. ```
  136. ds site del site3.wp.fs.al
  137. ```
  138. Try in browser https://site3.wp.fs.al
  139. ```
  140. ds site init site3.wp.fs.al
  141. ls site3.wp.fs.al/
  142. ds restore
  143. ds restore site3.wp.fs.al backup/wordpress-site3.wp.fs.al-2020-07-29.tgz
  144. ```
  145. Try in browser https://site3.wp.fs.al
  146. </details>
  147. <details>
  148. <summary>8. Using wp-cli</summary>
  149. ```
  150. cd /var/ds/wordpress2/
  151. ds wp
  152. ds wp site3.wp.fs.al
  153. ds wp site3.wp.fs.al option
  154. ds wp site3.wp.fs.al option list
  155. ds wp site3.wp.fs.al option get siteurl
  156. ds wp site3.wp.fs.al option get home
  157. ```
  158. </details>
  159. <details>
  160. <summary>9. Working inside the container</summary>
  161. ```
  162. ds shell
  163. ls
  164. cd site3.wp.fs.al
  165. wp
  166. wp option get siteurl
  167. wp option get home
  168. ```
  169. </details>