Jump to content

Apache's aliases


boen_robot

Recommended Posts

I'm trying to set up a personal server to a friend of mine, but he has this whole bunch of files he needs to share that is located on different disk partitions. What I need to have is one root folder for the server (it's currently Apache's default htdocs) and map certain URLs to specific file paths.I've found the Alias directive which is suppose to do exactly this, but for some reason, when I type an Aliased URL, it returns error 403: Forbidden. How can I enable directory listing in this folder, it's subfolders and enable resources from it to be accessed too?Example of what I have:

Alias /wallpapers "E:/wallpapers"<Directory "E:/wallpapers">Order allow,denyAllow from all</Directory>

Where the stuff under the <Directory> directive was suppose to grant those permissions, yet the error still occurs.Note: I'm writting those in the main server configuration file.

Link to comment
Share on other sites

I'm pretty sure the alias directive, after the first parameter, has an equal sign? Or not?Also, you should try chmoding your aliases---you're on a linux server, correct?

Link to comment
Share on other sites

I'm pretty sure the alias directive, after the first parameter, has an equal sign? Or not?Also, you should try chmoding your aliases---you're on a linux server, correct?

According to the specification I gave in my first post, there isn't an equal sign. Just a space. I'm using Apache 2.2.2.chmoding? What's that? And no, I'm using Windows XP on that machine.@zanfranceschi what is that suppose to mean? Aren't "links" something you create in an (X)HTML file with the <a> tag? We are talking about a server configuration here after all.
Link to comment
Share on other sites

Well, um... that's exactly the point in this topic... how to create such links?If I have Apache's root directory located at for exampleC:/Program Files/Apache Software Foundation/Apache2.2/htdocsAnd I have another direcoty atE:/wallpapershow can I make it so that when I typehttp://localhostit shows the root directory, but when I typehttp://localhost/wallpapersit would behave as if the content ofE:/wallpaperswas inside the htdocs folder? Is some sort of .htaccess requred inside htdocs (or a subfolder in it) and if so, what it should contain? If not, what to change in the main configuration file to achieve this behaviour?

Link to comment
Share on other sites

I'm not sure about windows, but in my linux I simply created a link by dragging the target folder to the dir with the two windows open. I have also an apache server on my windows, but I use WAMP, which is fantastic and really easy to install and configure. I also use this hda7 dir (which has another name under windows) in the localhost @ windows.http://www.wampserver.com/en/index.phpshort for Windows, Apache, MySQL and PHP.It's worth a try!

Link to comment
Share on other sites

I'm not sure about windows, but in my linux I simply created a link by dragging the target folder to the dir with the two windows open. I have also an apache server on my windows, but I use WAMP, which is fantastic and really easy to install and configure. I also use this hda7 dir (which has another name under windows) in the localhost @ windows.http://www.wampserver.com/en/index.phpshort for Windows, Apache, MySQL and PHP.It's worth a try!

You mean in linux you just create a shortcut? Damn, I wish it was that easy with Windows too.I don't need WAMP. I already have Apache up 'n' runnin', and I don't need PHP nor MySQL (yet?) and even if I did, the problem still remains... how to do such mapping on Windows? I know it's some Apache configuration, but what?By the way, note what actually happens with what I have added. The error is not 404: not found, but 403: forbidden. For security reasons, Apache needs to ensure this folder has to be avaiable to the public, not just mapped with the Alias directive. So the true question is how to give full reading permissions to that folder and everything in it.
Link to comment
Share on other sites

I checked my windows httpd.conf file, noticed and tested a few things:- There are some alias modules being loaded (don't know if it's default);- If I add the following, I get an Alias dir to be included in the server:

Alias /test "d:/" <Directory "d:/">    Options Indexes FollowSymLinks MultiViews    AllowOverride all        Order allow,deny    Allow from all</Directory>

Where "/test" is the alias and d:/ is the target. Mind the lack of slash at the end of "/test". If you add it, then you'll have to type it in the URL.Hope it helps.

Link to comment
Share on other sites

Do you have PHP working with Apache 2.2? I had to drop back to Apache 2.0 cuz I couldn't get PHP working with 2.2.

I haven't tryed installing it yet, but hopefully, it wouldn't be much of a problem. I'm not expecting to need it though, so I probably won't be trying soon.@zanfranceschi I tryed it on my computer with Apache 2.0 (later today I'll try with Apache 2.2 again) and it works!!! Thanks a lot :) . Edited by boen_robot
Link to comment
Share on other sites

@aspnetguy I just tryed installing PHP5 on Apache 2.2 and it worked! At first I was lost too, but with the guidance from tanguay.at I was able to do it. The information there is just like for dummies like myself :) . While writting this, I'm actually more exited then ever, because it seems the site also contains info as to how to add XSLT to PHP!!!! My all time mystery question is coming to an end... or at least, hopefully :) .[edit] OK. It seems my mystery question has come to an end. I was actually able to run XSLT with PHP. The feeling is quite odd. It turned out to be easier then I ever thought. [/edit]

Edited by boen_robot
Link to comment
Share on other sites

You should check out xampp, guys. If you're running firefox, just type xampp into the address bar. If you're running any other browser, search google. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...