Fixed WordPress Permissions

Updated WordPress to 5.1.1. Gave apache2 ownership over Public HTML
Enabled mod_rewrite and options to allow pretty urls.
This commit is contained in:
Kris Lamoureux 2019-03-13 22:22:50 -04:00
parent 7f377e676d
commit e7f532b26b
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
3 changed files with 18 additions and 4 deletions

View File

@ -5,8 +5,8 @@ wp_domain: www.freeitathens.org
wp_admin_email: contact@freeitathens.org wp_admin_email: contact@freeitathens.org
# Version of WordPress to deploy # Version of WordPress to deploy
wp_version: 5.0.2 wp_version: 5.1.1
wp_sha1_hash: 4a6971d35eb92e2fc30034141b1c865e8c156add wp_sha1_hash: f1bff89cc360bf5ef7086594e8a9b68b4cbf2192
# WordPress Home Directory # WordPress Home Directory
# Note: value is a directory without trailing '/' # Note: value is a directory without trailing '/'

View File

@ -52,6 +52,8 @@
src: /tmp/wordpress-{{ wp_version }}.tar.gz src: /tmp/wordpress-{{ wp_version }}.tar.gz
dest: "{{ wp_dir }}/public_html" dest: "{{ wp_dir }}/public_html"
extra_opts: [--strip-components=1] extra_opts: [--strip-components=1]
owner: "www-data"
group: "www-data"
remote_src: yes remote_src: yes
- name: Generate Keys and Salts - name: Generate Keys and Salts
@ -67,8 +69,8 @@
template: template:
src: wp-config.php.j2 src: wp-config.php.j2
dest: "{{ wp_dir }}/public_html/wp-config.php" dest: "{{ wp_dir }}/public_html/wp-config.php"
owner: nobody owner: "www-data"
group: nogroup group: "www-data"
- name: Apply Apache Configuration - name: Apply Apache Configuration
template: template:
@ -76,6 +78,12 @@
dest: /etc/apache2/sites-available/{{ wp_domain }}.conf dest: /etc/apache2/sites-available/{{ wp_domain }}.conf
notify: Reload Apache2 notify: Reload Apache2
- name: Enable Apache Module rewrite
apache2_module:
state: present
name: rewrite
notify: Reload Apache2
- name: Enable Apache Website - name: Enable Apache Website
shell: a2ensite {{ wp_domain }} shell: a2ensite {{ wp_domain }}
args: args:

View File

@ -8,4 +8,10 @@
CustomLog {{ wp_dir }}/logs/access.log combined CustomLog {{ wp_dir }}/logs/access.log combined
</VirtualHost> </VirtualHost>
<Directory {{ wp_dir }}/public_html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet # vim: syntax=apache ts=4 sw=4 sts=4 sr noet