Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

append the documentroot

Status
Not open for further replies.

lowlander

IS-IT--Management
Sep 29, 2002
4
GB
how can I append a directory to the apache 'documentroot' that I can use it as 'my' documentroot (directory for my docs) too ()? the 'second' docs-directory should not be installed below the configured docomentroot but on the same machine
 
If you want to use youw own DocumentRoot instead of the apache default, just edit httpd.conf and change it to what ever you want. If you want more than one website on your server, you will need to use virtual hosts.
 
o.k. changing the standard documentroot in the httpd.conf is the easiest way to do that - it works but it is not the way I want.

I don't want to use an addtl. directory instead but parallel and I don't want to use virtual hosts (it seems to be the other/higher way to use more than one directory instead ... correct me, please if I'm wrong) - I 'only' want to 'append' a directory to the standard documentroot.

I've tried it by using aliases but they didn't work the way I want or I couldn't make them work the way I want ...

I think it's the way of resolving the url:
- I can access the the 'aliased' directory by keying in that alias as the url - it works and it is o.k.
In this case the alias is the second part of the url.
- But, what I need/want is to call a servlet by keying in the url, in this case is the second part of the url the mountpoint of the servlet-zone, where the server has to find the (my) servlet (that works fine too)...

But the docs, which are to be read by that servlet (and usually exists in the standard or changed documentroot) should not to be found in the 'documentroot' but in the directory that I want to 'append' ... which is (totally, but on the same machine) separated from the documentroot.

And I can't do that both things at once.
Did anyone understand what I mean?
Is there no (other) way out?
 
You can only have one DocumentRoot for your domain. All relative paths and aliases are based on the DocumentRoot. I don't understand what you mean by "appending the DocumentRoot" or "second part of URL". Give me an example of how you want to call the servlet and maybe I can tell you what you need to do to get it to work. For example, or what ever. In this case you would create a directory called "servlet" and use that as the program's DocumentRoot. If there is a file called index.* in there then you just call the name of the dir as in the example above. This assumes you put the directory under you Document Root. If you put it somewhere else, then you alias it and the example url will still work. If you want to set restrictions on the directory, then you will need to create a directory container for it in httpd.conf and put your directives in there. Sorry for being so dumb, but I never heard of anybody needing 2 DocumentRoots before.
 
I think you want to use an alias such that your url would be and would go to the icons directory UNDER the document root or which would go to the netsaint directory UNDER the document root. Just put those directories under DocumentRoot. I hope this helps.


Alias /icons/ "/usr/local/apache/icons/"
Alias /netsaint "/usr/local/netsaint/share"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top