Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have one site www.mysite.com where I got an application program and now we're going to put our web site here too.

The problem is that the application is untouchable, and want to keep it out from the web site team.

This is the image of what I would like to do:

Server data,
Applicantion:
C:\myapplication\app.php
C:\myapplication\appfolder\index.html

Web:
C:\myweb\index.html
C:\myweb\webfolder\index.html


Access from the web,
Applicantion:
www.mysite.com\app.php
www.mysite.com\appfolder\index.html

Web:
www.mysite.com\index.html
www.mysite.com\webfolder\index.html


I know there are virtual folders, but I don't want to add folders one by one...
There are files on the root of the website for the app as for the website.
I would create 2 different FTP accounts, one for C:\myapplication and one for C:\myweb

It is possible to do this?

I'm using Windows 2008 R2 with IIS and PHP

Thank you.

share|improve this question

migrated from stackoverflow.com Jun 14 '11 at 10:35

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

Here is an idea (although untested):

1) Create virtual folder for your php app (I know, you have said you do not want it)

2) Using URL-Rewrite module rewrite urls (e.g. /app.php -> /virtual/app.php).

Your visitors should see normal URL while behind it will be located differently.

You can replace virtual folder by symlink or directory junction if you want -- but it has some drawbacks as such symlinked folder will be physical part of website (at least on server) and can be overwritten by mistake (unless you setup proper access permissions).

The possible problem with this approach is that you have to rely on how well your php app is written -- it may incorrectly calculate paths for include/require and other file-related operations (in one place they may use REAL file location (e.g. C:\myapplication\app.php), in another place they may refer to the path as seen by website (SERVER_ROOT), e.g. C:\myweb\virtual\app.php) -- you really have to test it.

share|improve this answer
    
It seems that is now way to virtually merge 2 folders on Windows 2008 R2, just create symbolic links to each files and folders, maybe creating an automated batch file to do it... I was hoping something like Unionfs but seems that it doesn't exists for Windows. –  4Colors Jun 15 '11 at 1:32
    
So .. what is stopping you from doing the suggested symbolic links path? With the help of Shell Link Extension you can do this VERY quickly. Just keep in mind, that when deploying your "Web" part you may overwrite or even delete the symbolic links (it really depends how you do the deployment) as from user/dev point of view all these files/folders belonging to the same app. –  LazyOne Jun 15 '11 at 10:16
    
I just needed to merge virtually two directories, specially files, but finally I decided to use virtual folders from IIS, added each folder from the web site, if they add another folder I will have to add another virtual folder. It was the faster solution for now... –  4Colors Jun 23 '11 at 7:36
add comment

Your Answer

 
discard

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.