Hello, hallow with information link here doing a video this is a patchy two for those of you haven’t seen my patchy one video I suggest you check it out. Were going to go over a couple of different things today, first thing were going to do is set up the directory index. So what I need you to do is go through patchy area, folder, get into the conf folder and the httpd.conf configuration file. At the font free loads so you can read the whole thing or most of it for that matter. And what were going to do were going set the directory in new switch means what comes up automatically as default.
This can be use as like a make shift way of disabling direct through those thing. So for example if we go to local host, this is what we have going on and it’s the directory. So for example if we wanted to take this particular file and make it some one you got a local host that only comes up the way we would do that is to go down here until we find the directory index, which is right down here and I have it set to index at html and .html this goes in order so if it doesn’t find this one it will look for this one, if this doesn’t find this one it will look for the next one etcetera.
So were going to give it something that it can find, I mention all this because I made the font big so you guys can actually see it so right up in here. So the bell logo patch so what we’ll do is we’ll save that, refresh, oh yes right, you have to restart the patchy service so those changes take effect. And there you go, when you go to local host this is file will automatically default. Now I mentioned earlier that this is done as a make shifts way to save in directory listing. But if you're going to do that anyway you may as well disable directory listing the correct way. The reason you would do this is because its stop hot linking, it doesn’t show all the files and that the directories on your server. I mean regardless of the security settings if there is not target and it’s all guess work for the directories and file names. You're going to have better security all together, so what you do is, just scroll up to the proper area. Checks I believe is under this modules and here it is here, options indexes, follow some links.
So hat you would so is negative on the indexes and then while I'm here I might as well talk to you about symlinks and give it to that too. That’s symbolic links I generally disable them if you're not using them. They can be used in a text there was this vulnerability where if you’ve got the UID over the patchy software you can overwrite files. Honestly, it’s short if you're using it, it’s probably best to kill it. And what this will do is now that I don’t have any index, well you know while I'm on this, since I don’t have any other things that are being called in the index because I'm about to delete the other one.
So I would find it, there it is. Now I want to use and start the server I shouldn’t let it do anything because none of this files exist at the moment. If you're look in my STDX folder, its just here have index one and index two none of them are index that each similar index that its CM, so when we bring out local host at this point it should give us in our test pop up again. There you go, so no more access to the directory, now if we were to add for example, if changes to index since that was being called and out of the file that should be able to come up and there it is.
All right, so now let's say a lot of it I've actually got a couple of questions from a bunch of people saying that they were having problems. They, they got a patchy working no problem everything was great but they didn’t have enough room on the drive that ht/docks folder here to specific web route that patchy sets up for you to put the files they wanted on. They wanted to use the USB drive or another drive, so I'm actually going to plug a USB stick in right now and we’ll going to use and serve that as a website. As a web directory, so one of this thing finally comes up here it is were going to open the folder to view files just so you can see what’s on it right off the back here we go and this is a J Drive.
So we do is at this point we’ll just take the J its fine and we will go back into our good old httpd.conf file and we will look and here we have a document—well were going to change this to J and were going to go down here and it finds directory again. Its in the directory, it says this should be changed whatever you set document route to since we just set change document route to J it seem like a good idea to change that as well, so change that. Now up here you have these directories, so you have to add the directory in and I’ll do one space. You can see what I'm doing, if I could spell right, directory and then you put in the location of the directory then you have to give it the options. So first thing we do is to give it the order, can't spell it all today.
And were going to allow then deny then were going to allow for more, so we can all see it and then were going to end the directory. Okay, and ones you save that, save we will start of patchy we start. I've finally screwed something else somewhere. Give me one second, I'm not sure what I did wrong, let's try this. Nope, maybe it has to be capitalized, try that, I’ll just try without the slash, I don’t know interesting. Okay, so at this point I took the slash out of the document root and the slash out of the directory. And I saved it and restarted the server and actually started which means that’s how you do it, so at this point if we go to local host it should show the same files that were in this J Drive here. So let's say we have, oh, yes the reason we don’t have access is because we have disabled directory listings.
So if we go down here and we look around, here it is if we delete this and allow the directory listing, you should be able to see what’s on that drive. I forgot all about that, and there we go. While I'm at it I got a couple more seconds, okay while were on it I have a couple of seconds so I'm going to show you one more thing very quick which is custom errors, it’s a very simple just go down and look for custom errors down here, here we are over documents. So example of 404, okay we happened to know that there is no index on that because otherwise it would have came up in this J drive. So I'm going to do is I'm going to make on here some new text documents and what’s in this, nothing great. I'm just going to make a quick html page, this is an error done and we’ll going to name it missing that html I want to save it right in there save done. This way it matches this here were going to uncomment this, so now it’s live. Were going to save it, save, were going to restart the server, restart and then were going to call something we know doesn’t exist, so I'm just going to make something silly, .html because we know that that doesn’t exist and it should show up with our costume error which it has, this is hallow from information link I'm flying through this at this point, I hope you enjoyed the tutorial so far. I was going to do a little thing on html but there is many more comprehensive tutorials out there that can do a far but I've tried on explaining and then I can in general level on a couple of minutes. Anyway I hope you enjoy this tutorial until next time.
Transcription by:
Scribe4you Transcription Services