How to Create Web Hosting at Home (With Pictures)

Table of contents:

How to Create Web Hosting at Home (With Pictures)
How to Create Web Hosting at Home (With Pictures)
Anonim

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

Create a Web Host in Your Home Step 1
Create a Web Host in Your Home Step 1

Step 1. Make sure your ISP allows hosting 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

Create a Web Host in Your Home Step 2
Create a Web Host in Your Home Step 2

Step 2. Write the source code of the site

Create code if you haven't already.

Create a Web Host in Your Home Step 3
Create a Web Host in Your Home Step 3

Step 3. Install a text editor that supports PHP files

The choice of editor depends on the operating system:

  • Windows - use Notepad ++.
  • Mac - Download the 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

Create a Web Host in Your Home Step 4
Create a Web Host in Your Home Step 4

Step 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

Create a Web Host in Your Home Step 5
Create a Web Host in Your Home Step 5

Step 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

Create a Web Host in Your Home Step 6
Create a Web Host in Your Home Step 6

Step 3. Wait for the installation file to download to your computer

When this happens, move on to the next step.

Create a Web Host in Your Home Step 7
Create a Web Host in Your Home Step 7

Step 4. Double click on the downloaded file

The MAMP installer window will open.

On your Mac, click the downloaded PKG file

Create a Web Host in Your Home Step 8
Create a Web Host in Your Home Step 8

Step 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.

Create a Web Host in Your Home Step 9
Create a Web Host in Your Home Step 9

Step 6. Wait for MAMP to install

Now configure this program.

Part 3 of 6: How to set up MAMP

Create a Web Host in Your Home Step 10
Create a Web Host in Your Home Step 10

Step 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

Create a Web Host in Your Home Step 11
Create a Web Host in Your Home Step 11

Step 2. Click 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

Create a Web Host in Your Home Step 12
Create a Web Host in Your Home Step 12

Step 3. Click Yes when prompted

MAMP will start using the selected port.

Create a Web Host in Your Home Step 13
Create a Web Host in Your Home Step 13

Step 4. Answer affirmatively to any requests from the firewall

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

Create a Web Host in Your Home Step 14
Create a Web Host in Your Home Step 14

Step 1. Copy the source code of your site

Open your site code document, select the text, and press Ctrl + C (Windows) or ⌘ Command + C (Mac).

Create a Web Host in Your Home Step 15
Create a Web Host in Your Home Step 15

Step 2. Click on Preferences

It's an option on the left pane of the MAMP window. A pop-up window will open.

Create a Web Host in Your Home Step 16
Create a Web Host in Your Home Step 16

Step 3. Click the Web Server tab

It's near the top of the pop-up window.

Create a Web Host in Your Home Step 17
Create a Web Host in Your Home Step 17

Step 4. Click 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

Create a Web Host in Your Home Step 18
Create a Web Host in Your Home Step 18

Step 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

Create a Web Host in Your Home Step 19
Create a Web Host in Your Home Step 19

Step 6. Replace the contents of the "index.php" file with the copied source code

Press Ctrl + A (Windows) or ⌘ Command + A (Mac) to select the entire contents of the “index.php” file, and then press Ctrl + V or ⌘ Command + V to paste the website code.

Create a Web Host in Your Home Step 20
Create a Web Host in Your Home Step 20

Step 7. Save the document

To do this, press Ctrl + S (Windows) or ⌘ Command + S (Mac).

Create a Web Host in Your Home Step 21
Create a Web Host in Your Home Step 21

Step 8. Close the document and folder

You will be returned to the MAMP settings window.

Create a Web Host in Your Home Step 22
Create a Web Host in Your Home Step 22

Step 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

Create a Web Host in Your Home Step 23
Create a Web Host in Your Home Step 23

Step 1. Click Start Servers

It's an option in the right pane of the window.

Create a Web Host in Your Home Step 24
Create a Web Host in Your Home Step 24

Step 2. Click on 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.

Create a Web Host in Your Home Step 25
Create a Web Host in Your Home Step 25

Step 3. Click on the My Website tab

It's an option at the top of the page. Your site will open.

Create a Web Host in Your Home Step 26
Create a Web Host in Your Home Step 26

Step 4. Browse your site

To do this, scroll it completely.

Create a Web Host in Your Home Step 27
Create a Web Host in Your Home Step 27

Step 5. Find your website address

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

Create a Web Host in Your Home Step 28
Create a Web Host in Your Home Step 28

Step 1. Make sure your site is working

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

Create a Web Host in Your Home Step 29
Create a Web Host in Your Home Step 29

Step 2. Assign a static IP address to your computer

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.
Create a Web Host in Your Home Step 30
Create a Web Host in Your Home Step 30

Step 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

Create a Web Host in Your Home Step 31
Create a Web Host in Your Home Step 31

Step 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.

Create a Web Host in Your Home Step 32
Create a Web Host in Your Home Step 32

Step 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.

Create a Web Host in Your Home Step 33
Create a Web Host in Your Home Step 33

Step 6. Open your site

On the other computer, launch a web browser, enter the public IP address of your computer, enter a colon (:), enter the Apache port number, and then press ↵ Enter. Your site should open.

For example, if your computer's public IP is 123.456.78.901 and your Apache port number is 81, enter 123.456.78.901:81 and press ↵ Enter

Advice

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

Popular by topic