0

I create directories dynamically and for each of them I have to set a custom open_basedir directive. I plan to use the apache's <directory> directive, combined with php_admin_value calls.

But since the directories are created dynamically, I also need to create these .conf files dynamically as well. Is it possible?

Bonus question: what can I do for it to work with no service httpd restart?

Thanks

1

I also need to create these .conf files dynamically as well. Is it possible?

Absolutely, just point to the directory that contains them:

Include /path/to/files/*

What can I do for it to work with no service httpd restart?

Only .htaccess files are evaluated at runtime, which you should avoid using if you can.

How about service httpd reload, though? A graceful restart will pick up your config changes without losing any requests, since the new process grabs the listener port while letting the old process finish any active requests.

  • excellent, you're my hero! I didn't know the reload option... – Sebas Feb 6 '14 at 3:15
  • May I ask you an additional question? How about the <directoryMatch regexp> directive. I think I can also use this because there is a pattern in the dir I'm creating. The only problem is to use backreferences into the directive. Can I do that? – Sebas Feb 6 '14 at 3:16
  • @Sebas Backreferences would definitely be a problem, as there's no mechanism for that with <DirectoryMatch>. Might be something that could be solved with mod_rewrite, though? – Shane Madden Feb 6 '14 at 3:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.