How to set up web hosting at home

Author: Sara Rhodes
Date Of Creation: 10 February 2021
Update Date: 1 July 2024
Anonim
How To Host Your Own Website For FREE - Home Server Tutorial [2021]
Video: How To Host Your Own Website For FREE - Home Server Tutorial [2021]

Content

In this article, we are going to show you how to host a website on your home computer. To do this, you need the free MAMP program.

Steps

Part 1 of 6: How to Prepare to Host a Site

  1. 1 Make sure your internet service provider allows you to host sites. Most likely, nothing will happen if the site is visited by few users, but more traffic may violate the rules of the ISP.
    • In most cases, the tariff plan can be upgraded to corporate (or similar), which includes hosting with high traffic.
  2. 2 Write the source code for the site. Create code if you haven't already.
  3. 3 Install a text editor that supports PHP files. The choice of editor depends on the operating system:
    • Windows - use Notepad ++.
    • Mac - download free text editor BBEdit; to do this, go to https://www.barebones.com/products/bbedit/ and click “Free Download” on the right.

Part 2 of 6: How to Install MAMP

  1. 1 Open the MAMP website. Go to https://www.mamp.info/en/downloads/ in your computer's web browser.
    • Do this on the computer where you want to host the server.
  2. 2 Download the installation file. To do this, click “MAMP & MAMP PRO 4.0.1” (for Windows) or “MAMP & MAMP PRO 5.0.1” (for Mac).
    • You may need to confirm the download first or select a download folder.
  3. 3 Wait for the installation file to download to your computer. When this happens, move on to the next step.
  4. 4 Double click on the downloaded file. The MAMP installer window will open.
    • On your Mac, click the downloaded PKG file.
  5. 5 Follow the instructions on the screen. These depend on the operating system of your computer, but be sure to uncheck “Install MAMP PRO” if this option appears in the installer window.
  6. 6 Wait for MAMP to install. Now configure this program.

Part 3 of 6: How to set up MAMP

  1. 1 Start MAMP. To do this, click or double-click on the white elephant icon on a gray background. The MAMP toolbar will open.
    • On a Mac, this icon is located in the Applications folder.
  2. 2 Click on Use next free port (Use next free port) when prompted. In this case MAMP will skip port 80 and find another free port.
    • In most cases MAMP will use port 81 if port 80 is busy.
  3. 3 Click on Yes (Yes) when prompted. MAMP will start using the selected port.
  4. 4 Please answer yes to any firewall requests. On a Windows machine, the firewall will prompt you to allow Apache and MySQL network access. Click "Allow" on both prompts.
    • Skip this step on a Mac.

Part 4 of 6: How to Upload Your Site

  1. 1 Copy the source code for your site. Open the site code document, select the text and click Ctrl+C (Windows) or ⌘ Command+C (Mac).
  2. 2 Click on Preferences (Settings). It's an option on the left pane of the MAMP window. A pop-up window will open.
  3. 3 Click on the tab Web Server (Web server). It's near the top of the pop-up window.
  4. 4 Click on Open (Open). It's an option in the middle of the window. The "htdocs" folder will open.
    • On a Mac, click the folder-shaped icon to the right of Document Root.
  5. 5 Open the "index.php" file. Right click on the "index.php" file and select "Edit with Notepad ++" from the menu.
    • On a Mac, click the index.php file, click File, choose Open With, and click BBEdit. If that doesn't work, launch BBEdit and drag the "index.php" file into this editor window.
  6. 6 Replace the contents of the "index.php" file with the copied source code. Click on Ctrl+A (Windows) or ⌘ Command+A (Mac) to highlight the entire contents of the "index.php" file, then press Ctrl+V or ⌘ Command+Vto insert the website code.
  7. 7 Save your document. To do this, click Ctrl+S (Windows) or ⌘ Command+S (Mac).
  8. 8 Close the document and folder. You will be returned to the MAMP settings window.
  9. 9 Click on OK. It's a button at the bottom of the window. The settings are saved and the pop-up window closes.

Part 5 of 6: How to open your website

  1. 1 Click on Start Servers (Start servers). It's an option in the right pane of the window.
  2. 2 Click on Open start page (Open start page). You will find this option on the left side of the window. The MAMP start page will open in your main web browser.
  3. 3 Click on the tab My Website (My website). It's an option at the top of the page. Your site will open.
  4. 4 Browse your site. To do this, scroll it completely.
  5. 5 Find your website url. It's in the address bar at the top of your browser; your site address should be something like "localhost: 81". This is the address you enter to access your website when the computer is connected to the current network and when MAMP is running.

Part 6 of 6: How to open a website on another computer

  1. 1 Make sure your site is up and running. To open the site from any computer, you must have MAMP running on your computer.
    • You will not be able to open the site if MAMP or your computer is not working.
  2. 2 Give your computer a static IP address. In this case, the IP-address will not change, and therefore the address of your site will not change:
    • Open the router's configuration page.
    • Enter credentials if required.
    • Find a list of computers connected to the network.
    • Find your computer name.
    • Select the "Reserve" or "Lock" option next to the IP address of your computer.
  3. 3 Forward the Apache port on the router. To do this, open the Port Forwarding section of the router configuration page, add the port you used for Apache when configuring MAMP, and then save your changes.
    • To find out which port Apache is using, click Preferences in the MAMP toolbar, go to the Ports tab and look at the number on the Apache line.
  4. 4 Find out the public IP address of your computer. To do this, open Yandex, enter my ip and press ↵ Enter... Your computer's public IP address appears above the search results.
  5. 5 Go to a computer that is connected to a different network. To prevent conflicts between the local host of your network and the public IP address, try opening your website on a different computer that is connected to a different network.
  6. 6 Open your site. On another computer, launch a web browser, enter the public IP address of your computer, enter a colon (:), enter the Apache port number, and then click ↵ Enter... Your site should open.
    • For example, if the public IP address of your computer is "123.456.78.901" and the Apache port number is 81, enter 123.456.78.901:81 and press ↵ Enter.

Tips

  • It is better to place your server on an old computer.
  • If possible, connect your computer to the router using an Ethernet cable.

Warnings

  • Do not host the site if your internet connection bandwidth is limited.