1

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.

4
  • 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
    Commented Jun 26, 2013 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
    Commented Jun 26, 2013 at 9:11
  • Well, you don't need mod_jk unless you're using Tomcat. Commented Jun 26, 2013 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
    Commented Jun 26, 2013 at 9:29

1 Answer 1

2

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
</Directory>
2
  • 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
    Commented Jun 27, 2013 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
    Commented Jun 28, 2013 at 4:31

You must log in to answer this question.

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