Showing posts with label Hosting. Show all posts
Showing posts with label Hosting. Show all posts

Friday, February 15, 2019

Accessing web site running in Visual Studio 2017 using an alternative hostname

Assumptions:

  • Running in Visual Studio 2017
  • Running an application on port 8888
  • Url used to access the application is http://localhost:8888

If you want to access the web site using http://somenamehere:8888 you can do this by doing the following.

  1. Open your .vs/config/applicationhost.config file in a text editor
  2. Find the binding for your application.
    <binding protocol="http" bindingInformation="*:8888:localhost" />
  3. In the same <bindings> section, add another <binding>
    <binding protocol="http" bindingInformation="*:8888:" />
  4. Optional: If you are using https you will need to do the same. The key is that you match the ports.
You should be able to launch your web site in Visual Studio (Control-F5, etc). This will bring it up as it always have.

Now you need to hack your dns so that it can resolve your new made up hostname. In this example, it is somenamehere. The easiest way to do this is to open up your hosts file (C:\Windows\System32\drivers\etc\hosts) in a text editor and add the following line to the bottom of it.

127.0.0.1   somenamehere

You should now be able to ping that hostname and see that 127.0.0.1 is responding.

Now open up the browser and go to http://somenamehere:8888 and you should get your application again.

NOTE: If VS2017 gives you any issues, it may be helpful to run it as administrator.

Friday, May 5, 2017

Static Content Generators

Why have a dynamic site if all you are displaying is static content. Static Content Generators allow you to easily edit your site in a similar way to a dynamic site but without all the over head when you host it. The advantage is you get low server requirements to host your site and it is very fast compared to a dynamic site. You can save money on hosting fees and your users will have a better experience.

As an added benefit your site is more secure because there is less software required to run your site which means less surface error for attack. This is true for the code required by your website and the third party software you need to run your web site such as ASP.NET, etc.

Keep in mind there are definitely times when a dynamic site is necessary, but if you page is the same for every user on your site you may want to consider static content generators. Here are some useful links.

Site Generators

Jekyll - one of the most popular static site generators.
Hugo - easy way to do blogs, but also docs, portfolios, etc.
JAMStack - JavaScript - APIs - Markup. Javascript based solution. Worth looking at.


Visual Editors

NetlifyCMS - plugs into any static site generator, provides graphical UI to edit content for your site generator.
SiteLeaf - content managements in the cloud. Looks like WordPress. Uses GitHub

Free Hosting

GitHub Pages
Setting up a custom domain for GitHub Pages
Video showing how to host a site on GitHub Pages and add a custom domain to it