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:
@@ -52,6 +52,8 @@
|
||||
src: /tmp/wordpress-{{ wp_version }}.tar.gz
|
||||
dest: "{{ wp_dir }}/public_html"
|
||||
extra_opts: [--strip-components=1]
|
||||
owner: "www-data"
|
||||
group: "www-data"
|
||||
remote_src: yes
|
||||
|
||||
- name: Generate Keys and Salts
|
||||
@@ -67,8 +69,8 @@
|
||||
template:
|
||||
src: wp-config.php.j2
|
||||
dest: "{{ wp_dir }}/public_html/wp-config.php"
|
||||
owner: nobody
|
||||
group: nogroup
|
||||
owner: "www-data"
|
||||
group: "www-data"
|
||||
|
||||
- name: Apply Apache Configuration
|
||||
template:
|
||||
@@ -76,6 +78,12 @@
|
||||
dest: /etc/apache2/sites-available/{{ wp_domain }}.conf
|
||||
notify: Reload Apache2
|
||||
|
||||
- name: Enable Apache Module rewrite
|
||||
apache2_module:
|
||||
state: present
|
||||
name: rewrite
|
||||
notify: Reload Apache2
|
||||
|
||||
- name: Enable Apache Website
|
||||
shell: a2ensite {{ wp_domain }}
|
||||
args:
|
||||
|
@@ -8,4 +8,10 @@
|
||||
CustomLog {{ wp_dir }}/logs/access.log combined
|
||||
</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
|
||||
|
Reference in New Issue
Block a user