From 7c2a66540f89afa5f9eff6704d0f10019e5164cd Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Tue, 17 Dec 2024 17:53:53 +0530 Subject: [PATCH] Removed Wordpress --- wordpress/files/nginx.conf-ff.j2 | 21 -------- wordpress/files/nginx.conf.j2 | 20 -------- wordpress/nginx.conf | 86 -------------------------------- wordpress/playbook-ff.yml | 83 ------------------------------ wordpress/playbook.yml | 69 ------------------------- wordpress/readme.md | 46 ----------------- wordpress/vars/default.yml | 13 ----- wordpress/web/Dockerfile | 3 -- wordpress/web/nginx.conf | 83 ------------------------------ 9 files changed, 424 deletions(-) delete mode 100644 wordpress/files/nginx.conf-ff.j2 delete mode 100644 wordpress/files/nginx.conf.j2 delete mode 100644 wordpress/nginx.conf delete mode 100755 wordpress/playbook-ff.yml delete mode 100755 wordpress/playbook.yml delete mode 100644 wordpress/readme.md delete mode 100644 wordpress/vars/default.yml delete mode 100644 wordpress/web/Dockerfile delete mode 100644 wordpress/web/nginx.conf diff --git a/wordpress/files/nginx.conf-ff.j2 b/wordpress/files/nginx.conf-ff.j2 deleted file mode 100644 index f1f48cf..0000000 --- a/wordpress/files/nginx.conf-ff.j2 +++ /dev/null @@ -1,21 +0,0 @@ -server { - - listen 80; - server_name {{ http_host }}; - - # Allow large attachments - client_max_body_size 128M; - - location / { - - proxy_set_header Host $host:$server_port; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Scheme $scheme; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Real-IP $remote_addr; - add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always; - proxy_pass http://localhost:{{ web_port }}; - } - -} - diff --git a/wordpress/files/nginx.conf.j2 b/wordpress/files/nginx.conf.j2 deleted file mode 100644 index 21a22d5..0000000 --- a/wordpress/files/nginx.conf.j2 +++ /dev/null @@ -1,20 +0,0 @@ -server { - - listen 80; - server_name {{ http_host }}; - - # Allow large attachments - client_max_body_size 128M; - - - location / { - proxy_read_timeout 90; - proxy_connect_timeout 90; - proxy_redirect off; - proxy_pass http://localhost:{{ web_port }}; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-Proto $scheme; - } -} diff --git a/wordpress/nginx.conf b/wordpress/nginx.conf deleted file mode 100644 index 0f9efbb..0000000 --- a/wordpress/nginx.conf +++ /dev/null @@ -1,86 +0,0 @@ -user www-data; -worker_processes auto; -pid /run/nginx.pid; -include /etc/nginx/modules-enabled/*.conf; - -events { - worker_connections 768; - # multi_accept on; -} - -http { - -log_format scripts '$document_root$fastcgi_script_name > $request @ $fastcgi_path_info'; - ## - # Basic Settings - ## - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - # server_tokens off; - - # server_names_hash_bucket_size 64; - # server_name_in_redirect off; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - ## - # SSL Settings - ## - - ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE - ssl_prefer_server_ciphers on; - - ## - # Logging Settings - ## - - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - ## - # Gzip Settings - ## - - gzip on; - - # gzip_vary on; - # gzip_proxied any; - # gzip_comp_level 6; - # gzip_buffers 16 8k; - # gzip_http_version 1.1; - # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; - - ## - # Virtual Host Configs - ## - - include /etc/nginx/conf.d/*.conf; - include /etc/nginx/sites-enabled/*; -} - - -#mail { -# # See sample authentication script at: -# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript -# -# # auth_http localhost/auth.php; -# # pop3_capabilities "TOP" "USER"; -# # imap_capabilities "IMAP4rev1" "UIDPLUS"; -# -# server { -# listen localhost:110; -# protocol pop3; -# proxy on; -# } -# -# server { -# listen localhost:143; -# protocol imap; -# proxy on; -# } -#} diff --git a/wordpress/playbook-ff.yml b/wordpress/playbook-ff.yml deleted file mode 100755 index 7152eb4..0000000 --- a/wordpress/playbook-ff.yml +++ /dev/null @@ -1,83 +0,0 @@ -################################################# -# DO Community Playbooks: Docker -################################################# ---- -- hosts: all - become: true - vars_files: - - vars/default.yml - - tasks: - - name: Pull Wordpress image - docker_image: - name: "{{ image_name }}" - source: pull - force_source: yes - - - name: Copy dockerfile - synchronize: src=web dest=/tmp - - - name: Build nginx webserver image - docker_image: - name: wordpress-web - build: - path: /tmp/web/ - dockerfile: /tmp/web/Dockerfile - pull: yes - state: present - source: build - - - name: Create Wordpress container - docker_container: - name: "{{ container_name }}" - image: "{{ image_name }}" - state: started - restart_policy: "unless-stopped" - env: - WORDPRESS_DB_HOST: "{{ db_host }}" - WORDPRESS_DB_USER: "{{ db_user }}" - WORDPRESS_DB_PASSWORD: "{{ db_pass }}" - WORDPRESS_DB_NAME: "{{ db_name }}" - volumes: - - "/var/lib/{{ http_host }}:/var/www/html" - - - name: Create webserver container - docker_container: - name: wp-web - image: wordpress-web - state: started - restart_policy: "unless-stopped" - links: - - "{{ container_name }}:wordpress" - published_ports: - - "127.0.0.1:{{ web_port }}:80" - volumes: - - "/var/lib/{{ http_host }}:/var/www/html" - -# - name: Check if Nginx conf file exists -# stat: path="/etc/nginx/sites-available/{{ http_conf }}" -# register: status - -# - name: No need to reload Nginx -# debug: msg= {{ "No need to reload Nginx as sites-available entries have already been created" }} - - - name: Set Nginx conf file -# when: status.stat.exists == false - template: - src: "files/nginx.conf-ff.j2" - dest: "/etc/nginx/sites-available/{{ http_conf }}" - - - name: Enable new site -# when: status.stat.exists == false - file: - src: "/etc/nginx/sites-available/{{ http_conf }}" - dest: "/etc/nginx/sites-enabled/{{ http_conf }}" - state: link - notify: Reload Nginx - - handlers: - - name: Reload Nginx - service: - name: nginx - state: reloaded - diff --git a/wordpress/playbook.yml b/wordpress/playbook.yml deleted file mode 100755 index 9696e8b..0000000 --- a/wordpress/playbook.yml +++ /dev/null @@ -1,69 +0,0 @@ -################################################# -# DO Community Playbooks: Docker -################################################# ---- -- hosts: all - become: true - vars_files: - - vars/default.yml - - tasks: - - name: Pull Wordpress image - docker_image: - name: "{{ image_name }}" - source: pull - force_source: yes - - - name: Ensure Host Directory exists - file: - path: "/var/lib/{{ http_host }}" - state: directory - group: www-data - owner: www-data - mode: 0655 - - - name: Create Wordpress container - docker_container: - name: "{{ container_name }}" - image: "{{ image_name }}" - state: started - restart_policy: "unless-stopped" - env: - WORDPRESS_DB_HOST: "{{ db_host }}" - WORDPRESS_DB_USER: "{{ db_user }}" - WORDPRESS_DB_PASSWORD: "{{ db_pass }}" - WORDPRESS_DB_NAME: "{{ db_name }}" - links: - - "mariadb:db" - published_ports: - - "127.0.0.1:{{ web_port }}:80" - volumes: - - "/var/lib/{{ http_host }}:/var/www/html" - - - name: Check if Nginx conf file exists - stat: path="/etc/nginx/sites-available/{{ http_conf }}" - register: status - - - name: No need to reload Nginx - debug: msg= {{ "No need to reload Nginx as sites-available entries have already been created" }} - - - name: Set Nginx conf file - when: status.stat.exists == false - template: - src: "files/nginx.conf.j2" - dest: "/etc/nginx/sites-available/{{ http_conf }}" - - - name: Enable new site - when: status.stat.exists == false - file: - src: "/etc/nginx/sites-available/{{ http_conf }}" - dest: "/etc/nginx/sites-enabled/{{ http_conf }}" - state: link - notify: Reload Nginx - - handlers: - - name: Reload Nginx - service: - name: nginx - state: reloaded - diff --git a/wordpress/readme.md b/wordpress/readme.md deleted file mode 100644 index f6d7ecc..0000000 --- a/wordpress/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# Docker on Ubuntu 18.04 - -This playbook will install Docker an Ubuntu 18.04 machine, as explained in the guide on -[How to Use Ansible to Install and Set Up Docker on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-docker-on-ubuntu-18-04). -A number of containers will be created with the options specified in the `vars/default.yml` variable file. - -## Settings - -- `create_containers`: number of containers to create. -- `default_container_name`: default name for new containers. -- `default_container_image`: default image for new containers. -- `default_container_command`: default command to run on new containers. - - -## Running this Playbook - -Quick Steps: - -### 1. Obtain the playbook -```shell -git clone https://github.com/do-community/ansible-playbooks.git -cd ansible-playbooks/docker_ubuntu1804 -``` - -### 2. Customize Options - -```shell -nano vars/default.yml -``` - -```yml -#vars/default.yml ---- -create_containers: 4 -default_container_name: docker -default_container_image: ubuntu -default_container_command: sleep 1d -``` - -### 3. Run the Playbook - -```command -ansible-playbook -l [target] -i [inventory file] -u [remote user] playbook.yml -``` - -For more information on how to run this Ansible setup, please check this guide: [How to Use Ansible to Install and Set Up Docker on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-docker-on-ubuntu-18-04). \ No newline at end of file diff --git a/wordpress/vars/default.yml b/wordpress/vars/default.yml deleted file mode 100644 index 223b042..0000000 --- a/wordpress/vars/default.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -http_host: "menus.greatbear.in" -http_conf: "menus.greatbear.in.conf" - -container_name: menu-chd -image_name: wordpress:latest - -db_name: "menu_chd" -db_user: "root" -db_pass: "123456" -db_host: "db" - -web_port: "9180" diff --git a/wordpress/web/Dockerfile b/wordpress/web/Dockerfile deleted file mode 100644 index 9e620af..0000000 --- a/wordpress/web/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM nginx:alpine - -COPY nginx.conf /etc/nginx/nginx.conf diff --git a/wordpress/web/nginx.conf b/wordpress/web/nginx.conf deleted file mode 100644 index 8ba6af4..0000000 --- a/wordpress/web/nginx.conf +++ /dev/null @@ -1,83 +0,0 @@ -worker_processes auto; - -error_log /var/log/nginx/error.log warn; -pid /var/run/nginx.pid; - - -events { - worker_connections 1024; -} - - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - access_log /var/log/nginx/access.log main; - - sendfile on; - #tcp_nopush on; - - keepalive_timeout 65; - - set_real_ip_from 10.0.0.0/8; - set_real_ip_from 172.16.0.0/12; - set_real_ip_from 192.168.0.0/16; - real_ip_header X-Real-IP; - - #gzip on; - - upstream php-handler { - server wordpress:9000; - } - - server { - listen 80; - listen [::]:80; - - index index.php index.html index.htm; - - root /var/www/html; - - location ~ /.well-known/acme-challenge { - allow all; - root /var/www/html; - } - - location / { - try_files $uri $uri/ /index.php$is_args$args; - } - - location ~ \.php$ { - try_files $uri =404; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass php-handler; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - } - - location ~ /\.ht { - deny all; - } - - location = /favicon.ico { - log_not_found off; access_log off; - } - location = /robots.txt { - log_not_found off; access_log off; allow all; - } - location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ { - expires max; - log_not_found off; - } - - # set max upload size - client_max_body_size 10G; - } -}