Upload
wildan-maulana
View
1.949
Download
4
Tags:
Embed Size (px)
Citation preview
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
Layout of Server Files and Directories
Section Windows Unix
Default install path C:\Program Files\Apache Group\Apache2
/usr/local/apache2
Binaries and support scripts
bin/apache.exebin/
bin/httpdbin/
Log files log/error.loglog/access.loglog/httpd.pid
log/error_loglog/access_loglog/httpd.pid
Proxy proxy/ proxy/
Configuration files conf/httpd.conf conf/httpd.conf
CGI scripts cgi-bin/test-cgi.bat cgi-bin/test-cgi
Build information and header files
Does not apply in binary installation
Include/build/
Layout of Server Files and Directories (2)
Section Windows Unix
Error messages error/ error/
Modules and libraries modules/bin/
modules/lib/
HTML documents htdocs/ htdocs/
Icons icons/ icons/
Manual manual/ manual/
Configuration Files Structure
● DirectivesDirectives configure specific settings of Apache, such as authorization, performance, and network parameters.
● ContainersContainers 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.
Sample Container Directives
<Directory “/some/directory”> SomeDirective1 SomeDirective2</Directory><Location “/downloads/*.html”> SomeDirective3</Location><Files “\.(gif|jpg)”> SomeDirective4 </Files>
Conditional Evaluation
<IfDefine MyModule> LoadModule my_module modules/libmymodule.so</IfDefine>
apache2.exe -DMyModule
Conditional Evaluation (2)<IfModule prefork.c> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 20 MaxRequestsPerChild 0</IfModule>
<IfModule worker.c> StartServers 3 MaxClients 8 MinSpareThreads 5 MaxSpareThreads 10 ThreadsPerChild 25 MaxRequestsPerChild 0</IfModule>
Directives in an IfModule section will be processed only if the modulepassed as an argument is present in the Web server
ServerRoot
● The ServerRoot directive takes a single argument: a directory path pointing to the directory where the server lives
ServerRoot /usr/local/apache
Including Additional Configuration Files
Include conf/ssl.conf
Per-Directory Configuration Files
.htaccess
AccessFileName directive
<Directory /> AllowOverride none</Directory>
Disabling Per-Directory Configuration Files
Minimal Apache Configuration
httpd.conf
Log Files
● access_log
● error_log
Apache-Related Commands
apache2 -h
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
Troubleshooting
● Existing Web Server● No Permission to Bind to Port● Access Denied● Wrong Group Settings
Q&Ahttp://workshop.openthinklabs.com/resources
Reference
● Daniel Lopez Ridruezo; SAMS Teach Yourself Apache2 in 24 Hours, SAMS Publishing, 2002 (Buy this book on Amazon)