How to access website on client machine? - c#

I created management information system for school in MVC 4 which is role based system and configured it on server though IIS. It works fine on single machine (server).Now i need to share that application on LAN network without internet. I have no idea about how to share this to client system.I read many of tutorial but that didn't help me anymore.Please help me i spent lot of time on this issue but got no solution. Thanks in advance.

1.Check the IP address of system in which you hosted the application: eg: 10.0.1.12
2.Replace the localhost in URL with the IP address.
ie http://localhost/YourApplicationFolder
http://10.0.1.12/YourApplicationFolder
3.Add an inbound rule in firewall, for port 80.
4.Now try to access your website from another system with http://10.0.1.12/YourApplicationFolder
setting inbound rule.
1.go to Control Panel\System and Security\Windows Firewall
2.select Advanced settings from left.
3.select Inbound rule from left.
4.Select Add new rule from right.
5.select port and Next.
6.Select TCP and special port specify 80. Next.
7.select Allow the connection.Next.
8.select Domain,private,public.Next
9.Add some name and description.
10.finish
you have to set this in server.

Place your Application folder in C:\inetpub\wwwroot
Open IIS and navigate to Your-PC > Sites > Default Web Site
Right click on your Application folder and convert to application
Now check your IP Address on other system browser if its not showing your IIS page then turn off your PC firewall and now you can access your application any system within LAN
Your URL will be Like http://192.168.1.1/AppFolder/
Thats it.

Related

How to run set up mvc website on local

I've got a web application for our office use only. In my office I've got 12 computer and want to install one pc and access via web browser from all computers. I can run web application on visual studio but couldn't find a proper way for all computers and kinda new in this area.
I would like to access on browser like "myapp.com" or localhost something else. Is that possible to give specific name and access even on mobile phones?
Thanks in advance for all suggestions.
You can host your application using IIS. IIS can be setup in any machine.
Steps :
Install IIS
Open IIS manager by entering inetmgr in Run(win+R)
Add website by browisng to its location to the published website location. (Hope you know how to publish a website in visual studio)
Edit the web config file to configure the sql server credentials(Sql db could be hosted separately or in the same machine)
Right click the website in IIS Manager and click start.
Click browse to view the website
You could either access the site by localhost:portnumber or by specifying IP:port number in settings of the website in IIS manager
You can access the website from mobile or external devices if you select public IP for your website. Incase you're connected to a local network, then the website could be accessed only from within your work place. Discuss with your network admin about exposing your server to public by providing a public IP address, if you're on local network.
Feel free to revert if you have more doubts.

Configuring url IIS 8

I'm configuring an IIS 8 Server, and here is the schema that I'm thinking.
I need two environments
Homolog, is the first and will be a server for applications homologation. Runs at port 8585.
Production, is the production site, and applications running here will be configured under a DNS, and a specific domain. Runs ant port 8080.
Inside ineptup/wwwroot folders I have this structure
I want to access applications under homolog's environment with:
Http://< ip address >:< port >/homolog/< appName >
I want to access applications under production's environment with:
http://< ip address >:< port >/production/< appName >
mydomain.net
So, how can I configure it at IIS 8?
Normally IIS Default Website(which is pointed to inetpub folder) will run on 80 port, You can override it.
If you want to have different ports for your sites
Create website by right clicking on sites, give appropriate path and port number in below window
Give site name(this can be any name just to identify your site in IIS)
Physical path
Port Number
While creating sites check the application pool, it should target to your framework
For domain you have to give host name, before that you have to map your server with DNS provider
This link will guide you through the steps

How can I redirect URLs entered in the browser?

I want to redirect URLs entered in the browser. For example, when I enter http://microsoft.com, it would redirect to http://127.0.0.1:5000/webpage.html and show this page. I want to do this for all websites entered in the browser.
I don't want to do it by ASP.NET.
I have 10 computers in a workgroup network. I want to manage them by a system that it is server.
My program has 2 client and server versions. Client versions install on PC Clients.
I want to be able to get the client bandwidth systems, And if the bandwidth is over, I redirect browser to a page or port (127.0.0.1:32500) and I stop communicating with internet for all programs on PC Clients. I know that I use proxy, but how?
If I set proxy for browser, other programs can connect to Internet without cross through the proxies.
I want to make a program like net support schools that I can control internet on client (Web access in net support).
I would do this by creating entries in the Windows HOSTS file (C:\Windows\System32\Drivers\etc\hosts).
This is a permanent redirect until the hosts files is changed again.
Also, please be aware that Windows maintains a DNS cache, so if you use something like this, you may have to tell windows to flush it's DNS cache. That can be done by using the command:
C:> ipconfig /flushdns
if you have 10 computer,
1-it's better you put a server like one of them and on the server start dns server like 192.168.1.1 and manage all site and ip you want and for clients set dns on you dns server.
2-it's easier, but if your network bigger you can't administer that. You must open every client hosts file (C:\Windows\System32\Drivers\etc) and add row like
127.0.0.1:32500 microsoft.com
if you want change this file you must run as administrator.

