Need help setting up simple Virtual Directory in IIS7 - iis-7

Noobie question...
Using IIS7, I am trying to create a virtual directory for the folder that contains my video files, but can't get my head around how it is done.
For example...
The existing address is http://www.mydomain.com/members
which points to C:\wwwroot\mydomain\members
I need http://www.mydomain.com/flash-members to point to the same path.
The existing IIS path to the members folder is Server\Sites\www_mydomain_com\members (has application icon)
Any help is appreciated.

For your example, assuming www_mydomain_com is the Site (little world icon), you can do this by:
Open IIS Manager
Right-click the web site, select Add Virtual Directory
In the Alias field, enter flash-members
In the Physical Path field, enter your path (C:\wwwroot\mydomain\members)

Related

point to virtual directory in IIS

I apologize if I am not using the right technical terminology, but I am trying to be as clear as possible, I hope my post makes sense.
I have added a local classic ASP website in IIS 7.5
Sites
csr < website
The physical files location: c:\projects\webapps\csr
The URL in the browser: http://localhost:82/orders.asp?.....
My question is: how do I have to change the configuration if I want the website to open in the browser using the following URL: http://localhost:82/csr/orders.asp?....
Thanks.
Change the website's path to c:\projects\webapps. Then http://localhost:82 will point to c:\projects\webapps and http://localhost:82/csr will point to c:\projects\webapps\csr
If you want http://localhost:82 to point to some other folder, that's fine too. Just add a virtual directory to the website, name it "csr" and give it the path c:\projects\webapps\csr, and you'll be able to browse to http://localhost:82/csr.

.aspx file doesn't work on IIS website

I have a big solution that contains a lot of .aspx file, basically it's a big sln file for my whole server
I wanted to add a website in my IIS server that contains inside a child directory within the root site folder, for example:
my-tools.com physical path is D:/MyWeb <-- Working well
I added a secondary sites, with no relation to the upper site called mysite which is like that:
mysite.my-tools.com which its path it D:/MyWeb/MySite/
If I try to reach mysite.my-tools.com/M_Index.aspx file it give me an error tells me it's not found, however, when I try to view a .jps file from the same directory (e.g mysite.my-tools.com/test.jpg) it returns just find.
it's important to tell that all the pages share the same solution, what do I do here and why it is not working? can anyone tell me?
thanks a lot
having the folder separated like you do is a step in the right direction. next step is to configure IIS to point to that separate folder. then you would need to create a DNS entry for your sub-domain at your DNS host. "subdomain.domain.com". You would be creating a new site, so you could use the same IP address, as long as you add the proper host headers for each site.

Upload files to different virtual directory

I have two web application hosted on different server.For eg. one is main application and the other one is branch application.
In branch application, user will upload their files but we want to keep all uploaded files in main application virtual directory.
So that we put the main application virtual directory path while we upload the files.But We got error message like "Invalid Directory" and can't upload.
Is there any way to upload files from one application to another directly? We are using normal html upload control in asp.net and visual studio 2008.
Code Sample :
main application virtual directory "http://10.10.10.1/mainapp/uploadedfiles/"
branch application virtual directory "http://10.10.10.2/branchapp/"
HttpPostedFile postedFile;
string saveFile = Path.Combine("http://10.10.10.1/mainapp/uploadedfiles/", "File1.pdf");
postedFile.SaveAs(saveFile);
Please guide me the right way and I really appreciated it.
Thanks.
Best Regards,
Chong
In the FileUpload control, the FileUpload.SaveAs(path) method takes a physical path, not a virtual path. So if you have a virtual path, you will need to use the Server.MapPath method to convert it to a physical path. Using your example, you might want to change the last line of your code to:
postedFile.SaveAs(Server.MapPath(saveFile))
Also, you will need to make sure that the account that ASP.Net is running under has ACL write permissions on the physical directory.
I think u can share the directory and ensure both the Apps can access it, because the two apps are in different servers, the directory path maybe just like : \serverA\Files\, and the url of this directory is : http://localhost/files. u can save files to other servers by a relative path if u have the permission.

Confusion Deployment of website on the IIS

I am a noob. I am learning to develop and deploy small websites on the IIS server. Now i have the following confusion :
I think procedure to 'add' a website to the IIS server starts from adding a new virtual directory or adding a new website in the inetmgr. Please correct me if i am wrong. I also think that once we have done this .. it is mandatory to add the source of the project to the inetpub/wwwroot folder. Am i correct ? Is it always necessary to do so ? I am worried because in that case how can we run multiple websites ? Also .. say i have added a virtual directory to the inetmgr ... now what do i do to run my website ... i am trying but getting "Directory Listing Disabled" written on the browser once i type http:\localhost....\Default.aspx
No, the source does not need to be added to the Inetpub folder.
You can simply add a new virtual directory pointing to the location of the site.
(Make sure the selected location is the folder containing your Default.aspx page)
If all other settings are correct, you should be able to hit the site at
http://machineName/virtualDirectoryName/
For this address to work, make sure you are allowing default documents, you may have to add "Default.aspx" to the list depending on your IIS version.

How to get URL of file on a different drive from the ASP.NET application?

I have a server with a C: drive and a D: drive. My ASP.NET application is on D: drive as follows:
D:\inetpub\vhosts\mywebsite.com
I want my application to read and download files located on C:\sessionVideos\
My problem is how do I create an URL pointing to the "C:\sessionVideos\" folder?
Thanks,
James
Assuming that you have direct access to the server, you would use the IIS Manager and right-click the site within which you want to create the URL, select 'New', and then click 'Virtual Directory'.
In the Virtual Directory Creation Wizard, click Next. In the Alias box, type a name for the url (ie: MyWebSite/Videos) and then click Next. In the Path box, type or browse to the 'C:\sessionVideos\' directory, and then click Next. Note that you can select an existing folder or create a new one to contain the content for the virtual directory. Select the check boxes for the access permissions that you want to assign to your users. Click Next and then click Finish.
Now the url http://MyWebSite/Videos will access 'C:\sessionVideos\'
Depends what you're looking to do exactly - you could create a virtual directory underneath your site that maps to the directory hence the folder will seamlessly slot in as if it was located in your application/sites directory.

Resources