|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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) |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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? |
|
#4
|
|||
|
|||
|
<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. |
|
#5
|
|||
|
|||
|
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? |
|
#6
|
|||
|
|||
|
ok, directory browing seems to be working after all.
|
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > understanding alias directive |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|