Sign in to follow this  

I made a test website on my computer. How do you publish it?

Recommended Posts

Generally, publishing an ASP.NET application involves deploying to an IIS server. If you haven’t already, you should practice by installing IIS on your machine, setting up an application pool, and creating a website from your project’s output directory.

If you want to publish on a public server, then you must first secure a domain name and a web server running Windows Server, configure the name server to point to your new web server, and then, use RDP to remote into your new web server and configure IIS from there. Edited by fastcall22
Words.

Share this post


Link to post
Share on other sites

As fastcall wrote, you need a webserver to host your site, and optionally a domain name.  There are several ways of getting one of those - either a service that lets you host just a website, or getting/renting your own machine and installing webserver software on it.

 

It's going to be easiest for you to just use a.service. This is probably as good as any; it lets you try for free for a few days while you figure it out, and after that it's $1 / month.  http://asphostportal.com/ASPNET-Core-1-0-Hosting.aspx

 

If you're feeling more adventurous, you can use a cloud provider that gives you a complete machine of your own, that you then put an operating system and webserver software on.  Since your tutorial was for aspnet core, which runs on both Windows and Linux, you can use either of those operating systems.  I'm hosting the web infrastructure for my game on linux boxes from these guys, which is cheap and stable and I wholeheartedly recommend.   They'll sell you a full virtual machine with Linux for €3/month.  https://www.scaleway.com/

 

If you want a domain name for your site, you'll have to buy a domain, and configure it to point to your webserver.  There are countless places to buy and manage domains; google is one of those.

Share this post


Link to post
Share on other sites

Generally, publishing an ASP.NET application involves deploying to an IIS server. If you haven’t already, you should practice by installing IIS on your machine, setting up an application pool, and creating a website from your project’s output directory.

If you want to publish on a public server, then you must first secure a domain name and a web server running Windows Server, configure the name server to point to your new web server, and then, use RDP to remote into your new web server and configure IIS from there.

 

Generally, publishing an ASP.NET application involves deploying to an IIS server. If you haven’t already, you should practice by installing IIS on your machine, setting up an application pool, and creating a website from your project’s output directory.

If you want to publish on a public server, then you must first secure a domain name and a web server running Windows Server, configure the name server to point to your new web server, and then, use RDP to remote into your new web server and configure IIS from there.

 

Okay, this self contained practice with a IIS server seems ideal. I tried installing IIS from the Microsoft website but when I run the installer it gives me the option to repair and remove IIS not install it. I looked else where and found this then that but I hit a road bump because I can't install something called "Server Manager" to use Add Roles and Features.

Share this post


Link to post
Share on other sites
Note that the "actual publicly facing server" version of IIS comes with the Windows Server operating system.
The "Express" version that comes with Visual Studio is quite limited in how much load / how many users it can support.
You may need to pay higher fees for larger sets of users served. This is how Microsoft makes money.
(Also, if your website also uses Microsoft SQL Server, that, too, may require licensing fees.)

Once you have it running on a server, you will need to make the server available to the general Internet.
This means you need a static IP, and a domain name that maps to that IP.
One way of getting a server on the public internet that can run this is to lease one from Amazon:
https://aws.amazon.com/windows/products/ec2/

Another is to lease one from Microsoft:
https://azure.microsoft.com/en-us/services/virtual-machines/

You will also need to register and pay for the domain name in question.
Many people use GoDaddy for this; I tend to avoid GoDaddy; Amazon, Google, and many others will sell you reliably domain name services.

Note that using IIS and ASP.NET for web sites is a "minority" technology choice. Most independent developers choose Linux as the server platform, and develop the site in HTML/JavaScript, and the servers in JavaScript or PHP or Python or whatever. Thus, you will find many more tutorials, advice, and low-cost options in that ecosystem than on the Microsoft side.
Also, there is lots of low-cost, high-quality hosting available, such as
Amazon Lightsail: https://amazonlightsail.com/features/
Linode: https://www.linode.com/linodes Edited by hplus0603

Share this post


Link to post
Share on other sites

Note that the "actual publicly facing server" version of IIS comes with the Windows Server operating system.
The "Express" version that comes with Visual Studio is quite limited in how much load / how many users it can support.
You may need to pay higher fees for larger sets of users served. This is how Microsoft makes money.
(Also, if your website also uses Microsoft SQL Server, that, too, may require licensing fees.)

Once you have it running on a server, you will need to make the server available to the general Internet.
This means you need a static IP, and a domain name that maps to that IP.
One way of getting a server on the public internet that can run this is to lease one from Amazon:
https://aws.amazon.com/windows/products/ec2/

Another is to lease one from Microsoft:
https://azure.microsoft.com/en-us/services/virtual-machines/

You will also need to register and pay for the domain name in question.
Many people use GoDaddy for this; I tend to avoid GoDaddy; Amazon, Google, and many others will sell you reliably domain name services.

