Webserver Image Displaying

Hello everyone,

I am an intern programmer at the age of 17, doing an educational unpaid full time internship where I have to work for 70 or so hours. While at my internship, I was introduced to the beagle bone black as my main project while interning here at the science and engineering firm. My project is to re-create a silver light web-server, but with the beagle bone black in a non windows version that could be used more efficiently.

My issue currently, is displaying images on my web server that is currently being hosted by my Beagle Bone Black. I am using lighttpd, and for my web server I basically followed the beginning of this guide following the Setup step http://www.element14.com/community/community/knode/single-board_computers/next-gen_beaglebone/blog/2013/11/20/beaglebone-web-server–setup . Anyways, I have a web server hosted, and one of my next goals is to try and display simple images onto the web server, but so far no hope.

I have the web server recognizing images are trying to be displayed, but the error for the images is: 404 not found. I am very new, so I am still very clueless as to what I should do in going about further with the issue I am having…

I used the text editor and code just like this with my putty.

vi /www/pages/test.php

Then in the text editor:

`

Test <?php print("Connection Test."); ?> <?php echo ""; ?>

`

I’d love to hear your feedback on my issue, I so far am really enjoying the Beagle Bone Black, and want to learn more about it, but after countless searches I still can’t seem to figure out what it is that I am doing wrong here.

Thanks

For this to work , you need to have a file image.jpg in the same
directory as the php script; the file has to be readable to the
'world' or to the user/group under which the lighttpd process runs.

I had a hunch it was that…

Any tips for going about doing that?

Well, what can I assume about your situation? You need to copy the
jpeg file from somewhere else to your BBB's web directory, which you
must know because you're editing the .php file there. Check the
permissions using the 'ls -l' command; it should look somehow like
this:

-rwxrw-r--. 1 ryan web 11520 Nov 14 2002 image.jpg

if it's not r..r..r.. then do 'chmod +r image.jpg'.

<?php echo ""; ?>

For this to work , you need to have a file image.jpg in the same
directory as the php script; the file has to be readable to the
‘world’ or to the user/group under which the lighttpd process runs.

I had a hunch it was that…

Any tips for going about doing that?

Start by reviewing the training material on free-electrons.com or buy a book on using Linux. Specifically, you should review the Linux command line docs:

http://free-electrons.com/docs/command-line/

Regards,
John

there are simple and useful tools to help you, like
http://winscp.net/eng/index.php
but still some basic understanding of what you’re doing is required.

good luck,
Jan

Hello Ryan,

As the first post under your said, this is a pathing issue and image.jpg must be in the directory your script is in as your code stands. However, this is not necessarily a good way to go about things.

Let say for example you had a project directory called Project. In this directory you have two other directories called scripts, and images. For the above code in this situation to work you would need something like

<?php echo ""; ?>

traverses back up one directory level. Putting you into the directory project. Then the rest should be obvious. Now while this is not absolutely necessary to function, it is probably a very good diea to keep your scripts, and image directories separate. Security being the foremost reason in my own mind, but later, you may even need public, and private image directories. Depending on what you’re trying to achieve.

So I would recommend that you find a good book on Linux first, then secondly find a good book on php. Perhaps even brush up some on html as well, since relative paths are kind of a basic concept. The good news is most of if not all of this material can be had free online.

Thanks for all the help, I’ll see what I can do

Thanks for all the help, I’ll see what I can do

Why do you need SilverLight web server?