Cannot browse asp site from IIS 6.1 from server itself

I cannot browse my asp site from IIS 6.1 from server itself .
My deploying steps are
I compiled my asp.net web site using West Wind ASP.NET 2.0 Compiler
Utility
Deploy my web site to IIS 6.1
Add host header to my host file
(C:\Windows\System32\drivers\etc\hosts) (Let's say :192.168.1.1
www.mywebsite.com)
I cannot browse www.mywebsite.com from my server itself , but I can browse it from client pc by adding host header as step 3 .
I want to know how can i browse my site from server itself . Is there any option ?
Kindly help me , Thanks :)
Try this KB... http://support.microsoft.com/kb/896861
If you are able to browse from other machines, and not from local machine, most likely it is due to LoopBackCheck. The KB explains what needs to be done.
In the server's hosts file, try setting the IP to the loopback address (e.g. 127.0.0.1) instead of the local network IP address. http://en.wikipedia.org/wiki/Loopback Also double check, how is it bound in IIS? To a specific IP or to "all addresses"?

Accessing Azure Emulator from Another Device

I Have two different projects:
Windows Phone 8 Application, which I am running on a real, physical development device.
Azure Cloud service, which contains one simple WebRole endpoint that contains a ASP.NET MVC WebAPI.
My goal is simple:
Use the WP8 Application running from a real device, to access (using HTTPClient) the WebAPI controller while it is deployed to the Azure Emulator.
What DO work is:
The application can successfully communicate with the WebApi when it is deployed on Azure Cloud.
The application can successfully communicate with the WebApi when it is hosted locally on IIS Express (Without Azure), and the IIS Express settings are changed following this article.
As far as I understand, the problem is that the Azure Emulator is configured to listen on IP address 127.0.0.1, which is not accessible from outside the localhost domain.
I found this post that offers a solution to this exact problem, but trying to follow it results in an Unknown Exception while trying to deploy to Azure Emulator.
Is it really impossible to locally test WP8 application that communicates with Azure Cloud Service?
I figured out how it is possible to have a Phone Emulator or an attached physical Windows Phone device communicating with the Azure Emulator.
For other developers struggling with the same requirement, here are the steps required for it to work:
Assumptions:
You know the IP address of the hosting machine.
No Firewall is blocking the access
Shut down IIS and Azure Emulators and restart them after configuration changes
Azure Compute Emulator:
Open "C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\devfabric\DevFC.exe.config" for editing.
Set "VipPoolStartIPAddress" and "VipPoolEndIPAddress" to your hosting machine IP (e.g. 192.168.1.100)
Azure Storage Emulator:
Open both "C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\devstore\DSServiceLDB.exe.config" and "C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\devstore\DSServiceSQL.exe.config" for editing.
Set the services section in both of the files to use hosting IP.
Configure the Storage Connection String in the "Role" settings (instead of default Windows Azure storage emulator setting):
Right click on the Role (under "Roles" folder in the solution explorer) to enter it's Properties page. Click on Settings tab. Make sure you edit the Local settings (Select it on Service Configuration selection box).
Edit the Connection String for the storage
Manually enter credentials
Account name and account key are written under accounts section in DSServiceSQL.exe.config
Specify custom endpoints, with your hosting IP.
Enjoy!
You don't need any external app to do this. Try port forwarding using the following:
Run your application in Azure emulator and then find out its IP and Port by right-clicking the IIS Express icon in the system tray (say 127.0.0.1:81)
Now choose a port to listen to (say 8088) and forward its incoming requests to your application by simply executing the below command in an elevated command prompt:
netsh interface portproxy add v4tov4 listenport=8088 connectaddress=127.0.0.1 connectport=81 protocol=tcp
If the firewall is running and your chosen port is blocked, then open the port (8088 in this example) by adding an inbound rule to Windows Firewall.
Now browse using your Computer IP, like 192.168.0.100:8088, and now you should be able to access your application. And this can be used through your WP or Cordova (mobile) app to test locally. Hope this helps.
(If you want to remove the port forwarding, then just use the delete switch of the netsh interface portproxy command.)
I know this has already been answered, but there hasn't been a simple solution to this problem posted yet. Here is what I did to get my Mac talking to my Azure Storage Emulator(v4.3) running on my PC all over my LAN.
I'm running Windows 10 Version 1511 with v4.3 of the Azure Storage Emulator at time of writing.
Make sure the Azure Storage Emulator is off. You can do that by opening up the Azure Storage Emulator command prompt. You can find it by typing Azure Storage Emulator into the Start menu. Once it's open, type AzureStorageEmulator stop.
Grab the computer's IP address that is running the Azure Storage Emulator. Type ipconfig into the command prompt you already have open. Find the IPV4 Address - should be something like 192.168.1.xxx
Open the file located at C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe.config
In the StorageEmulatorConfig section, edit each service so that it looks like below. Obviously replace the "xxx.xxx.xxx.xxx" with your actual IP address... But keep the ports the same!!!
Next, head on over to your firewall settings. We'll need to allow inbound connections to your computer's IP address to these the three ports listed above in the StorageEmulatorConfig section. Under Control Panel -> System and Security -> Windows Firewall -> Advanced settings -> Inbound Rules, click New Rule... on the right side of the screen. You'll be run through a wizard to set up a new rule. I'll outline what to do below:
Rule Type: Select Custom
Program: Select Customize... then Apply to services only
Protocol and Ports: Set the Protocol type to TCP and set the
Remote port to Specific Ports and in the input box enter
10000-10002. That will add the range of ports specified in the
StorageEmulatorConfig section to this rule and in turn allow
incoming connections through those ports.
Scope: Skip this section, have it apply to all IP addresses for
simplicity sake
Action: Allow the connection
Profile: Depending on what connection profile you are running on, you
should select the appropriate one. In my case, my computer was
connected to the LAN in my house, so I was connected to a Private
network. I deselected Domain and Public. I would recommend doing
the same.
Name: Azure Storage Emulator
Hit finish and you're done!... with that part...
Open an Administrator elevated command prompt and enter the following commands (Note: replace the xxx.xxx.xxx.xxx with your IP address!!!):
netsh http add urlacl url=http://xxx.xxx.xxx.xxx:10000/ user=everyone
netsh http add urlacl url=http://xxx.xxx.xxx.xxx:10001/ user=everyone
netsh http add urlacl url=http://xxx.xxx.xxx.xxx:10002/ user=everyone
Open a browser on the device where you are trying to connect to the Azure Storage Emulator and try to access the following URL's:
http://xxx.xxx.xxx.xxx:10002/
http://xxx.xxx.xxx.xxx:10002/
http://xxx.xxx.xxx.xxx:10002/
If you get a response back that's something like this:
InvalidUriThe requested URI does not represent any resource on the server.
then you're golden... If not, post a comment and I'll update my response.
It's important to note that you must update the connection string in the .config file of the project where you are generating the urls to access your images (assuming that's what you're doing). YOU MAY NO LONGER USE THE DEVELOPMENT CONNECTION STRING SHORTCUT! It must be updated to: (replace the xxx.xxx.xxx.xxx with the IP address from above:
DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://xxx.xxx.xxx.xxx:10000/devstoreaccount1;TableEndpoint=http://xxx.xxx.xxx.xxx:10002/devstoreaccount1;QueueEndpoint=http://xxx.xxx.xxx.xxx:10001/devstoreaccount1;
If you have this in your AppSettings section and you format it nicely with \n's, you'll break the string and the Storage component won't recognize it as a valid connection string. So keep it one long annoying string.
Since you're already using (regular) IIS and you claim that it works, you can use Server Farming as some kind of a Reverse Proxy + Load Balancer to achieve your goal:
Run your WebRole project and save the internal Urls (as appears in the image 127.255.0.2:82).
Open IIS Manager > Server Farms > Create Server Farm.
Choose a name and click Next. in the next panel ('Add Server') add all the Urls you gathered in step 1 and Finish.
Click Yes when asked if you want to create the appropriate Rewrite Rules for this Farm.
Under Server Farms list, click on your new Farm and choose Proxy from the icons on the right, check the Reverse rewrite host in response headers checkbox.
You can now use your regular IIS binding address to access the Emulator instances (once running).
P.S: If you want to reverse this changes, delete the Farm. then click on your computer / server name (root item) in the left tree, choose Url Rewrite on the right, and delete ARR rules.
I have found a way, thanks to this great post here.
Apparently, by re-routing any traffic sent to the my local IP address (e.g. 192.168.0.1) to 127.0.0.1, I am now able to use Windows Phone 8 Emulator against Azure Cloud Emulator instances.
The way I did the routing is by using a simple app named PassPort, but I assume that there are many alternatives to it.
It's recommended to use port forwarding because of the instability of Azure Emulator. However, it doesn't work when connectaddress is 127.0.0.1 using the built-in tool netsh on my windows 7 (see for detail: problem with adding a portproxy using netsh). I search and find PassPort port forwarding utility Win XP to help me with port forwarding.

Categories