Note that using IIS and ASP.NET for web sites is a "minority" technology choice. Most independent developers choose Linux as the server platform, and develop the site in HTML/JavaScript, and the servers in JavaScript or PHP or Python or whatever. Thus, you will find many more tutorials, advice, and low-cost options in that ecosystem than on the Microsoft side.
Also, there is lots of low-cost, high-quality hosting available, such as
Amazon Lightsail: https://amazonlightsail.com/features/
Linode: https://www.linode.com/linodes

This is only an experiment, I'm not expecting high traffic although the mention of minority technology does worry me.  I'll followed this tutorial through and I'm not sure if my site uses Microsoft SQL Server but I do want a host and I really don't want Microsoft SQL. Would you happen to know how I can check?

 

As fastcall wrote, you need a webserver to host your site, and optionally a domain name.  There are several ways of getting one of those - either a service that lets you host just a website, or getting/renting your own machine and installing webserver software on it.

 

It's going to be easiest for you to just use a.service. This is probably as good as any; it lets you try for free for a few days while you figure it out, and after that it's $1 / month.  http://asphostportal.com/ASPNET-Core-1-0-Hosting.aspx

 

If you're feeling more adventurous, you can use a cloud provider that gives you a complete machine of your own, that you then put an operating system and webserver software on.  Since your tutorial was for aspnet core, which runs on both Windows and Linux, you can use either of those operating systems.  I'm hosting the web infrastructure for my game on linux boxes from these guys, which is cheap and stable and I wholeheartedly recommend.   They'll sell you a full virtual machine with Linux for €3/month.  https://www.scaleway.com/

 

If you want a domain name for your site, you'll have to buy a domain, and configure it to point to your webserver.  There are countless places to buy and manage domains; google is one of those.

I'm having a few problems deploying My ASP.NET core application to IIS. My version of windows 10 isn't good enough as it seems. I'm going to look into deploying this application into IIS but my situation seems grim.

 

The tutorial I follow

Share this post


Link to post
Share on other sites
Right, this is the draw-back of Microsoft technologies. They cost money to get started!
Linux has managed to become a contender because the up-front cost is zero.
(Also, a lot of people feel the ongoing costs are lower, too -- but that's more of a case-by-case thing.)
Yes, if you followed the tutorial you initially linked to, then the storage for your movies lives in a SQL Server database. The "express" version may be enough for small sites.
The Visual Studio ASP.NET integration is very nice, though; much slicker than most tools for the Linux side which are very text-editor-based.

Did you try the "Host in the Cloud" checkbox? I think you can use a free trial Azure account to try that out.

Share this post


Link to post
Share on other sites

Right, this is the draw-back of Microsoft technologies. They cost money to get started!
Linux has managed to become a contender because the up-front cost is zero.
(Also, a lot of people feel the ongoing costs are lower, too -- but that's more of a case-by-case thing.)
Yes, if you followed the tutorial you initially linked to, then the storage for your movies lives in a SQL Server database. The "express" version may be enough for small sites.
The Visual Studio ASP.NET integration is very nice, though; much slicker than most tools for the Linux side which are very text-editor-based.

Did you try the "Host in the Cloud" checkbox? I think you can use a free trial Azure account to try that out.

So you're saying the tutorial I followed does uses Microsoft SQL Server? (If it doesn't)I think I'll try my luck with deploying to IIS first. I researched Azure and that seems to use Microsoft SQL server.

Share this post


Link to post
Share on other sites

On the fourth page of that tutorial, it tells you that you're working with the database:
https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/adding-model

 

It does not. The only thing of interest mentioned was something called "Entity Framework Core" which I looked up and found this. Upon reading this it seems to imply Entity framework core can optionally use Microsoft SQL server. https://docs.microsoft.com/en-us/ef/core/providers/sql-server/

 

Where does it state this? I am not trying to use Microsoft SQL Server and I know this sounds rude but you are being vague.

Share this post


Link to post
Share on other sites

It does not. The only thing of interest mentioned was something called "Entity Framework Core" which I looked up and found this. Upon reading this it seems to imply Entity framework core can optionally use Microsoft SQL server. https://docs.microsoft.com/en-us/ef/core/providers/sql-server/


I'm thinking of the explanation starting in this section (and continuing to the next page):

Update the database

Open a command prompt and navigate to the project directory (your_path/MvcMovie/src/MvcMovie). You can find the path by selecting the web.config file in Solution Explorer and viewing the Full Path property in the Properties window.

Run the following commands in the command prompt:

Copy
console
dotnet ef migrations add Initial
dotnet ef database update
dotnet ef commands
dotnet (.NET Core) is a cross-platform implementation of .NET. You can read about it here

dotnet ef migrations add Initial Runs the Entity Framework .NET Core CLI migrations command and creates the initial migration. The parameter "Initial" is arbitrary, but customary for the first (initial) database migration. This operation creates the Data/Migrations/_Initial.cs file containing the migration commands to add (or drop) the Movie table to the database

dotnet ef database update Updates the database with the migration we just created


On Windows, "database" means "SQL Server" unless you've done something different in particular to try to make it mean something else (which sometimes works and sometimes doesn't.)

