Merge lp:~bellini666/charms/precise/wordpress/mod_rewrite into lp:charms/wordpress

Proposed by Thiago Bellini
Status: Merged
Merged at revision: 73
Proposed branch: lp:~bellini666/charms/precise/wordpress/mod_rewrite
Merge into: lp:charms/wordpress
Diff against target: 16 lines (+6/-0)
1 file modified
hooks/config-changed (+6/-0)
To merge this branch: bzr merge lp:~bellini666/charms/precise/wordpress/mod_rewrite
Reviewer Review Type Date Requested Status
Marco Ceppi (community) Approve
Review via email: mp+219440@code.launchpad.net

Description of the change

It's very commom to have mod_rewrite on wordpress installations.

Also, wordpress creates .htaccess for it automatically depending on the permalink option choosen.

By enabling mod_rewrite by default on the charm, changing permalink is trivial. Otherwise, one would have to ssh to the machine just to "a2enmod rewrite".

Not to mention that, if we change the apache2 to nginx and then change back, it would need to "a2enmod rewrite" again.

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/config-changed'
2--- hooks/config-changed 2013-04-02 23:16:50 +0000
3+++ hooks/config-changed 2014-05-13 22:40:27 +0000
4@@ -76,6 +76,12 @@
5 install -o root -g root -m 0644 files/charm/apache/etc_apache2_sites-enabled_wordpress /etc/apache2/sites-available/wordpress
6 a2ensite wordpress
7
8+ # Wordpress users usually use mod_rewrite. Altough it's being enabled
9+ # here, it's not used by default. But, if the user changes the
10+ # permalinks to something that needs mod_rewrite, wordpress will
11+ # automatically create a /var/www/.htaccess to enable it
12+ a2enmod rewrite
13+
14 echo "apache2" > .web-engine
15 else
16 if [ -f .web-engine ]; then

Subscribers

People subscribed via source and target branches

to all changes: