In this lesson, we're going to cover two things, the basics of eye, which is a text that or you can
use from the terminal and setting up a Web server on Mac OS.
Now we're going to configure Apache, which is a built in Web server on Mac OS for the sole purpose
of hosting files to download in this course of Web server will be extensively used for file hosting
purposes using the web server.
We can figure here will allow you to follow along with the remainder of the course.
But in production, use a Linux or Windows based Web server not hosted on your machine and accessible
to all other Macs on your network.
If you have experience with V.I. and Web servers, feel free to skip the section.
All right, so what we're going to do is we're going to go ahead and use V.I. on this machine to create
a Web server on this virtual machine over here.
And this Web browser is on my personal machine, my admin machine, if you will.
So what we're going to do is we're going to use the V.I. Command, which is a text editor, to configure
the Apache Web server.
Now, if I go into a Web browser and I go to localhost, which is a name that represents the machine
I'm on, you can see that safari can connect to the Web server.
Now, I'm logged in as administrator and we're going to go ahead and we're going to type a command code
pseudo in pseudo means run his route or the super user of the computer, which is basically like elevated
permissions on windows.
That's the highest level access you can have to your machine.
And we're going to run a command called Apache Ctrl Start.
And then go ahead and put in your administrator password, and then if I hit refresh now, then you
can see I get this at work sign.
So that's really all it takes to get a patchy working, but it's not going to work in the way that we
want it.
So let's go ahead and stop the Web server, and I'm going to do what's called pseudo sue.
And if you watched the prompt over here, you'll see that it's going to change.
And now I'm basically everything I do is going to be with pseudo access.
There is a configuration file on the machine.
And so we're going to open it up in the text editor.
So we're going to type by and then ETSI, which is a folder where configuration files tend to be patchy
to which is for the Apache Web server.
And then we're going to open up the configuration file, which is called.
All right.
So go ahead and hit and turn.
It will open.
And then what we need to do is we need to set an option in this file.
So what I'm going to do is I'm going to search for the word option.
And to do that, I'm going to type forward slash and then type option and then I'm going to hit enter.
And then you can see that I'm on work called options, and if I hit and it's going to get me through
all the times it sees the word options and this is where I want to be and I'm going to move over to
where I am now, where I'm on the next word, and I'm going to hit I for insert.
And you can see it's put us in insert mode and I'm going to type the word indexes and space and now
I'm going to hit escape, which is going to take me out of insert mode and now I can move the keys around
freely again.
Now what index is does is it allows us to browse files and folders and we're going to see how that works
in a moment.
But we're not interested in Web content.
We're interested in seeing files and folders on our machine.
So the other thing that's important is document route and document route is basically where the Web
server gets its files from.
So I'm going to go ahead and copy this because we're going to need this path.
Now.
I'm going to go ahead and hit the Colin button, and the Colin button allows me to type in commands
and I'm going to type in the command WQ, which is going to save the changes I've made in the document.
OK, and so now we've basically configured the Web server and how we want it.
Now, what I want to do is I want to go into that document folder and so we're going to go into the
document folder and let's do a listing of that folder.
And you can see that it's showing me a file called Indexed HTML.
Now, let's go ahead and open that file.
So I'm going to buy into it.
And you can see here it says it works.
So that's how you know that we're in the that this is the file that brings this up and we're in the
right document folder.
So anything we put in here will be available on the Web server.
All right, so another thing that we need to be aware of is this and these are permissions and these
and this is the owner and the group owner of the files and folders in this server.
Now, we're not going to go deep into this because this isn't a Linux course.
But you do need to understand a couple of things because we're going to create a folder in this.
We're going to create a folder in this folder right now.
So I'm going to create a folder called Installs.
And the reason why I'm creating a folder called installs is because we're going to be hosting installation
files on our Web server.
Now, if I do a listing again.
You can see that my permission looks slightly different and installs is a directory, that's what the
D means, and I'm logged in his room and I've got read, write and execute permissions.
And then we all has read and execute and everybody else has read and execute well to make things simple
on us.
We're going to want everybody to be able to read and write into the installs folder.
So what we're going to do is we're going to change the permissions of the installs folder.
So what we're going to do is something called change mod or change mode and then hyphen R to recurse
seven seven seven and then installs.
Now I'm going to hit enter and we're going to do a listing again and you're going to see what happened.
So now basically every the owner, the group owner and everyone else has read and write permissions
to the installs folder.
What we're going to do now is we're going to make sure that our Apache server is running.
So I'm going to type of PacTel start.
And then I'm going to hit refresh and you see it's still working.
But we're not seeing our installs folder, so I'm going to go ahead and hit install.
And you can see we can see the contents of it.
All right.
Let's go ahead and do something that we did from the previous lesson.
Let's create a text file.
And so we're going to do touch and then installs and then we're going to create a text file called Testori
Text.
And then let's go ahead and echo test.
Into the installs test, text file.
All right, so now let's go ahead and refresh our or what page and you can see that it's in there and
it's going to open up and we have the words test in it.
All right, so we basically now have the ability to read and write files and see our files in the Web
server, which is really what we want.
So now we can go ahead and we can delete that file since we're not going to need it.
And it's gone.
All right, so let's go ahead and refresh the Web page, and you can see that our file is gone.
Now, we did this while logged in his route, but we're going to need permissions to write this to others.
And we had set that.
So let's just go ahead and make sure that it works.
So we're going to go ahead and we're going to open up a new terminal and we're going to go ahead now
that we're logged in as administrator or not.
Let's go to the same folder.
And then let's go ahead and create another file.
And we'll go ahead and make sure that it shows up and it does, and we're going to need access to this
Web server from all of our clients.
So to test access from your other clients, what you're going to do is type in cornford, flash forward
slash and then either the IP address or the hostname of the server that's running Apache.
So in my case, it's a one one python, one hundred one forward slash installs and you should see everything
being the same from one Web browser to another.
All right, so that's how you configure an Apache Web server on MapQuest for this course, and it's
going to be very important to understand how to access your Web server both through the Web browser
and through the file system.
All right, so as you just saw, if you type in your hostname forward slash installs, you're going
to get to your Web server.
And throughout these videos, my Web server simply has the host name of installs.
And so I'm going to access it through HTTP installs, forward slash installs.
Now in Scripps, we're going to be copying files to our Web server, my administration machine is not
my Web server, and what I've done is I've mounted a SMB share.
To the installed holder, my remote Web server, so I'm going to be copying files to forward slash volumes,
forward slash installs.
Now, if you've installed Apache on the Mac OS system that you're going to be administrating from,
then just like in the demo, you are going to be copying your files to a library, web server, documents,
installs.