Merge three applications into one in asp.net mvc 3.0 - asp.net

I have three MVC3 web project into a single solution, like admin, UI and service(WCF service).
Now i need to merge it into a single project as i have to host it on a single IP on Network solution. Please suggest how we can combine all these project.

You can host the three applications on a server and bind them with the same IP but different port number. In the application bindings give different port numbers to the applications. Like default (80) for UI and port 8080 for web-services and port 8090 for admin application.
Another option is to use the same IP and ports but ask your admin to configure 3 host name in DNS that map to the same IP. Then in bindings specific each distinct hostname for each of the web applications.
If the above solutions are not acceptable in your case then you need to make some changes to the application and organize it using MVC areas. Then you will have one application and 3 areas however you need to take care of session management, security,etc if they differ in the 3 apps. Here is info: http://msdn.microsoft.com/en-us/library/ee671793(v=vs.100).aspx
Another one: http://www.codeguru.com/csharp/.net/net_asp/mvc/article.php/c20227/Using-Areas-in-ASPNET-MVC-Application.htm

Related

Running multiple ASP.NET websites on same port and IP

I want run multiple ASP.NET websites on a single IIS server using the same IP address and port (80).
I cannot use host headers to accomplish this because my clients have not agreed to use a domain name.
My websites will be accessed using an IP like 227.23.32.44. All of them will use the same port (80). The reason for this is, I have around seven applications and my clients wants me to use standard, IANA approved, easy to remember port numbers.
If I want to go with standard, IANA approved TCP port numbers, I would be left with
227.23.32.44:80
227.23.32.44:116
227.23.32.44:84
This is not very user friendly.
Rather, if I use
227.23.32.44:80
227.23.32.44:81
227.23.32.44:82
Then it is much more user friendly but my clients will not let me use this.
Is there any other way to run multiple websites? Can I use another proxy server to inspect the url of all incoming requests and then route to the necessary application? I have heard about nginx. Can I use nginx to do this?
You need to uniquely identify a site using a composite key of IP+Host Header+Port.
Since host header is out, you are left with just IP and Port. You have 2 options.
1.Have multiple adapters so that you have multiple IPs and port will be 80.
2.Have same IP but different Ports
Host header is meant precisely for this reason. You can have same IP, same port but different Host header.
Nginx is not a silver bullet either. You won't be able to run ASP.NET on Nginx.
Why not to put applications in different folders on IIS?
227.23.32.44/WebApp1
227.23.32.44/WebApp2
227.23.32.44/WebApi
IIS support this out of the box:
Go to IIS Manager
Right-click Default Web Site
Choose "Add Application..." command. Alias means customer visible part of URL.

WebServices and Web Application in the same IIS

This is a very silly question, but I am begginer on this subject so:
If an Application A (asp.net MVC C application) is hosted in the same machine and IIS of WebServices B, is it possible that A consume B by using IP instead of URL?
If yes, Is this behavior configurable?
It is possible and very simple. Just go ahead and use the IP when specifying the address on your Application A. You can even use 127.0.0.1 and it should work.
However, if both your applications (asp.net mvc and webservices) are bound to port 80 and differ only on the host, you will need to create an entry in the local HOSTS file pointing to the local IP in order to make it work.
It is certainly possible. If your service is SOAP based (basicHttpBining, wsHttpBinding etc.) you could consider using netNamedPipe binding instead.
This is optimised for inter-process communication on the same machine.
It doesn't impact your service code, so if you split onto two servers in the future, it will just be a config change.

Hosting Multiple Sites through LAN in ASP.NET IIS 7

We have a few services running on our internal server, named cpweb2.
The Default Web Site is accessed locally by browsing to http://cpweb2/.
To enable browsing to other applications, the other sites are assigned a different port number.
For example:
CapacityTracker is configured to use port 8081: http://cpweb2:8081/
AcpWcfTool is configured to use port 8093: http://cpweb2:8093/
ProductionScoreboard is configured to use port 8082: http://cpweb2:8082/
ShopServices is configured to use port 8095: http://cpweb2:8095/
As you can imagine, not many people simply remember the web address for these sites.
I am currently creating a new service called AcpMainframe. I would like to give it a more user friendly URL like http://cpweb2/mainframe or http://mainframe.cpweb2/, but I don't know how exactly to do that if Default Web Site is not one of my projects.
I guess this question is two parts.
Can I get my new AcpMainframe service added to the root level Default Web Site if I do not have the code for that root level website?
If so, how do I go about that?
If you can use other hostnames in addition to the one you have, you can set bindings in IIS that will allow multiple sites to run on port 80. Examples can be found here.

Security groups and UDP on Heroku

Has anyone experienced running multiple collaborating applications on Heroku? For example, an admin application to manage another application; or a stats server observing another application?
On Amazons' EC2 platform you can use security groups to restrict access to servers, creating a virtual network between your application or server instances. Is there any such way to do this on Heroku? If so, can you open UDP as well as TCP connections?
Thanks
Robbie
The comment from #elithrar is correct. To talk between applications you either need to define an API, or used shared resources. For example you can have 2 applications connect to the same database by manually copying and pasting the DATABASE_URL from one app to another. This has the downside that should we need to roll credentials (very rare) your manually copied configuration will break.
The same pattern can be used with any add-ons, such as https://addons.heroku.com/redistogo or https://addons.heroku.com/iron_mq to share a message bus or queue between two applications.

DNS and Http HOST header issue

I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. And I am using publishing portal template. I have a physical server with a single IP address, and I have set in DNS to map two domain names (server1.mycorp.com and server2.mycorp.com) to the same server/IP address.
My question is how to setup two SharePoint web sites on the same server with a single IP address to serve two domain names individually (with the same port number 80)? My current idea is to create two SharePoint web applications for the two web sites, with the same port number 80, but with different host header (setup Http host header to server1.mycorp.com and server2.mycorp.com individually for the two SharePoint web applications). Not sure whether my idea is feasible?
thanks in advance,
George
I believe this belongs in ServerFault.
And you also seem to describe a common host header concept, when you create your WebApplication in the SharePoint Central Admin, you will define a host header, being on the same IP or not, IIS will respond to them individually, so yes it works.
Application Management => Create Web Application => define host header, define same port 80, done.

Resources