Removed Wordpress
This commit is contained in:
1 parent
f04a29b5c7
commit
7c2a66540f
9 files changed
-424
No files matched your search
@@ -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 }};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
# }
|
|
||||||
#}
|
|
||||||
@@ -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
|
|
||||||
|
|
||||||
@@ -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
|
|
||||||
|
|
||||||
@@ -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).
|
|
||||||
@@ -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"
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM nginx:alpine
|
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user