mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 03:32:12 +00:00
Merge pull request #2213 from tim-moody/mw-tweaks
Mitra's tweaks to mediawiki install
This commit is contained in:
commit
b8e2deaa8a
3 changed files with 16 additions and 15 deletions
|
@ -29,3 +29,4 @@ mediawiki_abs_path: "{{ mediawiki_install_path }}/mediawiki-{{ mediawiki_version
|
||||||
mediawiki_url: /wiki
|
mediawiki_url: /wiki
|
||||||
mediawiki_url2: /mediawiki
|
mediawiki_url2: /mediawiki
|
||||||
mediawiki_full_url: "http://{{ iiab_hostname }}.{{ iiab_domain }}{{ mediawiki_url }}" # http://box.lan/wiki
|
mediawiki_full_url: "http://{{ iiab_hostname }}.{{ iiab_domain }}{{ mediawiki_url }}" # http://box.lan/wiki
|
||||||
|
mediawiki_symlink: w # can also be mwlink. NO slashes as they are suppplied as needed in the code
|
||||||
|
|
|
@ -18,15 +18,15 @@
|
||||||
unarchive:
|
unarchive:
|
||||||
src: "{{ downloads_dir }}/{{ mediawiki_src }}"
|
src: "{{ downloads_dir }}/{{ mediawiki_src }}"
|
||||||
dest: "{{ mediawiki_install_path }}"
|
dest: "{{ mediawiki_install_path }}"
|
||||||
owner: root
|
owner: "{{ apache_user }}"
|
||||||
group: "{{ apache_user }}"
|
group: "{{ apache_user }}"
|
||||||
mode: u+rw,g+r,o+r # '0755' forced executable bits on files
|
mode: u+rw,g+r,o+r # '0755' forced executable bits on files
|
||||||
keep_newer: yes
|
keep_newer: yes
|
||||||
|
|
||||||
- name: Create symlink {{ doc_root }}/mwlink -> {{ mediawiki_abs_path }}
|
- name: Create symlink {{ doc_root }}/{{ mediawiki_symlink }} -> {{ mediawiki_abs_path }}
|
||||||
file:
|
file:
|
||||||
src: "{{ mediawiki_abs_path }}"
|
src: "{{ mediawiki_abs_path }}"
|
||||||
path: "{{ doc_root }}/mwlink"
|
path: "{{ doc_root }}/{{ mediawiki_symlink }}"
|
||||||
state: link
|
state: link
|
||||||
|
|
||||||
- name: Start MySQL systemd service ({{ mysql_service }}) so we can create db
|
- name: Start MySQL systemd service ({{ mysql_service }}) so we can create db
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
--installdbpass={{ mediawiki_db_user_password }}
|
--installdbpass={{ mediawiki_db_user_password }}
|
||||||
--dbuser={{ mediawiki_db_user }}
|
--dbuser={{ mediawiki_db_user }}
|
||||||
--dbpass={{ mediawiki_db_user_password }}
|
--dbpass={{ mediawiki_db_user_password }}
|
||||||
--scriptpath=/mwlink
|
--scriptpath=/{{ mediawiki_symlink }}
|
||||||
--lang=en
|
--lang=en
|
||||||
--pass={{ mediawiki_admin_user_password }}
|
--pass={{ mediawiki_admin_user_password }}
|
||||||
"{{ mediawiki_site_name }}"
|
"{{ mediawiki_site_name }}"
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
# this works if (docroot)/mwlink links to install
|
# this works if (docroot)/{{ mediawiki_symlink }} links to install
|
||||||
# and LocalSettings.php has
|
# and LocalSettings.php has
|
||||||
# $wgScriptPath = "/mwlink";
|
# $wgScriptPath = "/{{ mediawiki_symlink }}";
|
||||||
# $wgArticlePath = "/wiki/$1";
|
# $wgArticlePath = "/wiki/$1";
|
||||||
# $wgUsePathInfo = true;
|
# $wgUsePathInfo = true;
|
||||||
|
|
||||||
location ~ ^/mwlink/(index|load|api|thumb|opensearch_desc)\.php$ {
|
location ~ ^/{{ mediawiki_symlink }}/(index|load|api|thumb|opensearch_desc)\.php$ {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_pass php; # or whatever port your PHP-FPM listens on
|
fastcgi_pass php; # or whatever port your PHP-FPM listens on
|
||||||
}
|
}
|
||||||
|
|
||||||
# Images
|
# Images
|
||||||
location /mwlink/images {
|
location /{{ mediawiki_symlink }}/images {
|
||||||
# Separate location for images/ so .php execution won't apply
|
# Separate location for images/ so .php execution won't apply
|
||||||
}
|
}
|
||||||
location /mwlink/images/deleted {
|
location /{{ mediawiki_symlink }}/images/deleted {
|
||||||
# Deny access to deleted images folder
|
# Deny access to deleted images folder
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
# MediaWiki assets (usually images)
|
# MediaWiki assets (usually images)
|
||||||
location ~ ^/mwlink/resources/(assets|lib|src) {
|
location ~ ^/{{ mediawiki_symlink }}/resources/(assets|lib|src) {
|
||||||
try_files $uri 404;
|
try_files $uri 404;
|
||||||
add_header Cache-Control "public";
|
add_header Cache-Control "public";
|
||||||
expires 7d;
|
expires 7d;
|
||||||
}
|
}
|
||||||
# Assets, scripts and styles from skins and extensions
|
# Assets, scripts and styles from skins and extensions
|
||||||
location ~ ^/mwlink/(skins|extensions)/.+\.(css|js|gif|jpg|jpeg|png|svg)$ {
|
location ~ ^/{{ mediawiki_symlink }}/(skins|extensions)/.+\.(css|js|gif|jpg|jpeg|png|svg|ttf|woff|woff2)$ {
|
||||||
try_files $uri 404;
|
try_files $uri 404;
|
||||||
add_header Cache-Control "public";
|
add_header Cache-Control "public";
|
||||||
expires 7d;
|
expires 7d;
|
||||||
|
@ -34,18 +34,18 @@ location ~ ^/mwlink/(skins|extensions)/.+\.(css|js|gif|jpg|jpeg|png|svg)$ {
|
||||||
|
|
||||||
## Uncomment the following code if you wish to use the installer/updater
|
## Uncomment the following code if you wish to use the installer/updater
|
||||||
## installer/updater
|
## installer/updater
|
||||||
#location /mwlink/mw-config/ {
|
#location /{{ mediawiki_symlink }}/mw-config/ {
|
||||||
# # Do this inside of a location so it can be negated
|
# # Do this inside of a location so it can be negated
|
||||||
# location ~ \.php$ {
|
# location ~ \.php$ {
|
||||||
# include /etc/nginx/fastcgi_params;
|
# include /etc/nginx/fastcgi_params;
|
||||||
# fastcgi_param SCRIPT_FILENAME $document_root/mwlink/mw-config/$fastcgi_script_name;
|
# fastcgi_param SCRIPT_FILENAME $document_root/{{ mediawiki_symlink }}/mw-config/$fastcgi_script_name;
|
||||||
# fastcgi_pass 127.0.0.1:9000; # or whatever port your PHP-FPM listens on
|
# fastcgi_pass 127.0.0.1:9000; # or whatever port your PHP-FPM listens on
|
||||||
# }
|
# }
|
||||||
#}
|
#}
|
||||||
|
|
||||||
# Handling for the article path (pretty URLs)
|
# Handling for the article path (pretty URLs)
|
||||||
location {{ mediawiki_url }}/ {
|
location {{ mediawiki_url }}/ {
|
||||||
rewrite ^{{ mediawiki_url }}/(?<pagename>.*)$ /mwlink/index.php;
|
rewrite ^{{ mediawiki_url }}/(?<pagename>.*)$ /{{ mediawiki_symlink }}/index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Explicit access to the root website, redirect to main page (adapt as needed)
|
# Explicit access to the root website, redirect to main page (adapt as needed)
|
||||||
|
|
Loading…
Reference in a new issue