I'm currently developing a web application with asp.net mvc 4, wich uses a SQL database. My question is, how can I deploy it on my machine so its accesible from the internet? I really want to just deploy it on my machine so I dont have to migrate my database plus its not for production, my boss just wants to access the web application from his computer which is not on my local network.
1 Answer
- Use a webserver that doesn't run on the desktop (i.e. IIS instead of Cassini. I'm unsure about whether or not IIS Express is a good idea or not - personally I prefer the genuine article. Cassini does not allow external connections btw.)
- Second, ensure your computer is accessible from your boss' location. If you're in an office environment then you're probably behind a NAT, you'll need to ask your network administrator to set up port forwarding to your machine - they'll probably deny a request to forward port 80, so ask for a port above 1024. You'll need to configure IIS and your local computer's firewall to accept connections on that forwarded port and to add the binding to the website in IIS too.
- Get your Internet-visible IP address from a service like WhatIsMyIP.com (or my personal favourite: MoanMyIP.com).
- Your boss will then need to enter
http://yourIPAddress:yourForwardedPort/someAppPathto access your application.
3 Comments
oskar132
I have read that IIs is quite painful for this kind of deployments, do you know about a good tutorial? thanks for your reply btw
Dai
IIS does have a learning curve, but deployment isn't painful at all. I use my own deployment scripts (a simple
*.bat file that uses XCOPY), I do not use Visual Studio's Site Publish feature.Dai
I recommend you install IIS locally and have a play around. I recommend googling for "IIS site bindings" and "IIS application scope" to find articles that explain the main problems you might run into.