0

Background

  • Small team(4 people, 2 devs, 1 server admin, director)
  • Three internal applications, one per server.
  • httpd.conf is set to AllowOverride None on /
  • None of our team members are accustomed to Apache

We are getting to the point where we need to set up separate pages and applications external to our legacy application. We would like these to reside in a subdirectory of public folder.

Some of these new applications require .htaccess files.

Questions

  1. Is it possible to have a <Directory> directive for each directory in the httpd.conf?
  2. Is the above better than placing .htaccess files in each application directory
  3. We can't do multiple servers just yet, so are there any other alternatives to what we are attempting to accomplish?

1 Answer 1

1

The overall question is fairly broad, but I'll focus on your specific asks:

  1. Is it possible to have a directive for each directory in the httpd.conf?

Yes, it is possible.

  1. Is the above better than placing .htaccess files in each application directory?

They serve different purposes. <Directory> administratively defines functionality, and can limit what your user can do with an .htaccess file. For your situation (tight-knit team), it may makes sense to be more liberal in your AllowOverride usage while you're in development.

Once you get closer to production, it would make sense to revisit and tighten this down. There is the train of thought that you want your development environment to be as close to production as you can, but while you're exploring your solutions, this might give you more flexibility.

Something along the lines of:

<Directory /path/to/application>
    [AllowOverride all](https://httpd.apache.org/docs/2.2/mod/core.html#allowoverride)
    # Custom Options, etc.
</Directory>

Would allow your .htaccess file to be used for a variety of authentication, authorization, route rewriting, etc.

  1. We can't do multiple servers just yet, so are there any other alternatives to what we are attempting to accomplish?

You could look at containerizing your different applications. Each application could live within its own container, and then you could stand up another container running Nginx that proxies various URIs to your different applications.

3
  • Containerizing as in something like Docker? Apr 9, 2015 at 18:22
  • Yes. Docker is definitely the one that gets the most press these days but there are other options available, like rkt, LXC, etc. Apr 9, 2015 at 22:04
  • OK, thanks! I'll have to look into containers as option. Apr 9, 2015 at 22:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .