Skip to content

Instantly share code, notes, and snippets.

@saravankumarpa
Forked from jgravois/_webserver.md
Created July 25, 2019 17:35
Show Gist options
  • Save saravankumarpa/255514357958aa2d70b46a80c4beae6f to your computer and use it in GitHub Desktop.
Save saravankumarpa/255514357958aa2d70b46a80c4beae6f to your computer and use it in GitHub Desktop.

Revisions

  1. @jgravois jgravois revised this gist Feb 20, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion _webserver.md
    Original file line number Diff line number Diff line change
    @@ -55,7 +55,7 @@ Python comes preinstalled on Macs (and is installed on Windows with ArcGIS Softw
    python -m http.server 1337
    ```

    2. now you should be able to access your own files via http://localhost/myfile.html:1337 in Chrome, Firefox or any other web browser.
    2. now you should be able to access your own files via http://localhost:1337/myfile.html in Chrome, Firefox or any other web browser.

    ```html
    <html>
  2. @jgravois jgravois revised this gist Apr 4, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion _webserver.md
    Original file line number Diff line number Diff line change
    @@ -86,6 +86,6 @@ Python comes preinstalled on Macs (and is installed on Windows with ArcGIS Softw
    ```
    http-server ./[yourfolder] -p 1337
    ```
    4. now you should be able to access your files (via something like http://localhost/myfile.html:1337) in a web browser.
    4. now you should be able to access your files (via something like http://localhost:1337/myfile.html) in a web browser.

    # thats it!
  3. @jgravois jgravois revised this gist Jan 12, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions _webserver.md
    Original file line number Diff line number Diff line change
    @@ -46,13 +46,15 @@ you don't **need** a *why*, but here are a couple:
    Python comes preinstalled on Macs (and is installed on Windows with ArcGIS Software) so it's [SimpleHTTPServer](https://docs.python.org/2/library/simplehttpserver.html) module is an **excellent** choice.

    1. navigate into the folder where you plan on saving your `.html` files (using terminal/cmd) and execute the following command:

    ```python
    python -m SimpleHTTPServer 1337
    ```
    if you're using Python 3.x or higher, you'd use
    ```python
    python -m http.server 1337
    ```

    2. now you should be able to access your own files via http://localhost/myfile.html:1337 in Chrome, Firefox or any other web browser.

    ```html
  4. @jgravois jgravois revised this gist Jan 12, 2016. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions _webserver.md
    Original file line number Diff line number Diff line change
    @@ -46,13 +46,13 @@ you don't **need** a *why*, but here are a couple:
    Python comes preinstalled on Macs (and is installed on Windows with ArcGIS Software) so it's [SimpleHTTPServer](https://docs.python.org/2/library/simplehttpserver.html) module is an **excellent** choice.

    1. navigate into the folder where you plan on saving your `.html` files (using terminal/cmd) and execute the following command:
    ```python
    python -m SimpleHTTPServer 1337
    ```
    if you're using Python 3.x or higher, you'd use
    ```python
    python -m http.server 1337
    ```
    ```python
    python -m SimpleHTTPServer 1337
    ```
    if you're using Python 3.x or higher, you'd use
    ```python
    python -m http.server 1337
    ```
    2. now you should be able to access your own files via http://localhost/myfile.html:1337 in Chrome, Firefox or any other web browser.

    ```html
  5. @jgravois jgravois revised this gist Jan 12, 2016. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions _webserver.md
    Original file line number Diff line number Diff line change
    @@ -46,13 +46,13 @@ you don't **need** a *why*, but here are a couple:
    Python comes preinstalled on Macs (and is installed on Windows with ArcGIS Software) so it's [SimpleHTTPServer](https://docs.python.org/2/library/simplehttpserver.html) module is an **excellent** choice.

    1. navigate into the folder where you plan on saving your `.html` files (using terminal/cmd) and execute the following command:
    ```python
    python -m SimpleHTTPServer 1337
    ```
    if you're using Python 3.x or higher, you'd use
    ```python
    python -m http.server 1337
    ```
    ```python
    python -m SimpleHTTPServer 1337
    ```
    if you're using Python 3.x or higher, you'd use
    ```python
    python -m http.server 1337
    ```
    2. now you should be able to access your own files via http://localhost/myfile.html:1337 in Chrome, Firefox or any other web browser.

    ```html
  6. @jgravois jgravois revised this gist Jan 12, 2016. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions _webserver.md
    Original file line number Diff line number Diff line change
    @@ -46,10 +46,12 @@ you don't **need** a *why*, but here are a couple:
    Python comes preinstalled on Macs (and is installed on Windows with ArcGIS Software) so it's [SimpleHTTPServer](https://docs.python.org/2/library/simplehttpserver.html) module is an **excellent** choice.

    1. navigate into the folder where you plan on saving your `.html` files (using terminal/cmd) and execute the following command:
    ```python
    python -m SimpleHTTPServer 1337
    ```
    python -m SimpleHTTPServer 1337 // python 2.x
    // or
    python -m http.server 1337 // python 3.x
    if you're using Python 3.x or higher, you'd use
    ```python
    python -m http.server 1337
    ```
    2. now you should be able to access your own files via http://localhost/myfile.html:1337 in Chrome, Firefox or any other web browser.

  7. @jgravois jgravois revised this gist Jan 12, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion _webserver.md
    Original file line number Diff line number Diff line change
    @@ -47,7 +47,9 @@ Python comes preinstalled on Macs (and is installed on Windows with ArcGIS Softw

    1. navigate into the folder where you plan on saving your `.html` files (using terminal/cmd) and execute the following command:
    ```
    python -m SimpleHTTPServer 1337
    python -m SimpleHTTPServer 1337 // python 2.x
    // or
    python -m http.server 1337 // python 3.x
    ```
    2. now you should be able to access your own files via http://localhost/myfile.html:1337 in Chrome, Firefox or any other web browser.

  8. @jgravois jgravois revised this gist Sep 28, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion _webserver.md
    Original file line number Diff line number Diff line change
    @@ -63,7 +63,7 @@ python -m SimpleHTTPServer 1337

    ### http-server (for Node)

    Node.js gets more popular by the day, so if you already have it installed (or don't mind taking two minutes to do it now) the module http-server is a **really** good choice too.
    [Node.js](https://nodejs.org) gets more popular by the day, so if you already have it installed (or don't mind taking two minutes to do it now) the npm module [`http-server`](https://www.npmjs.com/package/http-server) is a **really** good choice too.

    ![using http-server](https://gist.github.com/jgravois/5e73b56fa7756fd00b89/raw/1ec60e0e598305b2b5dfe6071c1281431041fb17/node.png "http-server")

  9. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion _webserver.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    ___

    having a web server turned on doesn't necessarily mean you are serving pages on the world wide web. its what allows you to load static files (`.html`, `.js` etc.) on your own computer via `http://` in a browser.
    having a web server turned on doesn't necessarily mean you are serving pages on the world wide web. its what allows you to load your own static files (`.html`, `.js` etc.) in a browser via `http://`.

    if you're not sure whether or not you have a web server running, no problem! its easy to confirm.

  10. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion _webserver.md
    Original file line number Diff line number Diff line change
    @@ -67,7 +67,7 @@ Node.js gets more popular by the day, so if you already have it installed (or do

    ![using http-server](https://gist.github.com/jgravois/5e73b56fa7756fd00b89/raw/1ec60e0e598305b2b5dfe6071c1281431041fb17/node.png "http-server")

    1. if node isn't already installed, visit the site below and lay it down
    1. if you haven't already installed Node.js, visit the site below and lay it down

    https://nodejs.org/en/download/

  11. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions _webserver.md
    Original file line number Diff line number Diff line change
    @@ -51,6 +51,14 @@ python -m SimpleHTTPServer 1337
    ```
    2. now you should be able to access your own files via http://localhost/myfile.html:1337 in Chrome, Firefox or any other web browser.

    ```html
    <html>
    <body>
    <h1>i'm web serving!</h1>
    </body>
    </html>
    ```

    ![hello world](https://gist.github.com/jgravois/5e73b56fa7756fd00b89/raw/053ea5a0b141e7b53fa14ebce8f6f2d14292ab2a/hello.png "hello world")

    ### http-server (for Node)
  12. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion _webserver.md
    Original file line number Diff line number Diff line change
    @@ -51,7 +51,7 @@ python -m SimpleHTTPServer 1337
    ```
    2. now you should be able to access your own files via http://localhost/myfile.html:1337 in Chrome, Firefox or any other web browser.

    ![hello world](https://gist.github.com/jgravois/5e73b56fa7756fd00b89/raw/1ec60e0e598305b2b5dfe6071c1281431041fb17/hello.png "hello world")
    ![hello world](https://gist.github.com/jgravois/5e73b56fa7756fd00b89/raw/053ea5a0b141e7b53fa14ebce8f6f2d14292ab2a/hello.png "hello world")

    ### http-server (for Node)

  13. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions _webserver.md
    Original file line number Diff line number Diff line change
    @@ -51,6 +51,8 @@ python -m SimpleHTTPServer 1337
    ```
    2. now you should be able to access your own files via http://localhost/myfile.html:1337 in Chrome, Firefox or any other web browser.

    ![hello world](https://gist.github.com/jgravois/5e73b56fa7756fd00b89/raw/1ec60e0e598305b2b5dfe6071c1281431041fb17/hello.png "hello world")

    ### http-server (for Node)

    Node.js gets more popular by the day, so if you already have it installed (or don't mind taking two minutes to do it now) the module http-server is a **really** good choice too.
  14. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 0 additions and 0 deletions.
    Binary file added hello.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  15. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions _webserver.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,8 @@ the most popular web server software for microsoft computers is **IIS**. if its

    https://msdn.microsoft.com/en-us/library/ms181052(v=vs.80).aspx

    ![iis screenshot](https://www.digicert.com/images/support-images/iis7/iis7-install-4.gif "iis")

    afterward, save a `.html` file in `C:/inetpub/wwwroot` and try to access it via http://localhost/[myfile].html. if the page is served up, you're ready to roll.
    ## Mac

  16. @jgravois jgravois renamed this gist Sep 15, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  17. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webserver.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ python -m SimpleHTTPServer 1337

    Node.js gets more popular by the day, so if you already have it installed (or don't mind taking two minutes to do it now) the module http-server is a **really** good choice too.

    ![using http-server](./5e73b56fa7756fd00b89/node.png "http-server")
    ![using http-server](https://gist.github.com/jgravois/5e73b56fa7756fd00b89/raw/1ec60e0e598305b2b5dfe6071c1281431041fb17/node.png "http-server")

    1. if node isn't already installed, visit the site below and lay it down

  18. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webserver.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ python -m SimpleHTTPServer 1337

    Node.js gets more popular by the day, so if you already have it installed (or don't mind taking two minutes to do it now) the module http-server is a **really** good choice too.

    ![using http-server](./node.png "http-server")
    ![using http-server](./5e73b56fa7756fd00b89/node.png "http-server")

    1. if node isn't already installed, visit the site below and lay it down

  19. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webserver.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ python -m SimpleHTTPServer 1337

    Node.js gets more popular by the day, so if you already have it installed (or don't mind taking two minutes to do it now) the module http-server is a **really** good choice too.

    ![using http-server](node.png "http-server")
    ![using http-server](./node.png "http-server")

    1. if node isn't already installed, visit the site below and lay it down

  20. @jgravois jgravois revised this gist Sep 15, 2015. 2 changed files with 2 additions and 0 deletions.
    Binary file added node.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
    2 changes: 2 additions & 0 deletions webserver.md
    Original file line number Diff line number Diff line change
    @@ -53,6 +53,8 @@ python -m SimpleHTTPServer 1337

    Node.js gets more popular by the day, so if you already have it installed (or don't mind taking two minutes to do it now) the module http-server is a **really** good choice too.

    ![using http-server](node.png "http-server")

    1. if node isn't already installed, visit the site below and lay it down

    https://nodejs.org/en/download/
  21. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion webserver.md
    Original file line number Diff line number Diff line change
    @@ -61,7 +61,8 @@ Node.js gets more popular by the day, so if you already have it installed (or do
    ```
    npm install http-server -g
    ```
    3. run its command (specifying the folder you'd like to serve files from)
    3. run it using CLI (specifying the folder you'd like to serve files from)

    ```
    http-server ./[yourfolder] -p 1337
    ```
  22. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions webserver.md
    Original file line number Diff line number Diff line change
    @@ -55,16 +55,16 @@ Node.js gets more popular by the day, so if you already have it installed (or do

    1. if node isn't already installed, visit the site below and lay it down

    https://nodejs.org/en/download/
    https://nodejs.org/en/download/

    2. next, open terminal or cmd and install the `http-server` module globally on your machine
    ```
    npm install http-server -g
    ```
    ```
    npm install http-server -g
    ```
    3. run its command (specifying the folder you'd like to serve files from)
    ```
    http-server ./[yourfolder] -p 1337
    ```
    ```
    http-server ./[yourfolder] -p 1337
    ```
    4. now you should be able to access your files (via something like http://localhost/myfile.html:1337) in a web browser.

    # thats it!
  23. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions webserver.md
    Original file line number Diff line number Diff line change
    @@ -56,6 +56,7 @@ Node.js gets more popular by the day, so if you already have it installed (or do
    1. if node isn't already installed, visit the site below and lay it down

    https://nodejs.org/en/download/

    2. next, open terminal or cmd and install the `http-server` module globally on your machine
    ```
    npm install http-server -g
  24. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions webserver.md
    Original file line number Diff line number Diff line change
    @@ -47,11 +47,11 @@ Python comes preinstalled on Macs (and is installed on Windows with ArcGIS Softw
    ```
    python -m SimpleHTTPServer 1337
    ```
    2. now you should be able to access your own file via http://localhost/myfile.html:1337 in a web browser.
    2. now you should be able to access your own files via http://localhost/myfile.html:1337 in Chrome, Firefox or any other web browser.

    ### http-server (for Node)

    Node gets more popular by the day, so if you already have it installed (or don't mind taking two minutes to do it now) the module http-server is a **really** good choice too.
    Node.js gets more popular by the day, so if you already have it installed (or don't mind taking two minutes to do it now) the module http-server is a **really** good choice too.

    1. if node isn't already installed, visit the site below and lay it down

    @@ -64,6 +64,6 @@ npm install http-server -g
    ```
    http-server ./[yourfolder] -p 1337
    ```
    4. now you should be able to access your own file via http://localhost/myfile.html:1337 in a web browser.
    4. now you should be able to access your files (via something like http://localhost/myfile.html:1337) in a web browser.

    # thats it!
  25. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions webserver.md
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,8 @@ if you're not sure whether or not you have a web server running, no problem! it
    if you're looking at a webpage, **great**!
    you're done.

    # What if i don't?

    ## Windows

    the most popular web server software for microsoft computers is **IIS**. if its not already running, you can follow the instructions below to get things set up.
  26. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webserver.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ ___

    having a web server turned on doesn't necessarily mean you are serving pages on the world wide web. its what allows you to load static files (`.html`, `.js` etc.) on your own computer via `http://` in a browser.

    if you're not sure whether or not you have one running, no problem! its easy to confirm.
    if you're not sure whether or not you have a web server running, no problem! its easy to confirm.

    ### what happens when you visit [http://localhost/](http://localhost/)?

  27. @jgravois jgravois revised this gist Sep 15, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions webserver.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    ___

    having a web server turned on doesn't mean you are serving pages to the public, only that you can debug your own work locally.
    having a web server turned on doesn't necessarily mean you are serving pages on the world wide web. its what allows you to load static files (`.html`, `.js` etc.) on your own computer via `http://` in a browser.

    if you're not sure whether or not you have one running, no problem! its easy to confirm.

    @@ -17,14 +17,14 @@ the most popular web server software for microsoft computers is **IIS**. if its

    https://msdn.microsoft.com/en-us/library/ms181052(v=vs.80).aspx

    afterward, save a `.html` file in `C:/inetpub/wwwroot` and try to access it via http://localhost/[myfile].html to make sure you're ready to roll.
    afterward, save a `.html` file in `C:/inetpub/wwwroot` and try to access it via http://localhost/[myfile].html. if the page is served up, you're ready to roll.
    ## Mac

    **Apache** comes preinstalled on Apple computers. If its not running, you can follow the instructions below to get it turned on.

    http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/

    afterward, save a `.html` file in `~/Users/[yourlogin]/Sites/` and try to access it via http://localhost/~[yourlogin]/myfile.html to make sure all is well.
    afterward, save a `.html` file in `~/Users/[yourlogin]/Sites/` and try to access it via http://localhost/~[yourlogin]/myfile.html. if you can view the content, all is well.
    ___

    :musical_note: interlude :musical_note:
  28. @jgravois jgravois revised this gist Sep 14, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webserver.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ ___

    having a web server turned on doesn't mean you are serving pages to the public, only that you can debug your own work locally.

    if you don't know, no problem! the easiest way to confirm is:
    if you're not sure whether or not you have one running, no problem! its easy to confirm.

    ### what happens when you visit [http://localhost/](http://localhost/)?

  29. @jgravois jgravois revised this gist Sep 14, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webserver.md
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ afterward, save a `.html` file in `C:/inetpub/wwwroot` and try to access it via

    http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/

    afterward, save a `.html` file in `~/Users/[yourlogin]/Sites/` and try to access it via http://localhost/~[you]/myfile.html to make sure all is well.
    afterward, save a `.html` file in `~/Users/[yourlogin]/Sites/` and try to access it via http://localhost/~[yourlogin]/myfile.html to make sure all is well.
    ___

    :musical_note: interlude :musical_note:
  30. @jgravois jgravois revised this gist Sep 14, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webserver.md
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ afterward, save a `.html` file in `C:/inetpub/wwwroot` and try to access it via

    http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/

    afterward, save a `.html` file in `~/Users/[you]/Sites/` and try to access it via http://localhost/~[you]/myfile.html to make sure all is well.
    afterward, save a `.html` file in `~/Users/[yourlogin]/Sites/` and try to access it via http://localhost/~[you]/myfile.html to make sure all is well.
    ___

    :musical_note: interlude :musical_note: