Presentation is loading. Please wait.

Presentation is loading. Please wait.

Apache Web Server Administration Syed Iqbal Syed Iqbal.

Similar presentations


Presentation on theme: "Apache Web Server Administration Syed Iqbal Syed Iqbal."— Presentation transcript:

1 Apache Web Server Administration Syed Iqbal Syed Iqbal

2 Apache and its sister projects under development It is open source software environment It is open source software environment It costs nothing to obtain, performs better then its competitors, and more widely used. It costs nothing to obtain, performs better then its competitors, and more widely used. Sister projects under development Sister projects under development mod ssl mod ssl Apache SSL Apache SSL Java Apache Java Apache Module Registry Module Registry

3 Apache configuration files Httpd.conf: mainly used for server specific configuration Httpd.conf: mainly used for server specific configuration Access.conf: It contains the variables relating to access control Access.conf: It contains the variables relating to access control By default, all Apache configuration files are stored under the folder called conf By default, all Apache configuration files are stored under the folder called conf The specific variables inside the config files are called Directives The specific variables inside the config files are called Directives

4 More about Apache directives Almost everything about Apache resides under its directives. Almost everything about Apache resides under its directives. All the directives are stored under its module. Not all the module are recognized by Apache. If you want to find out what compiled-in module you currently have under apache, you can type in the following command: All the directives are stored under its module. Not all the module are recognized by Apache. If you want to find out what compiled-in module you currently have under apache, you can type in the following command: $httpd – I $httpd – I

5 MINE Types in Apache MINE is an acronym for Multimedia Internet Mail Extensions MINE is an acronym for Multimedia Internet Mail Extensions In Apache it is used to enable a program to determine what kind of data a file contains by looking at the file’s extensions. Apache’s mine types can be found in conf folder named as mime.type In Apache it is used to enable a program to determine what kind of data a file contains by looking at the file’s extensions. Apache’s mine types can be found in conf folder named as mime.type We can use the AddType directive to simply add a file extension. For example, in case of php: We can use the AddType directive to simply add a file extension. For example, in case of php: $ AddType application/x-httpd-php.php Above tells Apache that files ending in.php contains PHP 4 data

6 Protecting a secure data using Apache This can be done by invoking the following module: This can be done by invoking the following module: Order deny, allow Order deny, allow deny from all deny from all allow from 127.0.0.1 allow from 127.0.0.1

7 Explanation of previous module The first line tells you which location the secure data is residing The first line tells you which location the secure data is residing Order Deny, allow, deny from all: specifies a mod_access directive. If you want to give access to more hosts than you deny, use order allow, deny. In opposite case, we would use,’ order deny, all’ so that it would deny to most hosts order allow, deny. In opposite case, we would use,’ order deny, all’ so that it would deny to most hosts

8 Stopping Apache Apache can be stopped by using the following command (in freebsd systems): Apache can be stopped by using the following command (in freebsd systems): %apachectl stop /usr/virtual/share/pkgs/installed/vs- apache/1.3.12/bin/apachectl stop: httpd stopped Stopping Apache web server can cause some serious troubles including shutting down of a website. Meaning that a website will never get displayed neither via IP or domain name.

9 Restarting Apache Apache can be restarted in 2 ways Apache can be restarted in 2 ways 1) apachectl start 1) apachectl start [Tue Jul 16 09:48:31 2002] [warn] NameVirtualHost 216.122.250.221:443 has no VirtualHosts /usr/virtual/share/pkgs/installed/vs- apache/1.3.12/bin/apachectl start: httpd started

10 Continue %apachectl startssl %apachectl startssl [Tue Jul 16 09:53:13 2002] [warn] NameVirtualHost 216.122.250.221:443 has no VirtualHosts [Tue Jul 16 09:53:13 2002] [warn] NameVirtualHost 216.122.250.221:443 has no VirtualHosts /usr/virtual/share/pkgs/installed/vs- apache/1.3.12/bin/apachectl startssl: httpd started /usr/virtual/share/pkgs/installed/vs- apache/1.3.12/bin/apachectl startssl: httpd started

