Web application not accessible using server name or IP address - asp.net

I have a web application published on our Windows Server 2008 R2 (running IIS7). I can access it through
http://localhost/WebApp without any problem.
However, if I try using http://servername/WebApp or http://IP_address/WebApp (from both server machine itself or from a client machine) then it won't show the page correctly (Access Denied Message while login my apps).
My application is developed in ASP.NET and and uses Crystal Reports 2008.
Permissions: Authenticated user and Iuser (folders).
Authentication: Anonymous and Forms are enabled
Please help me to access my application by both IP address and server name

A simple answer is that you need to configure IIS Host file for your server. This is located here: C:\WINDOWS\system32\drivers\etc\hosts.
127.0.0.1 localhost
You can add another line similar to the one above, and give it the server name.

Related

Error loading my web app after deploying .NET Core console app to Azure

My app is running locally without any issue but when I try to run it from Azure console I have the following error :
An error occurred while starting the application.
SqlException: Cannot open server 'Server-name' requested by the login. Client with IP address 'w.x.y.z' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect.
Microsoft.Data.ProviderBase.DbConnectionPool.CheckPoolBlockingPeriod(Exception e)
SqlException: Cannot open server 'server-name' requested by the login. Client with IP address 'ip' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule
I have added IP in firewall setting on azure portal still the issue is happening
This error was caused because your IP was not added in the SQL server tab(azure portal). So you must add the IP address of your SQL Server on Azure portal
You have to update the settings of the "Firewalls and virtual networks" of your SQL Server.
Browse to your SQL Server, add the IP address and allow other azure services and resources to access the server. Refresh and wait at least 5 minutes before trying again.
I also had my ubuntu server firewall blocking my request once, so be sure your webserver is not responsible.
Have you tried enabling this setting?

remote access to iis website by ip addess

I developed an asp.net mvc website and deployed it to my local IIS with success. I can access to the website by localhost:8080/site
I wanted to access the website from remote pc, I binded my website to the ip of my pc (windows 10) (the external ip with the routeur), I added a rule to the inbound calls for the port of the website with the windows firewall manager but I can't access the website remotely by the address http://ip-adress:port/website, I get timeout error.
How can I access this website
regards,
We made a VS Extension called Conveyor, you can get it from the extensions dialog or https://marketplace.visualstudio.com/items?itemName=vs-publisher-1448185.ConveyorbyKeyoti it tunnels through firewalls to allow access to your website from outside, even if incoming calls are blocked by your ISP, as mentioned in the comments.

Connecting to internal SQL Server 2008 R2 from DMZ web server using IIS7 using a trusted connection?

I'm trying to connect and getting an error like:
Login failed. The login cannot be used with Windows Authentication
I'm using mirrored local accounts on SQL Server and web server because I'm simply trying to use a trusted connection between machines not on the same domain. It seems like something that would be fairly common, but after days of trying to find an answer that applied to my situation, I do not recognize that any of the answers were applicable... that or the fact that I'm only a .NET developer and not a sysadmin or DBA means I have it and just don't know it.
Here's what I can say:
CMS web server: ASP.NET 4.0 web app running on Windows Server 2008, IIS7, on corporate DMZ
CMS database server: SQL Server 2008 R2 on a domain server
For various reasons that I won't go in to, encrypting the credentials is not sufficient.
The database port that the application needs to connect on is not the standard port and is set up to listen on a different port.
Setting up DB mirroring isn't an option and doesn't really address the requirements (in my way of thinking)
Also, FYI if this is helpful to know:
Content entry happens on internal web server which publishes content to same DB that is accessed by the DMZ web server.
Content server is set up to have the website run the app pool in integrated mode with a windows domain user that has been set as a service account using the -ga switch and given all the appropriate rights and everything runs perfect.
External web server, without domain access, using mirrored accounts (same username and password set up on the SQL Server machine and web machine).
Local account on the web server set as a service account using -ga switch and running as the app pool identity for my app.
On the SQL Server box, created local user with identical creds and given same permissions that the domain user identity has
Connecting to SQL Server via MGMT studio installed on web server with the SQL Server user creds works fine.
Now, if I put in the username in to the connection strings, everything is perfect. As soon as I put the trusted_connection=yes in the connection string like I did with the domain server connection strings, I get the trust error.
So if my connection string is like this, it works fine:
Server=myServerAddress;Database=myDataBase;Username=MyUser; Password=MyPassword;
If I change my connection string to either of these, it fails:
Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;
or
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
I'm working with one of the client's network admins and he's not necessarily a DBA and doesn't have experience with configuring web apps. So it's possible that we're missing something and any advice or ideas would help. What am I missing?
If using SQL credentials are not an option, then you should use Active Directory and create a one-way trust (have DMZ server domain trust your internal domain), create a service account in your internal domain which your DMZ application can use, and grant that account access to the database. Then it will be able to generate SSPI context.

azure connect between azure myWebRole and nonazure server not working

My webapplication hosted on windows azure, needs to communicate with TFS Server. When any one login to my web app using live id, I want the logged in user to use my Team foundation server(TFS) credentials -username,password and domain to programatically authenticate and connect to our TFS server and create some work items.
I configured my azure connect for the communication to happen between azure WebRole and TFS server (our TFS is non-azure ).I added both the WebRole and the TFS Server into single Connection Group
In my azureportal ,I can see mywebrole and my TFSServer as connected the machine endpoint is active, and that it refreshes since the last connected updates
.But when I try to run my web application from azure and when it tries to communicate with our TFS server ,its throwing error message saying Error message : Team Foundation services are not available from server eg.,http://xyz-abcxyx-01:8080/tfs/eas/. Technical information (for administrator): The remote name could not be resolved: 'xyz-abcxyx-01'
Any suggestions to resolve this issue ?
You should enable remote desktop on your WebRole and connect to one of your instances. Then, try to ping the IP of your TFS server (not the hostname xyz-abcxyx-01). Maybe this is simply a DNS issue (even though using hostnames works with Windows Azure Connect).
If pinging the IP works, but pinging the hostname doesn't work you have a few options left:
Use the IP instead of the hostname. This won't work if you configured your TFS to use host headers.
Create an elevated startup task to modify the hosts file and map the IP to the hostname. In your code you can keep working with the hostname.
Try to modify the DNS server configured in your WebRole to use the default DNS server + your internal DNS server. But to me this doesn't look like a clean solution.
Anyways, in each solution you'll want to store the IP/hostname in the ServiceConfiguration and make sure your code supports changes to the ServiceConfiguration. This will allow you to change the IP/hostname without having to redeploy.
You should check if TFS server is listening on all network interfaces, include the one created by Azure Connect (start with 2a01). Next try to connect to TFS from a machine on the local LAN, just to make sure it is configured correctly. You don't need to use IP for referring to TFS, DNS name is definitely supported out of box.

how to run web application in another machine?

I want to run my web application in another machine.My problem is that i have already created virtual directory in iis 7.5 and add web application in it. Its running in my machine properly but i am trying it run in another machine through url and add the ip address along port number but its not found the web page.Plz help me .
What you need to do is go to the machine on which you want to run your web application, then set up a virtual directory on that machine. Make sure port 80 (or whatever port you decided to run your web application on) is open on the firewall (probably Windows firewall) too. Then you can access your web app on the other machine with a url like http://hostname, where hostname is the NetBIOS name or IP address of the machine you want to access.
If you get a timeout, then IIS isn't running or the firewall is closed. If you get a 404 error, then your virtual directory isn't set up correctly or you typed an invalid URL.

Resources