A website host can be set up on your personal computer. This can be done on either a Windows or Mac supported computer or laptop by using a server called MAMP. First a few steps should be undertaken to ensure that your laptop is ready to host a website.
The below steps can be followed to host a website:
Setting up hosting on Windows
-
Double-click the MAMP setup icon. It looks like a white elephant on a grey background.
-
Click Yes when prompted. This will open the MAMP installer.
-
Complete the setup process. To do so:
-
Select a language and click OK
-
Click Next
-
Uncheck the “MAMP PRO” box and click Next
-
Check “I accept” and click Next
-
Click Next three times, then click Install
-
Go to your website’s source code document. While MAMP is installing, find the document on your computer that you pasted the website’s source code into earlier. To do so:
-
Open Start Image titled Windowsstart.png
-
Open File Explorer Image titled Windowsstartexplorer.png
-
Click the document’s folder in File Explorer’s left-hand sidebar.
-
Select the document by clicking it.
-
Copy the source code document. Press Ctrl and C at the same time to copy the selected source code document.
-
Double-click the MAMP icon. It resembles a white elephant on a grey background.
-
Click OK when prompted. You’ll see a warning about port 80 appear; clicking OK on the warning window dismisses it.
-
Click Preferences…. The gear-shaped icon is on the left side of the MAMP window. Doing so opens the Preferences window.
-
Click the Ports tab. It’s at the top of the Preferences window.
-
Click Set MAMP ports to default. This button is in the middle of the page. Doing so will reset the ports that MAMP uses, which will resolve the port 80 error.
-
Click the Web Server tab. It’s at the top of the Preferences window.
-
Click Open. This button is near the bottom of the window.
-
Paste the source code document into the folder. Press Ctrl and V at the same time. The source code document will appear in the MAMP root folder.
-
Click OK on the MAMP window. This will save your settings.
-
Close and re-open MAMP. Click Quit in the bottom-left corner of the MAMP window, then double-click the MAMP icon to re-open MAMP.
-
Click Start Servers. It’s on the right side of the MAMP window. Doing so will start the MAMP server with your website’s source code and port preferences. Your website should now be live; people will be able to access it by entering your public IP address into a search engine.
Setting up Hosting on Mac
-
Double-click the MAMP setup file. It resembles a brown box.
-
Complete the MAMP installation process. To do so:
-
Click Continue on each of the first three pages.
-
Click Agree
-
Click Install for all users of this computer, then click Continue
-
Click Install
-
Enter your Mac’s username and password, then click Install Software
-
Wait for MAMP to finish installing. This process will likely take around five minutes.
-
Open Finder. Click the blue, face-shaped app in your Mac’s Dock.
-
Go to your website’s source code document. Click the folder in which the source code document that you copied or created earlier is located.
-
Copy the document. Click the document to select it, then click Edit and click Copy.
-
Click Applications. This folder is on the far-left side of the Finder window.
-
Double-click the MAMP folder. It’s in the middle of the Applications folder.
-
Double-click the htdocs folder. You’ll find this folder in the middle of the MAMP folder. This folder is where your website’s resources, including the source code document, go.
-
Paste the source code document into this folder. Click Edit, then click Paste Item.
-
Open MAMP. Click the MAMP icon, which resembles a white elephant on a grey background. You may have to type MAMP into Spotlight Image titled Macspotlight.png to find MAMP.
-
Click Preferences…. This gear-shaped icon is on the far-left side of the MAMP window.
-
Click the Ports tab. It’s at the top of the Preferences window.
-
Click the Set to default button. You’ll find this in the middle of the Ports tab. Doing so resets the ports that MAMP uses, which will prevent your website from being blocked by your router’s default firewall.
-
Click OK. It’s at the bottom of the page. This saves your settings.
-
Close and re-open MAMP. Click Quit, then click the MAMP icon again to re-open MAMP.
https://www.youtube.com/watch?v=Opbhg6foTy0
-
Click Start Servers. It’s on the right side of the MAMP window. Doing so will start the MAMP server with your website’s source code and port preferences. Your website should now be live; people will be able to access it by entering your public IP address into a search engine.
Unless you pay for a dynamic IP service, your local IP address and, by extension, your website’s address will change from time to time.
You cannot use your local IP address to view the website from your own network, since entering it will just take you to your router’s page.