Day 15

8
Day 15 Apache

description

Day 15. Apache. Being a web server. Once your system is correctly connected to the network, you could be a web server. When you go to a web site such as http://www.cnn.com You are connecting to a machine which has web server software running on it. - PowerPoint PPT Presentation

Transcript of Day 15

Page 1: Day 15

Day 15

Apache

Page 2: Day 15

Being a web server• Once your system is correctly connected to the

network, you could be a web server.– When you go to a web site such as http://www.cnn.com– You are connecting to a machine which has web server

software running on it.• If the machine is running Windows, you are most likely talking

to IIS server.

• If it is running Unix of some form, you are most likely talking to Apache server.

• Netscape also makes web servers, many people use them also, they are available for both windows and Unix.

Page 3: Day 15

Apache• Apache is nothing more than a daemon which

listens on port TCP 80 for incoming requests.

• It then serves appropriate files from your hard drive in response to those requests.

Page 4: Day 15

Document Root• All web servers have a notion of a document root.

– This is the only place on the hard drive that users on the web can request documents from.

– This protect average files from being viewed across the internet.

– The web server will upon startup immediately run a chroot command to prevent itself from being tricked into looking at parts of the hard drive it doesn’t have permissions to.

Page 5: Day 15

Permissions• All files in the document root should probably be

world readable.– The apache daemon actually runs as a user [typically

“nobody”] and as long as that user has permission to view the files, they will be available on the web.

Page 6: Day 15

Starting/Stopping Apache• Apache runs as a regular process, just like anything

else.

• Usually called – httpd

• You could kill it, however you are advised to use the commands:– apache start– apache stop

• To start or stop it. This gives apache a chance to update some other stuff.

Page 7: Day 15

Configuring Apache• Apache will create a directory into which it will put

all its files:– Usually either:

• /usr/local/apache

• /var/httpd/

• In the directory, you will find a conf directory, and in there you will find a httpd.conf file.

• This is where all configuration options of Apache are set.

Page 8: Day 15

Apache logs.• The log files for apache are stored in

– /var/log/httpd/access.log– /var/log/httpd/errors.log

• These are rotated and removed as often as you tell it to.