Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Maps and auto reload nginx #9

Closed
rahul286 opened this Issue · 3 comments

3 participants

@rahul286
Owner

basically when a nginx map file updates, user need to reload nginx server config.

normally using command: service nginx reload (on ubuntu)

above command needs sudo/root access so php with www-data can't run it out of the box....

Trick is, detect php-user - value of _SERVER["USER"]

assume it www-data

ask user to edit sudoers file so www-data can reload nginx config

they will add following line...

www-data ALL=NOPASSWD: nginx -t && service nginx reload

Then we will reload nginx config whenever we update map via PHP

<?php shell_exec('sudo nginx -t && service nginx reload'); ?>

There may be some mistake and some error checking in above

Get Mitesh involved as he is good at shell scripting

@yapapaya yapapaya was assigned
@rahul286
Owner

@MiteshShah Please check into this. visudo will help (I guess)

@MiteshShah MiteshShah was assigned
@rahul286
Owner

Maps are not required for wordpress 3.6 onwards.

So closing this ticket as any more work on this will benefit legacy sites only.

@rahul286 rahul286 closed this
@MiteshShah MiteshShah was unassigned by rahul286
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.