How To Use Your Computer As A Web Server

Table of contents:

How To Use Your Computer As A Web Server
How To Use Your Computer As A Web Server
Anonim

If you have a website that is too large to be managed by the hosting services available on the web or if you want to be able to quickly change its structure and configuration, try setting up your web server directly on the computer you are using to view this guide. In these steps you will not find a specific configuration procedure, related to a particular software, but the instructions useful to create a web server directly in your home.

Steps

Run A Webserver From Your Computer Step 1
Run A Webserver From Your Computer Step 1

Step 1. Identify the computer that will become your web server

It must be a device capable of storing a large amount of information. The processing power of the processor, in this case, is not of fundamental importance. If your network is managed by a router, your server will have to connect directly, via a network cable, and not via a Wi-Fi connection, to minimize the 'downtime' of the web server.

Run A Webserver From Your Computer Step 2
Run A Webserver From Your Computer Step 2

Step 2. Choose a good web server software program

This program is the engine that runs your web server, which is the most important part. If possible, use a program that can run in the background, because it does not block the use of your computer. One of the most popular web servers in the world is 'Apache'.

Run A Webserver From Your Computer Step 3
Run A Webserver From Your Computer Step 3

Step 3. Configure your web server

Normally the software used is provided with a guide that explains how to configure it correctly.

Run A Webserver From Your Computer Step 4
Run A Webserver From Your Computer Step 4

Step 4. Create a simple web page to test server operation

Make sure you copy this page into your correct web server folder and name it one of the files 'index'.

Run A Webserver From Your Computer Step 5
Run A Webserver From Your Computer Step 5

Step 5. Check your work by viewing the contents of the address 'https://127.0.0.1/'

If your test page displays correctly, proceed to the next step. If your web server does not use the standard port number 80, test it using the port number used in the configuration, using this syntax 'https://127.0.0.1:port_number/'. If you still don't see your test page correctly, check your server configuration carefully.

Run A Webserver From Your Computer Step 6
Run A Webserver From Your Computer Step 6

Step 6. Tell a friend the public address ('https:// your_public_IP_Address /') of your website so that they can test it

If the test is positive, and everything is displayed correctly, you can continue. If not, consult the 'Tips' section.

Run A Webserver From Your Computer Step 7
Run A Webserver From Your Computer Step 7

Step 7. Purchase a public domain on the web and associate it with your web server's public IP address

If your ISP has provided you with a dynamic IP address, be sure to register the domain as a dynamic DNS service.

Run A Webserver From Your Computer Step 8
Run A Webserver From Your Computer Step 8

Step 8. Create your website

If you want to use server-side scripts, you need to install additional applications on your server and configure them appropriately.

Advice

  • Your computer must always be on. You will be able to turn off its monitor, or put it into stand-by mode, if your web server program is running in the background.
  • You can view your server's website at https:// localhost /.
  • If at 'https://127.0.0.1' you cannot view your server's website, port 80 is probably being blocked by your computer's firewall. If so, you will need to change the firewall configuration.
  • If outside your network it is not possible to view your website at 'https:// your_Public_IP_Address /', and if your network is managed by a router, you will need to enable 'port forwarding' (NAT). This type of configuration varies according to the model of router used, consult the relevant instruction manual, or perform a simple search on Google by entering the model of your router.
  • You probably won't be able to see your own website using the domain you bought. You should see it from https://127.0.0.1/ or https:// yourLANip /.

Warnings

  • Do not make large files available for download. Otherwise your computer will run very slowly.
  • Check the contract signed with your ISP and find out if you have the features to host a web server at home. For http requests, some types of web requests use a port other than the standard port 80. If this is your case, you will need to configure your server to handle requests from other ports as well.

Recommended: