-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Local server
Lauren McCarthy edited this page Nov 13, 2013
·
63 revisions
Some functionality (loading external files, for example) works as expected when the files are placed online via FTP. However, if you try to view them locally, you see some kind of "cross-origin" errors in console. The solution to this is to view them using what's called a local web server. This tutorial includes instructions for setting this up on Mac OSX and Windows.
###Mac OS X
Snow Leopard has a built in web server, all you have to do is enable it and place the files in the right place.
- Turn on the web server. In Snow Leopard, go into System Preferences > Sharing, and check the “Web Sharing” box. In Lion, Mountain Lion, or Maverick, open Terminal and type:
sudo apachectl start
- Enable permissions, type:
sudo chown root:<your username> -R /Library/WebServer/Documents
sudo chmod 755 -R /Library/WebServer/Documents
- Place your project somewhere inside /Library/WebServer/Documents/.
- View it at http://localhost.
###Windows
- Download WampServer from http://www.wampserver.com/en/.
- Install WampServer and follow instructions.
- The “www” directory will be automatically created (usually c:\wamp\www).
- Create a subdirectory in “www” and put your HTML/JS files inside.
- Open your internet browser and go to the URL : http://localhost/yourfile.html.
If you would like to edit this wiki and don't already have edit access, please open an issue or comment on an existing one noting the wiki page you'd like to edit. You will then be added as a repository contributor with edit access.