Local Web Server

From Wikicliki
Revision as of 07:43, 23 November 2016 by WikiSysop (talk | contribs) (Created page with "Easiest way for Mac and Win is to use MAMP - https://www.mamp.info/en/ '''WINDOWS''' - MAMP: * Download the installer from https://www.mamp.info/en/downloads/ (300MB) - will...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Easiest way for Mac and Win is to use MAMP - https://www.mamp.info/en/

WINDOWS - MAMP:

  • Download the installer from https://www.mamp.info/en/downloads/ (300MB) - will have copy on thumbdrive in the class
  • Install it, unchecking ‘Install MAMP PRO in addition to MAMP’
  • By default it will install to C:\MAMP
  • Now start MAMP from the window start menu
  • Click on Start Servers
  • Click on ‘Open start page’
  • The page http://localhost/MAMP/ should now open up in your browser.
  • Default documents folder is usually C:\MAMP\htdocs

MAC - Fastest way is to use Python SimpleHTTPServer

  • All new Macs have Python installed. First open Terminal (Which can be found inside Applications > Utilities). Check which version of python you have by typing "python" into Terminal. Then navigate to the folder with your files inside it.
cd /path/to/project/folder 

Use Python's built-in http server:

# Python 2.x
python -m SimpleHTTPServer

# Python 3.x
python -m http.server

Files from that directory will be served up at localhost under port 8000, so you can view the files from that directory if you type this into the browser:

http://localhost:8000/