 Okay, so I have a second channel as many of you probably know That mainly focuses on hardware where this channel I'm trying to primarily focus on software sometimes those things overlap though I'm doing a series currently where I'm getting serial connections into small arm devices routers modems such as that and so far I'm working with a pogo plug device, which is very very cheap And I'm using a pogo plug mobile which has been discontinued and get them for seven bucks on Amazon currently shipped to your house So we've got a Connection that I'm actually connected in through the network to it now because we set up real connections to it and The main point of a pogo plug device is that it has USB and SD card slots To where you can use it for file storage and normally you would use the pogo plug service So you basically it's a cloud at your house That is using services online so that you have basically your own cloud at home But we don't want to be dependent on their services the pogo plug services So in previous videos, which are done on my second channel, which there should be a link in the description of this to a full playlist So basically I'm this is part of a playlist for my second channel that I'm doing over here because it's mainly software related But we want to be able to share Files remotely so we're gonna set up a basic web server We already have in my last video set up busybox This is something I've done on this channel before before I have my hardware channel Done hardware videos and I've talked a lot about busybox and setting up HTTPD One of the things I didn't go over them because I didn't know how then was setting up an index list For the files that we have so I can set up a web server But it wouldn't be like with a patch here something or even with Python simple HTTP You would go and it would give you a list of directories if there was no index files Well, how do you do that? With busybox and the answer is you create a CGI dash bin folder where you put your executable scripts And if you name one index dot CGI if there's not an index HTML file in the folder It will default to the CGI one well I've actually already have created a nice little looking one and put it up on github So let's go ahead and have a look at this so so far in this series. We've Mounted our USB and our SD card, so I'm gonna go ahead and go to my SD card now So again, I'm logged in remotely to my Pogo plug, so I'm gonna move into my empty MNT folder my SD card folder and here I have some files, but let's say I want to Share some of these files, so I'm gonna make a folder that will be my web directory on this device I was called at the BWW here on my SD card and move into that folder and in here I can say HTTP D which is using the busybox's built-in HTTP server and I'm gonna go You can tell what port you want. Well, let me hit enter. Oh, I guess I thought it would give me the help file So it basically I just started the web server in this folder already without giving any options So theoretically I should be able to go To my web browser here and refresh this and you can see it says file not found And that's because there's there's no files in there, but it definitely defined an index file So if I go back here, and I'll use vi and I'll create an index dot HTML and I'll just say hello Instead of hello world just because I'm lazy and I hit f5 here now. It's defaulting to that HTML file That's great, but let's say I have a bunch of files in here I just want to you know, I'll just touch a few touch one touch two Touch three I come back here It's still I'm just gonna see my oh in my hello folder or file and if I remove my index file I'm gonna get a file not found Well, again, we can create an index file by creating a CGI folder and putting an index dot CGI script in there That actually lists out stuff and again I've already created one and if you go to my github page Which is github.com forward slash metal x1000 also reminder in the description this video I have notes to everything I'm doing in this series with this pogo plug and notes to this part are also in there As well as links, but github.com forward slash middle x1000 will bring you to all my repositories currently have 115 apparently I just I throw everything online I go to repositories here, and I'm just gonna type in index and you'll find one It's called directory index for HTTPD and you'll see that it says directory index for busy boxes HTTPD And if you go in here, it basically has the license to read me a test folder Would just some basic little files and folders in it to test out and then we have our CGI File in here, and this is basically what looks like it basically generates some HTML code and Then it uses it's a shell script that basically lists all The files into that HTML code so basically there's some some shell script right in the middle of our HTML file here So you can look that over, but the way you use this if you just want to use it is You can go ahead and clone it or download a zip file as I mentioned in the previous video Currently we're running running busybox on this server, which has W get a W get that doesn't support SSL certificates So unfortunately, I can't download directly from this web server because it all forwards to SSL which is great HTTPS So what I did I just downloaded this file right here This index is Apache running on my desktop computer and right here this master file I'm pretty sure if I remember correctly is the file that I need to download that contains that project So let me go back To my pogo plug here. I am going to Back out and I'm just going to remove that that that directory I just created and now I'm going to say W get and I'm going to download that file from my desktop 192.168.1.150 Ford slash metal x 1000 Ford slash master zip Boom, I've downloaded it and now I just need to unzip master dot zip And it's created a directory called directory index For HTTP and we're just going to rename that we'll move that to be WWW and So now we have our WWW folder. I can move into WWW and list out and you can see it's that project. We just downloaded Also, if I PS you can see our HTTP server still running. I'm just going to kill that process Yes, again, make sure it's dead. Okay, so now that I'm inside my HTTP or my I'm sorry my WWW folder the folder. I want to be a web server again I just have to type in HTTP D and hit enter and My web server is back up and running and if I come here and I refresh I Get a nice little looking index of all the files and I can go in my test folder here and see there There's another directory here. I click on a picture and open up the picture So this is all running on the pogo plug If I come in here and I start creating new files, so I'll just touch one touch two touch three And I go back to my web directory here I can refresh and there are those files there They're empty and since they're not HTML files that just downloaded an empty file about let me create a new file I'll call it test.html Vi so I'm gonna use Vi which is a built-in text editor in busybox Similar to Vim and I am going to just say I'll make a hitter. I'll say hello world I'll save that and now if I go back to my web browser and refresh There it is test.html when I click it it brings me to that file So setting up a web server simple all you have to do is go into that folder type in HTTP D And you have a web server running if you want executable scripts You put them in a CGI folder and make scripts and make them executable If you want To have a directory index just download the file I created or just look at it and learn enough to make your own It's actually really really simple But that's it other things you might think want to think about is if we do HTTP D dash dash help me Help maybe there we go and there's also a good man file online if you just Google search busybox HTTP D the first thing that comes up will be Probably this open WRT wiki Tells you everything you need to know gives you example codes And I have videos on this as well if you just you know go to my website, which is films by Chris comm Go down to videos and type in HTTP D you can actually find a number of videos I have talking about this subject where I actually have this running on other little devices Where I go over Putting password password protecting your your server you can also put it on different ports So by default it's obviously gonna go to port 80 But you can do dash P and put it on another and you know more than one server running So actually let's do that. I'm going to back out and back out again And I'm going to go to my USB drive so we were just on my SD card now I want my USB drive so I come in here and I actually already put That index thing on here. I'm going here and I can go into my directory folder and I can HTTP D dash P and I'll say port 8000 now I go back to my web browser here So if I just type in the IP address to my device I get my index here that I can go through and look at all the different files But if I wanted to access the other one, I just change the port so I say colon eight zero zero zero I'll hit enter ha so now this is the stuff on my USB port my USB drive again. I can touch one two three And there they are So I can have I can have many many web servers. They're web servers as Especially this busy box one are so lightweight. I mean think about it It's part of the busy box binary and the entire binary which has All of these programs built into it It's only 1.1 megabytes for this compile of it Some compiles of it with all these in it are slightly less than a megabyte running web server is not Strainful on your smell security you have to keep in mind, but as far as System processes. I mean unless you're running Facebook or something if you just doing something for yourself co-workers or family It's nothing And you can start multiple instances and I can should be able to kill all HTTPd and my ps they they should all be dead now So if I try refreshing this that server doesn't exist if I remove the port number that one's killed as well But I can start them back up again now that we've done that we've done all this We want that web server to run every time we this the system starts up So if it gets rebooted for some reason we want to make sure that the web server starts up And if you watch the previous videos in this series if we go into etc Etc, however, you want to say it and it's dot D And then we can Vim. There's a file called. I'm sorry not Vim. I don't have them installed on here RCS capital S we'd enter down at the bottom here You can see that I've added in I have a line for My USB and also the line for my SD card I have that one coming out so I only have one server running the dash H So if you're in a folder and you run HTTPd it starts in that folder or you can specify Which folder you want to be the home folder for your web directory and so here in my startup script I'm just saying start up the web server by default on port 80 And make the home directory this and of course that's after I have already Mounted that directory which we went over in previous videos in this series So again, I'm doing this on a Pogo plug But if you have busy box with HTTPd on any device boom You can start up a web server no problem And if you have space to actually store files think about you know creating an index of course again looking at My github page in the description of this video again There's a link to all my notes on this project for everything and not just this video But all things in this series on the Pogo plug Check it out all the code and links and everything is there. I thank you for watching Please visit films by chris comm and of course That's a good place to look stuff up as I showed you right here You can search through all my videos if you like my videos thinking about supporting over at patreon.com That's patreon.com forward slash malex 1000. I appreciate even a dollar a month is helpful As always, I hope that you have a great day