Published on

Published in: Technology
  • 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

No notes for slide


  1. 1. APACHE <ul><li>Apache install
  2. 2. Apache uninstall
  3. 3. Apache configure
  4. 4. Apache setup </li></ul>
  5. 5. APACHE INSTALL <ul><li>You will have a binary file called httpd in the src directory. A binary distribution of Apache will supply this file.
  6. 6. The next step is to install the program and configure it.
  7. 7. Apache is designed to be configured and run from the same set of directories where it is compiled.
  8. 8. If you want to run it from somewhere else, make a directory and copy the conf, logs and icons directories into it.
  9. 9. The next step is to edit the configuration files for the server.
  10. 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. </li></ul>
  11. 11. APACHE INSTALL <ul><li>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. 12. Then edit each of the files. Read the comments in each file carefully.
  13. 13. Failure to setup these files correctly could lead to your server not working or being insecure.
  14. 14. You should also have an additional file in the conf directory called mime.types. This file usually does not need editing.
  15. 15. First edit httpd.conf. This sets up general attributes about the server:
  16. 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. </li></ul>
  17. 17. APACHE INSTALL <ul><li>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. 18. Code:yum install httpd
  19. 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 </li></ul>
  20. 20. APACHE UNINSTALL <ul><li>REMOVE apache:
  21. 21. to remove apache, there are serveral way these are the ways i know
  22. 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. 23. code:yum remove httpd
  24. 24. OPTION 2: Run
  25. 25. code:/etc/init.d/httpd stop
  26. 26. to get the package name. It should come back with something like this:
  27. 27. Code:apachecfg-0.3.1-6
  28. 28. apache-1.2.5-1 </li></ul>
  29. 29. APACHE UNINSTALL <ul><li>You can then use this command to remove Apache:
  30. 30. Code:rpm -e apache-1.2.5-1
  31. 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. 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. 33. Code:rm -rf /usr/local/apache2
  34. 34. OPTION 5: To find files by name try &quot;locate&quot;; it will force you to run updatedb the first time.
  35. 35. To find packages that are installed try
  36. 36. rpm -qa *apache* *mysql*
  37. 37. { note &quot;rpm -qa&quot; lists all installed packages } </li></ul>
  38. 38. APACHE UNINSTALL <ul><li>On mthis system:
  39. 39. Code:
  40. 40. [root@foo ~]# rpm -qa *apache* *mysql*
  41. 41. ant-apache-resolver-1.6.5-2jpp.2
  42. 42. koffice-kexi-driver-mysql-1.6.1-4.fc6
  43. 43. mysql-server-5.0.27-1.fc6
  44. 44. ant-apache-log4j-1.6.5-2jpp.2
  45. 45. mysql-bench-5.0.27-1.fc6
  46. 46. mysql-connector-odbc-3.51.12-2.2
  47. 47. apachetop-0.12.6-2.fc6
  48. 48. ant-apache-oro-1.6.5-2jpp.2 </li></ul>
  49. 49. APACHE UNINSTALL <ul><li>mod_auth_mysql-3.0.0-3.1
  50. 50. libdbi-dbd-mysql-0.8.1a-1.2.2
  51. 51. mysql-5.0.27-1.fc6
  52. 52. php-mysql-5.1.6-3.3.fc6
  53. 53. ruby-mysql-2.7.1-2.fc6
  54. 54. ant-apache-bcel-1.6.5-2jpp.2
  55. 55. mysql-devel-5.0.27-1.fc6 </li></ul>
  56. 56. APACHE UNINSTALL <ul><li>To see what files are in a specifig package
  57. 57. Code:
  58. 58. [root@foo ~]# rpm -ql ant-apache-bcel
  59. 59. /etc/ant.d/apache-bcel
  60. 60. /usr/lib/gcj/ant
  61. 61. /usr/lib/gcj/ant/ant-apache-bcel-1.6.5.jar.db
  62. 62. /usr/lib/gcj/ant/
  63. 63. /usr/share/java/ant/ant-apache-bcel-1.6.5.jar
  64. 64. /usr/share/java/ant/ant-apache-bcel.jar
  65. 65. /usr/share/java/ant/ant-jakarta-bcel.jar </li></ul>
  66. 66. Apache Configuration httpd.conf walkthrough
  67. 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. 68. Prefork Directives (Apache 2.0) StartServers MinSpareServers MaxSpareServers MaxClients MaxRequestsPerChild
  69. 69. Worker MPM Apache 2.0 and later Multithreaded within each child Dramatically reduced memory footprint Only a few children (fewer than prefork)
  70. 70. Worker Directives MinSpareThreads MaxSpareThreads ThreadsPerChild MaxClients MaxRequestsPerChild
  71. 71. KeepAlive Requests Persistent connections Multiple requests over one TCP socket Directives: KeepAlive MaxKeepAliveRequests KeepAliveTimeout
  72. 72. Apache 2.0 Filters Greg Ames Jeff Trawick
  73. 73. Agenda Why filters? Filter data structures and utilites An example Apache filter Filter types Configuration directives
  74. 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. 75. Why filters? Same idea as Unix command line filters: ps ax | grep &quot;apache.*httpd&quot; | 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. 76. The general idea
  77. 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