Share this post


Link to post
Share on other sites

?Looks like I'll need to restart this experiment to go for the cheaper option. At least visual studios 2015 can be used for my c# projects. I'm going to follow this advice now. Is this good advice from a previous thread?

 

Fire up your text editor, write some HTML, CSS and maybe JavaScript if you are into that sort of thing, and upload the whole collection to some HTTP-accessible location on the web. Or pay somebody like SquareSpace to do most of the heavy lifting for you.

 

Is there a specific technique or goal you want to accomplish here?

Edited by LAURENT*

Share this post


Link to post
Share on other sites

Right, this is the draw-back of Microsoft technologies. They cost money to get started!Linux has managed to become a contender because the up-front cost is zero.(Also, a lot of people feel the ongoing costs are lower, too -- but that's more of a case-by-case thing.)Yes, if you followed the tutorial you initially linked to, then the storage for your movies lives in a SQL Server database. The "express" version may be enough for small sites.The Visual Studio ASP.NET integration is very nice, though; much slicker than most tools for the Linux side which are very text-editor-based.Did you try the "Host in the Cloud" checkbox? I think you can use a free trial Azure account to try that out.

I've personally had nothing but problems deploying asp.net sites. They often need compilation, and once you upload all your dlls you generally have to then ensure the server has all your dependencies dlls and programs installed which often have only graphical installers and must be installed via remote desktop so scripting deployment and maintaining a separate identical dev environment becomes a pain and almost certainly requires you to have administrator access to the server.

I find it much easier to deploy to Linux using php and MySQL as it's a simple matter of uploading the script and importing a db dump which usually then just works. You can usually deploy any dependencies purely in an automated scripted fashion with normal user privileges so the hosting is cheaper as you don't need a complete vps along with associated licensing.

The upshot though of using asp.net and the Microsoft stack and mssql is that you get to use the absolutely fantastic Microsoft SQL management studio which puts the horrid MySQL workbench to shame and squarely in the bin.

Hope this opinion helps...

Share this post


Link to post
Share on other sites

ASP.net core wasn't a good fit for me. Too costly to start with, out of the norm, and seemingly I don't have the right hardware to do good work, but why let a little failure bring me to a halt. Since this thread is open for now at least I have a few questions.

 

  1. HTLM or HTLM5. Do I learn both or just HTLM 5?
  2. Could you recommend any good software similar to visual studios for writing my HTLM and CSS code?
  3. Do I need the Linux operating system for web development?? 
Edited by LAURENT*

Share this post


Link to post
Share on other sites
HTML5 is the flavor of HTML that's current. There's nothing about older HTML that won't work, but if you're starting now, you might as well follow all the HTML5 best practices.
The other thing to learn is CSS (which means CSS3 these days.)
Also ECMAScript 5 (also known as "JavaScript 5") is common, and ECMAScript 6 is starting to become standard on all the browser that "matter."
(Only IE11 doesn't do 6)

Now, when it comes to HTML, CSS, and JavaScript, you typically use a number of helper frameworks, because the technologies are kind-of raw on their own.
My personal favorite for a bare website without special bells or whistles is actually to just write raw JavaScript, CSS, and HTML.

For bigger things, I'd suggest TypeScript (which compiles to JavaScript, and has good integration in VS Code,) SASS (which lets you write some nicer syntax than raw CSS) and React (which is a framework that generates HTML5)
However, there are tons of different frameworks out there (anything from Angular to Ember to Backbone to who-knows.)

https://www.typescriptlang.org/docs/handbook/react-&-webpack.html

For back-end, I happen to like raw node.js or PHP for small things, and Haskell / Warp for big things. Your mileage will almost certainly vary here!
I like MySQL and Postgres as SQL databases, and Redis as a cache (but not for persistence!) Please stay away from people who try to tell you MongoDB is great -- it's certainly easy to get started with, but it's like building a sand castle; it won't stand the test of time.
To develop, I recommend getting a copy of VirtualBox and installing some simple Linux on that (Ubuntu or Red Hat most likely.)
If you stick to PHP, HTML, JavaScript, and CSS, using MySQL as your database back-end, you will be able to get very cheap (or even free) web hosts that you can deploy your application to.

Unfortunately, because of the highly complex layers of technology that fetches pictures and text to put on your screen, there are so many layers you'll end up having to learn about, so there's no single "here's everything you know" tutorial.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this