How to publish and host a MVC4 application in your domain? - asp.net-mvc

I have a webdomain www.MyDomain.com and a MVC4 web application MyMVCWebApp.
First I publish the application to a local destination.
For instance: C:\TempLocation
And then I host it to my domain with a FTP-tool (FileZilla??)
The files will be hosted but I can't find the webpage.
Which url do I have to write?
http://www.MyDomain.com/MyMVCWebApp/Home/Index.chtml or something?!
Do I have change the settings in my web.config?
What do I have to do?

You can't host an application on a domain.
An application is hosted on a web server. A domain name is only a way to translate an easy to remember address like "www.google.com" to the web server ip address which looks like 173.194.66.104
It is possible to purchase a domain without a web server.
So before going further:
Check if you actually bought a domain only, or a domain with a server
Your domain should redirect to your server ip address, you can see if he is correctly configured by opening a command prompt and doing
C:\> ping www.yourdomain.com
If this is not the case you will need to update the A record of your domain, and wait for the update to be replicated on DNS server worldwird.
If you have a managed server, you should check your hosting provider website. They usually provide in depth documentation, and they all have a different way to do things. Most of the time indeed you will be able to upload your files using a FTP software such as Filezilla.
However, in order to host a MVC 4 application you need a server with
the IIS web server, which means that you need a Windows server. So if
you have a Linux server, you should contact your hosting provider
support and tell them you made a mistake during your order. (It is
possible to host a MVC 4 application on Linux, but I don't think it
is often provided on managed servers)
If you have a dedicated server you are on your own.
The URL you will have to write to access your application will depends on what you have configured in the RegisterRoutes method of the RouteConfigs.cs file.
I recommend you to watch the last video on this page to have a better overview of the possibilities.

Related

Big picture of domain, mobile app website and server

I am new to backend world, currently I am very confused with these concept relationships and really need some help here.
So currently I already have an iOS app and backend server(using python, hosting at AWS) ready. Now I need to register a new domain name and build a basic website to explain and promote my app.
Let's assume I am using goDaddy to register a domain name as "hello.com", now I have my basic website ready as well, I guess I need to upload html files to goDaddy hosting server then the website should be able to run, but then how can I link it to our python server?
For example, in the iOS code when I am sending a http request, I will need to send it to "https://hello.com/api/xxx", correct? Please correct me if I am wrong.
You should use subdomains for the different servers:
www.hello.com = your static website hosted on Godaddy or wherever
api.hello.com = your Python api server
etc...
To make this work you would just edit your DNS zone on Godaddy (or wherever you have your domain hosted) and create a record for "www" that points to your website server and a record for "api" that points to your API server.

How to run asp.net application without exposing the virtualdir in the URL. Like stackoverflow.com does?

How to run asp.net application without exposing the virtual directory in the URL. Like stackoverflow.com does?
Usually when you deploy your ASP.NET MVC application, you create a virtual directory on IIS and point users to the virtual directory. E.g. http://MyDomain.com/MyApp. However, StackOverflow appears without the virtual directory being exposed in the URL. How is this done? URL rewriting or other configuration techniques ?
You do not have to create a virtual directory, you can create an entire new site in IIS. From IIS manager, right click the sites folder listed under your server (IIS 7 or higher. Also available in IIS6 but views/click locations are different). Then select New Website. This brings up the following window in which you can specify the location for the website content, host header information (what domain name to respond to), port information (eg 80), app pool, etc.
By doing this, you can host multiple domains on a single IIS server. Note that if they are all sharing port 80, you have to specify a host name so that IIS knows how to handle multiple sites on a single port. If you do not specify a host name, only one of the websites will be active, the rest will be in a stop state.
You don't have to create a virtual directory. There's a "Default Site", which will load directly under the domain. I can't speak for StackOverflow, but given that they're probably load-balancing with multiple servers already, it's highly unlikely that they're running anything but this site on the web server.

Uploading MVC site to server

I've built an .NET MVC4 website using C#, and now I want to upload it to the internet.
I've never uploaded any website so I don't really know what steps I need to do.
Does it matter what kind of server to use, because when I run the website through VS2012 I can see it runs with IIS express, but then I realized there are several kinds of servers, like apache. Do I need specific kind of server?
And what about domain? what is the difference between domain and server.
Thanks.
You will need IIS for running .NET applications. Apache is more suited for Java, PHP and other languages.
The server/hosting is the space where you upload your project files.
The domain or ip address is what in put in your browser bar to be able to access your application. (Ex: google.com is a domain which is pointing to some server where the google site is hosted).Unless you want to access your application by typing the ip address of the server in the browser you need to buy a domain.
Take a look here for a more detailed explanation:
http://support.hostgator.com/articles/hosting-guide/what-is-the-difference-between-domains-vs-hosting-vs-website
Many web hosting providers allow you to buy a domain when purchasing the hosting serivce but you can buy it separatly and then point it to the ip address of your server.
I dont know many about WIndows web hosting providers but you might start looking in the Microsoft Asp.net website: http://www.microsoft.com/web/hosting/home
In your case you need to choose a hosting provider which supports MVC4.
Then you need to upload your project to the server. Take a look here: http://msdn.microsoft.com/en-us/library/dd410407(v=vs.90).aspx
Your server should come with an FTP account configured. You can use it to upload your files.
A domain is only a address in the internet which allows people to find certain places like an adress in a city.
So in order to make people find your stuff on the internet you have to have it a domain name.
It's the www.mvc4.com <----domain name
The other thing is the type of Server you need apache is also a server but in most cases it is used with java applications. What you need to do is to find a server which supports C# code and
type in .net hosting in google and you will find a lot hosters where you can register domain name for your C# code
step 1: Buy domain from website like Godaddy, net4 india etc
Step 2: Buy windows hosting to host MVC Application from web hosting like Godaddy, net4 india etc. Please buy latest framework hosting
Step 3: Build application using MVC(any version)
Step 4: Upload the published files to FTP.
Run the application.

iis bindings on shared server

I have a scenario where I have many domains (could be hundreds) pointing to my one web application for example
site1.com
site2.com
site3.com
.... etc
All point to my single web app, this app will be in a shared hosting environment.
The only way I can think of configuring these bindings in IIS is to send my shared hosting company an email every time I need a new binding. Is there a better way? for example some how sending all host headers to my site? How do I do that?
You probably need your own IP address to do this. Then you could just not specify a Host name in your binding:
You will need to specify your IP in the binding though.
This means that as long as your DNS points all sites to your IP, then your site should respond.

Can I store a clients website within my website

I'm working on a clients pre-existing web site. I would like to take the solution they sent me and host it within my web site so that I can make changes to it and the client can see them without modifying their current live version without their approval.
It would be nice to store on a sub domain. How do I contain the web site within a folder so that it doesn't conflict with my web.config and other files?
All you are talking about is taking their files and hosting them on a domain of your choice ... this is generally deemed a Dev Site. Nothing fancy here, just create a IIS directory or application for the client's version of software on your server machine and map your domain to it via DNS settings.
Here is an article on creating sub domains
http://forums.asp.net/t/874598.aspx

Resources