How do i make an alias on my webserver?

Hi experts,

How do i make an alias on my webserver?

i have images on my machine located in /home/me/images/. i would like to be able to access them on /home/httpd/htdocs/

i have tried this:
Alias /home/me/images/ "/home/httpd/htdocs/cctvimages/"
Alias /cctvimages/ /home/me/images/

the first just displays parent directory (go back), the seocnd shows an error: Forbidden: you dont have permission to access/cctvimages/

i have mkdir cctvimages in /home/http/htdocs/cctvimages

Regards,
Mel
melawaisiAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
heskyttbergConnect With a Mentor Commented:
Hi!

Skip the first Alias that is wrong and not needed.
And do not make the dir:
/home/http/htdocs/cctvimages
This dir needs to be removed.

So:
1. rmdir /home/http/htdocs/cctvimages
2. Remove this line from httpd.conf:
Alias /home/me/images/ "/home/httpd/htdocs/cctvimages/"
3. Leave this line as is:
Alias /cctvimages/ /home/me/images/
4. Under this alias add the following.
<Directory /home/me/images>
  Options Indexes
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>

That should do it.

Regards
/Hans - Erik Skyttberg
0
 
pmsyyzCommented:
Alias /images/ "/home/me/images/"

<Directory "/home/me/images">
   Options Indexes MultiViews
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

And make sure that other users have permission to access /home/me/images/.  By default, you are probably the only one who has read access to those files.
0
 
ChrisDrakeCommented:
You just need to make a symbolic link.

Do this:-

cd /home/httpd/htdocs/
rmdir cctvimages
ln -s /home/me/images cctvimages

Now your directory "/home/me/images/" is exactly the same as "/home/httpd/htdocs/cctvimages/"

Have fun!
0
 
ChrisDrakeCommented:
p.s. You probably need to remove whatever stuff you put in your apache confi file earlier, and of course, you need to let people to be able to access the images directory - so if you get "you do not have permission..." errors when trying to see the images, you need to do this as well:-

chmod ugo+rx /home/me/images/

and possibly also this too:-

chmod ugo+x /home/me/
0
All Courses

From novice to tech pro — start learning today.