element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Single-Board Computers
  • Products
  • Dev Tools
  • Single-Board Computers
  • More
  • Cancel
Single-Board Computers
Forum What WEB Server is running on the BBB out of the box?
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Single-Board Computers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 21 replies
  • Subscribers 58 subscribers
  • Views 2250 views
  • Users 0 members are here
  • Black
  • beagle
  • bone
Related

What WEB Server is running on the BBB out of the box?

Former Member
Former Member over 11 years ago

When I attach my BBB to my computer, I can view 'flash drive' WEB pages from the mounted BBB. For this to happen, no WEB Server is required as my computers browser is just reading the various web files needed to view the content as a "web page".  However, if I browse onto the BBB from my network via the ip my router's DHCP has assigned to it, (or from the USB RNDS wired connection), the BBB spits out WEB pages.  What server is running on the BBB to do this.  I have looked at the processes running on the BBB with TOP and systemctl.  I see nothing that indicates what's going on.  I was expecting Apache or Lighttpd or something similar.

 

What I'm really trying to do is find out where I can put my own custom Web pages on the BBB so that it can serve up my own content.  I've found Blog postings where people have installed a Web server on the BBB, but I don't think this is really required as it already seems to be doing a good job with its own content. Any pointers or links would be greatly appreciated.

  • Sign in to reply
  • Cancel

Top Replies

  • mconners
    mconners over 11 years ago in reply to Former Member +2
    Here is a good intro to some node packages that serve up static content http://www.sitepoint.com/serving-static-files-with-node-js/ Mike
  • shabaz
    0 shabaz over 11 years ago in reply to Former Member

    The example code pasted above is close to what you need. Personally I start up a separate instance using node, and have it listen on a different port. That way I don't need to touch the existing code and can start from a clean slate.

    If you want to see an example of that, see this code. You'll see in the index.js file what I did to provide web server capability (but on a different port, 8081 in my case).

    If you want to modify the existing server, that should be possible, but I've not had a need to attempt it so far.

     

    EDIT: edited to add a more direct link.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to shabaz

    Cool.  More her than my simple needs to spit out my own web page.

     

    How did you associate your code with http://xx.xx.xx.xx:8081/index.html

    Did the "npm install socket.io" command set up the path to your files at 8081?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to shabaz

    I see you changed your link.  I was lucky enough to see the original to:

    Building a Frequency Synthesiser

     

    The new link takes me to the code directly but deprives everyone from seeing your really cool project.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 11 years ago in reply to Former Member

    Hi Mark,

     

    The index.js file uses an 'app.listen(8081)' command to set that (unlike a web server like Apache, there is no config files and all behavior has to be programmed, in this case it is programmed in the index.js file). You won't need the socket.io stuff, just lines 1-33 of the code should work fine (you can delete line 4). Also, delete line 21 which forces all requests in my case to always respond with a single file index.html.

    With those changes, the code should be close to what you need.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to shabaz

    Thanks Shabaz,

     

    I'll play with a smaller version of this and see what I can come up with.  Thanks for all the help.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 11 years ago in reply to Former Member

    Hi Mark,

    No problem, let us know if it works out.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mconners
    0 mconners over 11 years ago in reply to Former Member

    Here is a good intro to some node packages that serve up static content

     

    http://www.sitepoint.com/serving-static-files-with-node-js/

     

    Mike

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to mconners

    Well it took way too long, but I finally found the files.

     

    I guess most of the Linux users here are thinking, "Yeah. Duhh.  What took you so long"? Not being too familiar with either Linux or HTML, it was a challenge for me.  Anyway to finish the thread, they're here:

     

    root@beaglebone:/usr/share/bone101/Support#

    ls

    BoneScript  bone101

     

    The various WEB pages aren't as "flat" as I had expected.  Files are spread out in the various sub folders depending on where you are going on the WEB page.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to mconners

    Thanks Michael, that's exactly what I was looking for.  I wonder why those are left to a third party, not given as obvious examples in the docs.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mconners
    0 mconners over 11 years ago in reply to Former Member

    selsinork wrote:

     

    Thanks Michael, that's exactly what I was looking for.  I wonder why those are left to a third party, not given as obvious examples in the docs.

     

    You mean in the node.js docs? I don't know why. It does seem like it would be helpful to point out a more sophisticated implementation. Of course it's possible that at the time the docs were written they hadn't quite figured out a good way to serve static content, and by the time they figured it out, third party implementations were available.

     

    Mike

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
<>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube