In this lesson, you will:
✶ Look up your IP address
✶ Type that address into your web browser
✶ Go to a directory in /root
✶ Check for a file
✶ Give yourself permission to access a directory
✶ Delete the Apache default page.
If you do not have a Linux environment set up,
visit: Setting up LAMP Lessons
To find your IP Address, type:
$ ifconfig
➼ ifconfig
Interface Configuration - Look up network info, including the IP address
(more on this in Intro to Linux)
Your IP address will be displayed like in the picture below.
If there are multiple IP addresses, write them all down. You can go through to see which one works.
Type the IP address, like you would type a regular web address. What do you see? Look at the 3 options below.
$ cd /var/www/html
➼ cd
Change directory
➼ /
Go back to the root directory.
➼ var
is a directory in the root directory.
➼ www
is a directory in var.
➼ html
is a directory in www. html is the directory that contains the default page,
index.html, that we have to delete.
Use the list command to check for index.html
$ ls
You should see a file called index.html listed.
Now you must give yourself permission to the html direcotry. You will do so by typing the
following command:
$ sudo chown -R `whoami` /var/www/html
➼ sudo
Used for administrative tasks
➼ chown
Change Owner - used to change the owner of a directory.
➼ -R
Recursive - You will have access to all the sudirectories and files inside of
/var/www/html
➼ `whoami`
Will write your username into the command
➼ /var/www/html
This is the directory we want access to.
Since you already cd'ed into /var/www/html, you could also type this:
$ sudo chown -R `whoami` pwd
➼ sudo
Used for administrative tasks
➼ chown
Change Owner - used to change the owner of a directory.
➼ -R
Recursive - You will have access to all the sudirectories and files inside of
/var/www/html
➼ `whoami`
Will write your username into the command
➼ pwd
Print Working Directory - It will insert the name of your current directory
into the command.
Type the following Command:
$ rm index.html
➼ rm
Delete
➼ index.html
File we want to delete
Once you start creating files and projects, you will see them listed on this page.