02-28-2024, 05:06 AM
Setting up a website in IIS is something I've done quite a few times, and I remember it being a bit confusing when I first started. It’s definitely manageable, though, especially when you have the right steps laid out. If you’re looking to set up your own site on a specific port number, I’ll walk you through it as if we’re sitting down with a cup of coffee.
First things first, you're going to need to make sure that you have IIS installed on your machine. If you haven’t done that yet, go ahead and open the "Control Panel," then find "Programs and Features." Once you’re in there, look for "Turn Windows features on or off." You'll see a list pop up, and make sure to check the box for IIS. After that, hit OK and let it set everything up. It might take a minute, but just hang tight and it’ll be worth it.
Once IIS is up and running, you’ll want to fire up the Internet Information Services (IIS) Manager. You can find it by searching in the Start menu. When you open it, you’ll see your local machine listed on the left side. This is like your command center for everything IIS-related.
You’re going to want to create a new website. To do this, right-click on the “Sites” node in the connections pane and select “Add Website.” A window will pop up, and this is where the fun starts. You’ll need to fill out a few details here. First, give your website a name—it should be something that makes sense to you. Let's say you call it “MyAwesomeSite.”
Next up is the “Physical Path.” This is where you point IIS to the folder on your hard drive where your website files are stored. Click on the “…” button next to it, browse to your website folder, and select that. It’s crucial to have your files in place before moving forward, so if you haven’t already set up a folder for your site, do that now. You shouldn’t have files just sitting in a Downloads folder—it needs to be organized.
Now, let’s talk about the port number. In the window, you’ll see an option for “Binding.” This is where we can specify that oh-so-important port. Normally, web traffic goes through port 80 for HTTP, but you can absolutely set this to something else if you prefer. Just type in your desired port number into the box next to “Port.” Make sure it’s not already in use by another application or service, because that will create conflicts later on.
As you fill this out, keep in mind that if you’re using a port number like 8080 or anything above 1024, you often won’t run into issues since those are usually free for personal use. But I recommend checking to see what else might be using the port. You can do this by using the Command Prompt; just type "netstat -aon" and look at the "Local Address" column to see existing connections.
Also, if you’re planning to run this website internally—just for your personal use or within a local network—setting a port number might not seem necessary at first, especially if you’re okay with the conventional port 80. But if you like experimenting, you can assign a different port just to make things more interesting.
After specifying the binding and port number, ensure the “Host Name” field is left empty unless you want to access your site using a specific domain name. If you’re just doing this locally and testing things out, it's completely fine to leave this blank.
Once all your details are in, click OK, and you should see your site appear in the list under "Sites." If everything went well, you’ll see that your site is now created. But don’t pop the champagne just yet! There are some further steps to check things off.
Next, to ensure you can access your website on the port you specified, you might need to adjust your Windows Firewall settings. This is straightforward; just search for "Windows Defender Firewall" in the Start menu and open it. Look for an option like “Advanced settings” on the left. In the window that opens, you’re going to want to create a new inbound rule.
When you’re in the rules section, choose “New Rule” on the right side. Select “Port” as the type of rule you want to create. Then, you’ll specify that you’re creating a rule for TCP ports. Make sure to enter that same port number you chose earlier. Click “Next,” then choose “Allow the connection.” After that, you can select the profile it should apply to—choose Public, Private, or both depending on how you plan on using the site. Finally, give your rule a name (like “MyAwesomeSite Port Rule”) and finish it.
Alright, now for the moment of truth. You want to check if everything is working as expected. Open up your web browser and type in “http://localhost:your-port-number” (replace “your-port-number” with the actual number you assigned). If all goes well, you should now see your website! If it’s not working, I’d recommend retracing your steps to double-check everything. Believe me, I've missed a crucial step before and it’s super easy to do!
If you're planning to access your site from another device—like through a smartphone or a different computer on the same network—you’ll need to find your IP address. You can easily do that by typing "ipconfig" in the Command Prompt. Look for the line that shows your IPv4 Address; that’s the one you want. When you type that into the browser along with your port number, you should be able to see your site too.
One thing to keep in mind is that using non-standard ports (anything other than 80 or 443) means that anyone accessing your site needs to specify that port in the URL. So, you’d want to remind any visitors—whether it be friends or colleagues—to include this when they try to connect.
As your website grows, don’t forget about maintenance. Continue to monitor your site, keep track of the port, and make adjustments as needed. And if you ever want to switch up the port or settings, you can easily go back into IIS Manager, find your site, and modify the bindings.
I hope this helps make the setup a lot clearer for you. Expanding your knowledge and skills in IIS is such a rewarding experience, and it opens the door to building really complex applications down the line. Keep experimenting, and don’t hesitate to reach out if you hit any snags along your journey!
I hope you found my post useful. By the way, do you have a good Windows Server backup solution in place? In this post I explain how to back up Windows Server properly.
First things first, you're going to need to make sure that you have IIS installed on your machine. If you haven’t done that yet, go ahead and open the "Control Panel," then find "Programs and Features." Once you’re in there, look for "Turn Windows features on or off." You'll see a list pop up, and make sure to check the box for IIS. After that, hit OK and let it set everything up. It might take a minute, but just hang tight and it’ll be worth it.
Once IIS is up and running, you’ll want to fire up the Internet Information Services (IIS) Manager. You can find it by searching in the Start menu. When you open it, you’ll see your local machine listed on the left side. This is like your command center for everything IIS-related.
You’re going to want to create a new website. To do this, right-click on the “Sites” node in the connections pane and select “Add Website.” A window will pop up, and this is where the fun starts. You’ll need to fill out a few details here. First, give your website a name—it should be something that makes sense to you. Let's say you call it “MyAwesomeSite.”
Next up is the “Physical Path.” This is where you point IIS to the folder on your hard drive where your website files are stored. Click on the “…” button next to it, browse to your website folder, and select that. It’s crucial to have your files in place before moving forward, so if you haven’t already set up a folder for your site, do that now. You shouldn’t have files just sitting in a Downloads folder—it needs to be organized.
Now, let’s talk about the port number. In the window, you’ll see an option for “Binding.” This is where we can specify that oh-so-important port. Normally, web traffic goes through port 80 for HTTP, but you can absolutely set this to something else if you prefer. Just type in your desired port number into the box next to “Port.” Make sure it’s not already in use by another application or service, because that will create conflicts later on.
As you fill this out, keep in mind that if you’re using a port number like 8080 or anything above 1024, you often won’t run into issues since those are usually free for personal use. But I recommend checking to see what else might be using the port. You can do this by using the Command Prompt; just type "netstat -aon" and look at the "Local Address" column to see existing connections.
Also, if you’re planning to run this website internally—just for your personal use or within a local network—setting a port number might not seem necessary at first, especially if you’re okay with the conventional port 80. But if you like experimenting, you can assign a different port just to make things more interesting.
After specifying the binding and port number, ensure the “Host Name” field is left empty unless you want to access your site using a specific domain name. If you’re just doing this locally and testing things out, it's completely fine to leave this blank.
Once all your details are in, click OK, and you should see your site appear in the list under "Sites." If everything went well, you’ll see that your site is now created. But don’t pop the champagne just yet! There are some further steps to check things off.
Next, to ensure you can access your website on the port you specified, you might need to adjust your Windows Firewall settings. This is straightforward; just search for "Windows Defender Firewall" in the Start menu and open it. Look for an option like “Advanced settings” on the left. In the window that opens, you’re going to want to create a new inbound rule.
When you’re in the rules section, choose “New Rule” on the right side. Select “Port” as the type of rule you want to create. Then, you’ll specify that you’re creating a rule for TCP ports. Make sure to enter that same port number you chose earlier. Click “Next,” then choose “Allow the connection.” After that, you can select the profile it should apply to—choose Public, Private, or both depending on how you plan on using the site. Finally, give your rule a name (like “MyAwesomeSite Port Rule”) and finish it.
Alright, now for the moment of truth. You want to check if everything is working as expected. Open up your web browser and type in “http://localhost:your-port-number” (replace “your-port-number” with the actual number you assigned). If all goes well, you should now see your website! If it’s not working, I’d recommend retracing your steps to double-check everything. Believe me, I've missed a crucial step before and it’s super easy to do!
If you're planning to access your site from another device—like through a smartphone or a different computer on the same network—you’ll need to find your IP address. You can easily do that by typing "ipconfig" in the Command Prompt. Look for the line that shows your IPv4 Address; that’s the one you want. When you type that into the browser along with your port number, you should be able to see your site too.
One thing to keep in mind is that using non-standard ports (anything other than 80 or 443) means that anyone accessing your site needs to specify that port in the URL. So, you’d want to remind any visitors—whether it be friends or colleagues—to include this when they try to connect.
As your website grows, don’t forget about maintenance. Continue to monitor your site, keep track of the port, and make adjustments as needed. And if you ever want to switch up the port or settings, you can easily go back into IIS Manager, find your site, and modify the bindings.
I hope this helps make the setup a lot clearer for you. Expanding your knowledge and skills in IIS is such a rewarding experience, and it opens the door to building really complex applications down the line. Keep experimenting, and don’t hesitate to reach out if you hit any snags along your journey!
I hope you found my post useful. By the way, do you have a good Windows Server backup solution in place? In this post I explain how to back up Windows Server properly.