Apache2 BootCamp : Getting Started With Apache


Published on

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Apache2 BootCamp : Getting Started With Apache

  1. 1. #4 Day #2 Getting Started with Apache Wildan Maulana wildan.m@openthinklabs.com http://workshop.openthinklabs.com
  2. 2. Overview● The steps necessary to have a minimal Apache installation up and running; for example, changing basic server properties such as name and port information● How to start and stop Apache and how to troubleshoot basic problems
  3. 3. Layout of Server Files and Directories Section Windows UnixDefault install path C:Program FilesApache /usr/local/apache2 GroupApache2Binaries and support bin/apache.exe bin/httpdscripts bin/ bin/Log files log/error.log log/error_log log/access.log log/access_log log/httpd.pid log/httpd.pidProxy proxy/ proxy/Configuration files conf/httpd.conf conf/httpd.confCGI scripts cgi-bin/test-cgi.bat cgi-bin/test-cgiBuild information and Does not apply in binary Include/header files installation build/
  4. 4. Layout of Server Files and Directories (2) Section Windows UnixError messages error/ error/Modules and libraries modules/ modules/ bin/ lib/HTML documents htdocs/ htdocs/Icons icons/ icons/Manual manual/ manual/
  5. 5. Configuration Files Structure● Directives Directives configure specific settings of Apache, such as authorization, performance, and network parameters.● Containers Containers specify the context to which those settings refer. For example, authorization configuration can refer to the server as a whole, a directory, or a single file.
  6. 6. Sample Container Directives <Directory “/some/directory”> SomeDirective1 SomeDirective2 </Directory> <Location “/downloads/*.html”> SomeDirective3 </Location> <Files “.(gif|jpg)”> SomeDirective4 </Files>
  7. 7. Conditional Evaluation<IfDefine MyModule> LoadModule my_module modules/libmymodule.so</IfDefine> apache2.exe -DMyModule
  8. 8. Conditional Evaluation (2) <IfModule prefork.c>Directives in an IfModule StartServers 5section will be processed MinSpareServers 5only if the module MaxSpareServers 10passed as an argument is present MaxClients 20in the Web server MaxRequestsPerChild 0 </IfModule> <IfModule worker.c> StartServers 3 MaxClients 8 MinSpareThreads 5 MaxSpareThreads 10 ThreadsPerChild 25 MaxRequestsPerChild 0 </IfModule>
  9. 9. ServerRoot● The ServerRoot directive takes a single argument: a directory path pointing to the directory where the server lives ServerRoot /usr/local/apache
  10. 10. Including Additional Configuration Files Include conf/ssl.conf
  11. 11. Per-Directory Configuration Files .htaccessAccessFileName directive Disabling Per-Directory Configuration Files <Directory /> AllowOverride none </Directory>
  12. 12. Minimal Apache Configuration httpd.conf
  13. 13. Log Files● access_log● error_log
  14. 14. Apache-Related Commands apache2 -h
  15. 15. Controlling Apache on Windows● Apache.exe -k restart : Tells Apache to restart● Apache.exe -k graceful: Tells Apache to do a graceful restart● Apache.exe -k stop: Tells Apache to stop
  16. 16. Troubleshooting● Existing Web Server● No Permission to Bind to Port● Access Denied● Wrong Group Settings
  17. 17. Q&Ahttp://workshop.openthinklabs.com/resources
  18. 18. Reference● Daniel Lopez Ridruezo; SAMS Teach Yourself Apache2 in 24 Hours, SAMS Publishing, 2002 (Buy this book on Amazon)