• Like
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.



Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. APACHE
    • Apache install
    • 2. Apache uninstall
    • 3. Apache configure
    • 4. Apache setup
    • You will have a binary file called httpd in the src directory. A binary distribution of Apache will supply this file.
    • 6. The next step is to install the program and configure it.
    • 7. Apache is designed to be configured and run from the same set of directories where it is compiled.
    • 8. If you want to run it from somewhere else, make a directory and copy the conf, logs and icons directories into it.
    • 9. The next step is to edit the configuration files for the server.
    • 10. This consists of setting up various directives in up to three central configuration files. By default, these files are located in the conf directory and are called srm.conf, access.conf and httpd.conf.
    • To help you get started there are same files in the conf directory of the distribution, called srm.conf-dist, access.conf-dist and httpd.conf-dist. Copy or rename these files to the names without the -dist.
    • 12. Then edit each of the files. Read the comments in each file carefully.
    • 13. Failure to setup these files correctly could lead to your server not working or being insecure.
    • 14. You should also have an additional file in the conf directory called mime.types. This file usually does not need editing.
    • 15. First edit httpd.conf. This sets up general attributes about the server:
    • 16. the port number, the user it runs as, etc. Next edit the srm.conf file; this sets up the root of the document tree, special functions like server-parsed HTML or internal imagemap parsing, etc. Finally, edit the access.conf file to at least set the base cases of access.
    • In addition to these three files, the server behavior can be configured on a directory-by-directory basis by using .htaccess files in directories accessed by the server.
    • 18. Code:yum install httpd
    • 19. Code:yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel
    • REMOVE apache:
    • 21. to remove apache, there are serveral way these are the ways i know
    • 22. OPTION 1: Run this command if you installed apache with RPM or throug the automatic option during the Fedora/Red Hat OS installation.
    • 23. code:yum remove httpd
    • 24. OPTION 2: Run
    • 25. code:/etc/init.d/httpd stop
    • 26. to get the package name. It should come back with something like this:
    • 27. Code:apachecfg-0.3.1-6
    • 28. apache-1.2.5-1
    • You can then use this command to remove Apache:
    • 30. Code:rpm -e apache-1.2.5-1
    • 31. OPTION 3. If you compiled apache on your own. If you did a manual install then just delete /usr/local/apache (or wherever it is installed).
    • 32. OPTION 4. f you are doing it manually then to remove Apache from your Linux server, enter this line at the Linux command prompt:
    • 33. Code:rm -rf /usr/local/apache2
    • 34. OPTION 5: To find files by name try "locate"; it will force you to run updatedb the first time.
    • 35. To find packages that are installed try
    • 36. rpm -qa *apache* *mysql*
    • 37. { note "rpm -qa" lists all installed packages }
    • On mthis system:
    • 39. Code:
    • 40. [root@foo ~]# rpm -qa *apache* *mysql*
    • 41. ant-apache-resolver-1.6.5-2jpp.2
    • 42. koffice-kexi-driver-mysql-1.6.1-4.fc6
    • 43. mysql-server-5.0.27-1.fc6
    • 44. ant-apache-log4j-1.6.5-2jpp.2
    • 45. mysql-bench-5.0.27-1.fc6
    • 46. mysql-connector-odbc-3.51.12-2.2
    • 47. apachetop-0.12.6-2.fc6
    • 48. ant-apache-oro-1.6.5-2jpp.2
    • mod_auth_mysql-3.0.0-3.1
    • 50. libdbi-dbd-mysql-0.8.1a-1.2.2
    • 51. mysql-5.0.27-1.fc6
    • 52. php-mysql-5.1.6-3.3.fc6
    • 53. ruby-mysql-2.7.1-2.fc6
    • 54. ant-apache-bcel-1.6.5-2jpp.2
    • 55. mysql-devel-5.0.27-1.fc6
    • To see what files are in a specifig package
    • 57. Code:
    • 58. [root@foo ~]# rpm -ql ant-apache-bcel
    • 59. /etc/ant.d/apache-bcel
    • 60. /usr/lib/gcj/ant
    • 61. /usr/lib/gcj/ant/ant-apache-bcel-1.6.5.jar.db
    • 62. /usr/lib/gcj/ant/ant-apache-bcel-1.6.5.jar.so
    • 63. /usr/share/java/ant/ant-apache-bcel-1.6.5.jar
    • 64. /usr/share/java/ant/ant-apache-bcel.jar
    • 65. /usr/share/java/ant/ant-jakarta-bcel.jar
  • 66. Apache Configuration httpd.conf walkthrough
  • 67. Prefork MPM Apache 1.3 and Apache 2.0 Prefork Each child handles one connection at a time Many children High memory requirements “ You’ll run out of memory before CPU”
  • 68. Prefork Directives (Apache 2.0) StartServers MinSpareServers MaxSpareServers MaxClients MaxRequestsPerChild
  • 69. Worker MPM Apache 2.0 and later Multithreaded within each child Dramatically reduced memory footprint Only a few children (fewer than prefork)
  • 70. Worker Directives MinSpareThreads MaxSpareThreads ThreadsPerChild MaxClients MaxRequestsPerChild
  • 71. KeepAlive Requests Persistent connections Multiple requests over one TCP socket Directives: KeepAlive MaxKeepAliveRequests KeepAliveTimeout
  • 72. Apache 2.0 Filters Greg Ames Jeff Trawick
  • 73. Agenda Why filters? Filter data structures and utilites An example Apache filter Filter types Configuration directives
  • 74. Agenda cont... Frequently used Apache filters Output filters Input filters Pitfalls ways to avoid them mod_ext_filter Debugging hints The big filter list
  • 75. Why filters? Same idea as Unix command line filters: ps ax | grep "apache.*httpd" | wc -l Allows independent, modular manipulations of HTTP data stream if a 1.3 CGI creates SSI or PHP tags, they aren't parsed CGI created SSI tags can be parsed in 2.0 possible Zend issue w/PHP at present
  • 76. The general idea
  • 77. Filter utilities and structures ap_register_[input|output]_filter creates ap_filter_rec_t ap_add_[input|output]_filter[_handle] creates ap_filter_t ap_pass_brigade passes a bucket brigade to the next output filter ap_get_brigade gets a bucket brigade from the next input filter
  • 78.