AlvinV. AlvinV. - 1 year ago 47
Bash Question

How to edit Apache configuration so that the changes of git pull don't reflect right away?

I'd like to edit the Apache configuration on Linux so that the changes of every git pull dosn't reflect right away.

I'd like it to only stage after Apache is restarted.

What would be the best approach to this?


I wouldn't change the Apache configuration, but rather what Apache manages.

It can show the content of a git repo, but that should not be the one where the changes are done.

You can have two repos:

  • one for the changes
  • one for reflecting the changes when Apache restart (ie, a git pull from the first)

That is:

git clone first/repo path/to/second/repo
# make Apache serve path/to/second/repo

When restarting Apache, add before the apachectl start:

cd path/to/second/repo
git pull