# Problem hosting under Internet Information Service ( IIS ) locally

**URL:** <https://talk.jekyllrb.com/t/problem-hosting-under-internet-information-service-iis-locally/7206>\
**Category:** Uncategorized\
**Created:** [April 7, 2022, 5:24am UTC](https://talk.jekyllrb.com/t/problem-hosting-under-internet-information-service-iis-locally/7206 "2022-04-07T05:24:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![behai-nguyen](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@behai-nguyen](https://talk.jekyllrb.com/u/behai-nguyen)\
**Post date:** [April 7, 2022, 5:24am UTC](https://talk.jekyllrb.com/t/problem-hosting-under-internet-information-service-iis-locally/7206/1 "2022-04-07T05:24:28Z")

</div>

Hi,

I am Be Hai, from Melbourne, Victioria, Australia. I have only learned Jekyll in the past 3 days, but I have been a software writer in the past 20 years or so. I am very familiar with HTML, CSS etc.

The environment I am using is “Windows Subsystem for Linux” ( WSL2 ), running Ubuntu 20.4.

I went through all tutorials on Jekyll – I am very happy with what I have learned.

And I have successfully put my Jekyll generate “site” onto GitHub IO:

> **[About](https://behai-nguyen.github.io/about.html)**
>
> Documentation of various aspects of software development that I have been learning.

Also on my local machine, in WSL2 works as per instructions. That is:

when I run

**bundle exec jekyll serve**

Then on a Windows browser, I run:

**"localhost colon( : ) 4000"**

I got the same as **github’s**

I have this project locally in **“D:\Codes\behai-nguyen\_github\_io”** , The generated site is in “D:\Codes\behai-nguyen\_github\_io\_site”.

**THE PROBLEM:**

In my understanding / thinking / assumption, if I set a virtual  
directory, “behai”, in Internet Information Service ( IIS ) pointings  
to **“D:\Codes\behai-nguyen\_github\_io\_site”** , then when I run:

**[http://localhost/behai/](http://localhost/behai/)**

it shoud work – but I have broken pages, no CSS applied.

**WHAT I HAVE TRIED and STILL DOES NOT WORK:**

A look into “D:\Codes\behai-nguyen\_github\_io\_site” shows that it does not seem to include theme files.

So I copied the following folder from WSL2 to D:\Codes\behai-nguyen\_github\_io\

/home/behai/gems/gems/minima-2.5.1/\_includes  
/home/behai/gems/gems/minima-2.5.1/\_layouts  
/home/behai/gems/gems/minima-2.5.1/\_sass  
/home/behai/gems/gems/minima-2.5.1/assets

Then, I ran:

**bundle exec jekyll serve** – “http localhost behai” still does not work. “localhost colon( : ) 4000” works.

**jekyll build** – “http localhost behai” still does not work.

After these two commands, content of “\_site” still did not change.

This problem also means: if I upload the entire “D:\Codes\behai-nguyen\_github\_io\_site” to a hosting site, my site will not work.

Would you please kindly help me with this issue? I know it is possible, I just don’t know how to do it yet.

Thank you and best regards,

Be Hai Nguyen.

---

<div class="post-metadata">

**Author:** ![behai-nguyen](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@behai-nguyen](https://talk.jekyllrb.com/u/behai-nguyen)\
**Post date:** [April 7, 2022, 3:57pm UTC](https://talk.jekyllrb.com/t/problem-hosting-under-internet-information-service-iis-locally/7206/2 "2022-04-07T15:57:57Z")

</div>

I found out what it is. To recap, I want to run the generated site as:

**http colon ( : ) // localhost / behai /**

In project config file, **\_config.yml** , I changed **baseurl** and **url** :

```auto
baseurl: "/behai" # the subpath of your site, e.g. /blog
url: "http://localhost" # the base hostname & protocol for your site, e.g. http colon ( : ) // example.com

```

Generated HTMLs now have the appropriate path for CSS:

```auto
<link rel="stylesheet" href="/behai/assets/main.css">

```

I am guessing then, I will have to set these two values appropriately for the domain the site will be hosted on.

I hope this would help someone.

Be Hai Nguyen.

---

<div class="post-metadata">

**Author:** ![BillRaymond](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/billraymond/32/5963_2.png) [@BillRaymond](https://talk.jekyllrb.com/u/BillRaymond)\
**Post date:** [April 7, 2022, 4:51pm UTC](https://talk.jekyllrb.com/t/problem-hosting-under-internet-information-service-iis-locally/7206/3 "2022-04-07T16:51:54Z")

</div>

You are correct that you want to change the `baseurl` and `url` to what you expect for production. However, do not stress changing your `url` every time you run locally.

For example, check out these settings in `_config.yml`:

```auto
baseurl: "/my-website" # the subpath of your site, e.g. /blog
url: "https://mywebsite.com" # the base hostname & protocol for your site, e.g. http://example.com

```

When you use `jekyll build`, those settings get used.

However, when you are testing your site with `jekyll serve` (or more commonly `bundle exec jekyll serve --livereload`), you will notice that Jekyll figures out the correct settings and provide you with a URL that looks like this:

```auto
http://127.0.0.1:4000/my-website/

```

The point I am making here is to configure your `baseurl` and `url` with what you expect them to be for production. When you test locally, `jekyll serve` will automatically adjust the `url` for you.