11 The difference between the 2 Apachectl start command only restarts the Apache web server Apachectl start command only restarts the Apache web server Apachect startssl not only restarts the server with SSL enable, but also tells the Apache to refresh any hosts that are SSL domains so that Apache can recognize them Apachect startssl not only restarts the server with SSL enable, but also tells the Apache to refresh any hosts that are SSL domains so that Apache can recognize them

12 Apache and its logs files In Freebsd and several other UNIX OS, Apache come up with log files. In Freebsd, there are 3 types of log files, access_logs and error_logs, and analog_logs In Freebsd and several other UNIX OS, Apache come up with log files. In Freebsd, there are 3 types of log files, access_logs and error_logs, and analog_logs Access logs basically tells you who access the server at what time and what date. Error_logs usually report to Apache if it encounters any error in the server. Analog_logs contains the record for ftp users. Access logs basically tells you who access the server at what time and what date. Error_logs usually report to Apache if it encounters any error in the server. Analog_logs contains the record for ftp users.

13 An issue with Apache log files If you mistakenly deleted a log file(since log files are tend to grow faster and cause disk space isses) using the rm command, it will cause to break Apache’s config file and Apache will not run! If you mistakenly deleted a log file(since log files are tend to grow faster and cause disk space isses) using the rm command, it will cause to break Apache’s config file and Apache will not run! To avoid this issue, you can simply restart the Apache web server and it will re-built the log file. OR you can use the following command to avoid this issue: To avoid this issue, you can simply restart the Apache web server and it will re-built the log file. OR you can use the following command to avoid this issue: > Cp /dev/null nameoflogfile

14 More on Cp /dev/null nameoflogfile This command would basically copy the size of a log file into a null value; leaving the log file as it is, but with no size. This command would basically copy the size of a log file into a null value; leaving the log file as it is, but with no size.

15 Using the ProxyBlock directive With the help of ProxyBlock directive in Apache, we can restrict sites we disapprove of. This can be done by: With the help of ProxyBlock directive in Apache, we can restrict sites we disapprove of. This can be done by: ProxyBlock domain.com domain1.com … ProxyBlock domain.com domain1.com …

16 SSI or server side includes SSI is a way to add a limited amount of dynamic content to your web pages. It is disable by default since it is known to slow down the Apache server. If SSI is limited to the files with a.shtml extension, you can use the AddHandler server- parsed.shtml directive. This directive tells the server to review any files with extensions in.shtml and perform SSL substitutions as appropriate before serving files to clients. SSI is a way to add a limited amount of dynamic content to your web pages. It is disable by default since it is known to slow down the Apache server. If SSI is limited to the files with a.shtml extension, you can use the AddHandler server- parsed.shtml directive. This directive tells the server to review any files with extensions in.shtml and perform SSL substitutions as appropriate before serving files to clients.

17 DNS and Apache Domain name service and Apache does have some relationship. In the following directive, avoid using symbolic names. Domain name service and Apache does have some relationship. In the following directive, avoid using symbolic names. Directive Setting Allow, deny use of IP only HostnameLookups should be set to off ProxyBlock, NoProxy use IP address only

18 Conclusion Apache web server has claimed the more then 70% of its market share as compare to its competitors. It widely used with the combination of other scripting languages like perl & CGI, php and java. It is very flexible when it comes to its functionality. With its open source capability, you can modify however you want. Apache web server has claimed the more then 70% of its market share as compare to its competitors. It widely used with the combination of other scripting languages like perl & CGI, php and java. It is very flexible when it comes to its functionality. With its open source capability, you can modify however you want.

19 Resources www.apache.org www.apache.orgwww.apache.org Apache: Web Server Administration & e-Commerce Handbook. Scott Hawkins. Prentice Hall PTR, 2001. Apache: Web Server Administration & e-Commerce Handbook. Scott Hawkins. Prentice Hall PTR, 2001.


Download ppt "Apache Web Server Administration Syed Iqbal Syed Iqbal."

Similar presentations


Ads by Google