3

I am trying to create an Alias directive with Apache 2.2, to point to a shared folder on other computer.

Apache is running on machine M1 at IP 192.168.0.103, the other machine M2, with the shared folder, is at IP 192.168.0.101.

Now I am testing M1 with Linux Ubuntu 12 and M2 with Windows 7. I am editing httpd.conf on M1. There are two Alias directives:

Alias /m1test/ "/home/test/"
Alias /m2test/ "file://192.168.0.101/test/"  

Testing:

  • http://localhost/m1test/foo.txt - is OK!
  • http://localhost/m2test/foo.txt - doesn't work

How can I make the second alias work?

1 Answer 1

2

Use the UNC path instead of the network drive letter notation (which is pretty idiosyncratic to windows).

Alias /edrive //unc/path_here/

Apache knows nothing about 'drive letters'.

BTW... to find the unc path for a networked drive, run in the windows command terminal:

  C:\> net use

It should list your drives and their unc's

6
  • Since i am using virtual box with win2008 my net use stands like this :\\vboxsrv\E_DRIVE. I made my alias like this : Alias /MaliasE/ "\\vboxsrv\E_DRIVE\teste/" (where teste folder is fully shared. when using google chrome: localhost/MaliasE/ i get 404 not found What should i do next ? TY
    – jose mey
    Oct 5, 2012 at 19:04
  • Just changed as u said using foreward slash / instead of backslash \ and it worked
    – jose mey
    Oct 5, 2012 at 19:37
  • @josemey great! Glad it worked out for you. Any chance you'll switch to linux or mac ;) Please mark the answer correct and up vote it if it solved your issue.
    – Ray
    Oct 5, 2012 at 19:48
  • Now we are using Ubuntu 12.04.
    – jose mey
    Oct 10, 2012 at 21:40
  • Just to get a feedback on this. I used the UNC path but also needed to mount drivers between win and linux to share the directory also using samba. After all done, it worked out!
    – jose mey
    Oct 19, 2012 at 15:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .