Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 9th, 2001, 01:43 PM
hayden hayden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Akron, Ohio
Posts: 97 hayden User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 43 sec
Reputation Power: 7
understanding alias directive

I'm new to apache, just installed it today through phpdev4 along with php, mysql etc. I am using these to stage web sites locally before moving them to my "online" web server account.

phpdev4 install sets up a directory, "www", to serve web pages. I currently have all my projects in another directory. Rather than moving them I would like to set up an alias to allow apache to serve pages in a directory outside the root directory.

I am unclear on how all this works but basically I want to type the following url into my browser:

http://localhost/websites/

which then opens the following file system directory:

C:\My Documents\web sites

to create this do I use the Alias directive as follows?

Alias /websites /My Documents/web sites

(if need be I can change my target directory name to websites instead of web sites, ie no spaces in directory name)

Reply With Quote
  #2  
Old October 9th, 2001, 02:49 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
First off, I don't know anything about Apache on win32.

In UNIX, say you want to do it with /other/non/docroot/path, then add:

Alias /websites/ "/other/non/docroot/path/"

As you can see, you need to add a trailing slash and quote your filesystem path, especially when your directory has space, then that's a MUST.

On top of that, you still need to setup a <Directory> block for your /other/non/docroot/path.

Reply With Quote
  #3  
Old October 9th, 2001, 03:18 PM
hayden hayden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Akron, Ohio
Posts: 97 hayden User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 43 sec
Reputation Power: 7
thanks for your help.

-----
On top of that, you still need to setup a <Directory> block for your /other/non/docroot/path.
-----

what role does the <Directory> block play?

Reply With Quote
  #4  
Old October 9th, 2001, 04:53 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<Directory "/other/non/docroot/path">
AllowOverride xxx
Options yyy
</Directory>

If /other/non/docroot/path is under your docroot, then you don't need to specify it because it's inherited.

AllowOverride is for .htaccess, it's not required. Options somehow is important. When Options is set to None (by default), there are many things you can't do in http://domain.com/websites/ directory.

Reply With Quote
  #5  
Old October 10th, 2001, 10:21 AM
hayden hayden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Akron, Ohio
Posts: 97 hayden User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 43 sec
Reputation Power: 7
ok I'm making progress, thanks again for your help.

I added the Alias and <Directory> directives and am now able to serve web sites from a directory outside my server root.

However I am unable to "directory browse". Apache is looking for a default document name. If it is not present then I get a 404.

Does this mean that I need to add something to my new <Directory> directive to display a file list if no default document is present?

or is it more likely that I need to change something else in the configuration?

Reply With Quote
  #6  
Old October 10th, 2001, 10:39 AM
hayden hayden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: Akron, Ohio
Posts: 97 hayden User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 1 m 43 sec
Reputation Power: 7
ok, directory browing seems to be working after all.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > understanding alias directive


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway