mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
phpmyadmin was never migrated to nginx
This commit is contained in:
parent
7b132ce94f
commit
91783a13d2
6 changed files with 53 additions and 27 deletions
|
@ -1,9 +1,13 @@
|
|||
# - name: Enable phpMyAdmin via Apache, if phpmyadmin_enabled
|
||||
# command: a2ensite phpmyadmin.conf
|
||||
# when: phpmyadmin_enabled
|
||||
# #when: apache_installed is defined and phpmyadmin_enabled
|
||||
- name: Enable phpMyAdmin via nginx, if phpmyadmin_enabled
|
||||
template:
|
||||
src: phpmyadmin.conf.j2
|
||||
dest: "{{ nginx_conf_dir }}/phpmyadmin.conf"
|
||||
when: phpmyadmin_enabled
|
||||
#when: apache_installed is defined and phpmyadmin_enabled
|
||||
|
||||
# - name: Disable phpMyAdmin via Apache, if not phpmyadmin_enabled
|
||||
# command: a2dissite phpmyadmin.conf
|
||||
# when: not phpmyadmin_enabled
|
||||
# #when: apache_installed is defined and not phpmyadmin_enabled
|
||||
- name: Disable phpMyAdmin via nginx, if not phpmyadmin_enabled
|
||||
file:
|
||||
path: "{{ nginx_conf_dir }}/phpmyadmin.conf"
|
||||
state: absent
|
||||
when: not phpmyadmin_enabled
|
||||
#when: apache_installed is defined and not phpmyadmin_enabled
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
# - name: "Set 'apache_install: True' and 'apache_enabled: True'"
|
||||
# set_fact:
|
||||
# apache_install: True
|
||||
# apache_enabled: True
|
||||
#
|
||||
# - name: APACHE - run 'httpd' role
|
||||
# include_role:
|
||||
# name: httpd
|
||||
- name: Download {{ phpmyadmin_dl_url }} to {{ downloads_dir }}
|
||||
get_url:
|
||||
url: "{{ phpmyadmin_dl_url }}" # e.g. https://files.phpmyadmin.net/phpMyAdmin/5.0.4/phpMyAdmin-5.0.4-all-languages.zip
|
||||
dest: "{{ downloads_dir }}" # /opt/iiab/downloads
|
||||
timeout: "{{ download_timeout }}" # 200
|
||||
when: internet_available
|
||||
|
||||
- name: Does {{ downloads_dir }}/{{ phpmyadmin_name_zip }} exist?
|
||||
stat:
|
||||
path: "{{ downloads_dir }}/{{ phpmyadmin_name_zip }}" # e.g. /opt/iiab/downloads/phpMyAdmin-5.0.4-all-languages.zip
|
||||
register: phpmyadmin_dl
|
||||
|
||||
|
||||
- name: Unarchive {{ phpmyadmin_dl_url }} (7+ MB) to /opt (60+ MB)
|
||||
|
@ -32,12 +35,16 @@
|
|||
owner: "{{ apache_user }}"
|
||||
group: "{{ apache_user }}"
|
||||
|
||||
# - name: Install /etc/{{ apache_conf_dir }}/phpmyadmin.conf from template
|
||||
# template:
|
||||
# src: phpmyadmin.j2
|
||||
# dest: "/etc/{{ apache_conf_dir }}/phpmyadmin.conf"
|
||||
# #when: apache_installed is defined
|
||||
# Above 3 stanzas set link/tree/contents ownership to {{ apache_user }}:root
|
||||
# OOPS: CHOWN BELOW CHANGED LINK ALONE (TREE/CONTENTS REMAINED root:root)
|
||||
|
||||
# - name: Change the owner of the PHP tree to Apache
|
||||
# shell: "chown -R {{ apache_user }} /opt/phpmyadmin"
|
||||
# #file:
|
||||
# # path: "/opt/{{ phpmyadmin_name_zip }}"
|
||||
# # owner: "{{ apache_user }}"
|
||||
# # recurse: yes
|
||||
# # state: directory
|
||||
|
||||
# RECORD phpMyAdmin AS INSTALLED
|
||||
|
||||
|
|
|
@ -26,4 +26,6 @@ $cfg['DefaultLang'] = 'en';
|
|||
$cfg['ServerDefault'] = 1;
|
||||
$cfg['UploadDir'] = '';
|
||||
$cfg['SaveDir'] = '';
|
||||
?>
|
||||
$cfg['Servers'][$i]['auth_type'] = 'http';
|
||||
?>
|
||||
|
||||
|
|
3
roles/phpmyadmin/templates/mkuser
Normal file
3
roles/phpmyadmin/templates/mkuser
Normal file
|
@ -0,0 +1,3 @@
|
|||
CREATE USER 'Admin'@'localhost' IDENTIFIED BY 'changeme';
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'Admin'@'localhost' WITH GRANT OPTION;
|
||||
FLUSH PRIVILEGES;
|
15
roles/phpmyadmin/templates/phpmyadmin.conf.j2
Normal file
15
roles/phpmyadmin/templates/phpmyadmin.conf.j2
Normal file
|
@ -0,0 +1,15 @@
|
|||
location ~ ^/phpmyadmin/(.*)\.php{
|
||||
alias /opt/phpmyadmin/$1.php;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
fastcgi_pass php;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
location /phpmyadmin/{
|
||||
root /opt/;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
Alias /phpmyadmin /opt/phpmyadmin
|
||||
<Directory /opt/phpmyadmin>
|
||||
AllowOverride all
|
||||
require all granted
|
||||
</Directory>
|
Loading…
Add table
Add a link
Reference in a new issue