Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using lamp on CentOS 6. Application code is written in CakePHP. Application files path is "/var/www/html/my_app".

Another file server is mounted with an Application Server. Mounted path on Application Server is "/home/new1/fs_path/scanned/" which contain some folders like "ajain".

I am uploading the files on File Server through SSH. However, I am not able to show the documents because I am not saving the files on application server.

If the file would be on local application server, I will be able to access it through "http:// localhost/my_app/app/webroot/scanned/ajain/abc.jpg". But instead of it, if the file exists on file server. How do I access it through http path.

Possible solution I tried is to change the document root path from "/var/www/html" to "/home/new1/fs_path/scanned/". But this forced me to put my application code on the later path (on file server). Which is not making sense for me.

I also tried to use JkMount command in httpd.conf file using jkmod module, but didn't get any success.

Please suggest the solution. Any help would be appreciated.

share|improve this question

migrated from serverfault.com Jun 27 '13 at 1:16

This question came from our site for system and network administrators.

You need to start with reading the documentation for the server you're using. In this case, start with httpd.apache.org/docs/2.2/urlmapping.html. If you can't figure it out from that, post a question including what you've tried and how it's failed. – Jenny D Jun 26 '13 at 8:20
I already tried 2 possible solutions for me which I also posted in question but didn't get any success. – PHP Developer Jun 26 '13 at 9:11
Well, you don't need mod_jk unless you're using Tomcat. – Tom O'Connor Jun 26 '13 at 9:29
So did you read the link I posted? Also, posting what you tried generally means showing the configuration, not just saying "I tried". – Jenny D Jun 26 '13 at 9:29
up vote 2 down vote accepted

If I understand correctly, you need apache's mod_alias module. If that is the case, in your virtual host configuration you'll add:

Alias /scanned  /home/new1/fs_path/scanned 

<Directory /home/new1/fs_path/scanned>
    Order allow,deny
    Allow from all
share|improve this answer
Worked like a charm. Actually I was trying to do it using mod_jk module. But it was too simple as suggested by you. Thanks. – Arun Jain Jun 27 '13 at 9:45
Hi, When I implemented it on live server, whenever I am giving a path of any pdf then instead of open that pdf in new tab, it suggest the force download that file. Please suggest. Thanks – Arun Jain Jun 28 '13 at 4:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.