SlideShare a Scribd company logo
1 of 21
Apache Server Configuration & Optimization
Topics overview




     Apache
     HTTP Server                       Error
                      Virtual Hosts
     Essentials                       Handling




        Apache        Core Apache
      Configuration   Configuration
                                      Important
                                       Apache
                                                  Q&A
         Files         Directives
                                       Modules
Apache Configuration Files



 Places for doing the configurations

 •   httpd.conf
 •   access.conf ( linux )
 •   .htaccess
 •   .htpasswd
Core Apache Configuration Directives
ServerRoot :: Apache Installation Directory Path.
ServerRoot “/etc/apache2”

Listen :: IP addresses and ports that the server listens.
Listen 80
Listen 10.0.2.132:9111

ServerAdmin :: Email Address that will be displayed in
the error message when error occurs
ServerAdmin gokul.muralidharan@aspiresys.com

ServerName :: Current Server Name & Port
ServerName localhost:80

ServerAlias :: Alternate Names for accessing virtual hosts.
ServerAlias alias-1 alias-2
Core Apache Configuration Directives
 DocumentRoot :: Main Document Directory as displayed on
 the Web Site.
 DocumentRoot “/var/www”

 NameVirtualHost :: Designates an IP address for name-virtual host
 NameVirtualHost *:2125
 NameVirtualHost 10.0.2.132:9111


 LoadModule :: Load Specific Apache Module.
 LoadModule test_module modules/mod_test.so

 Include:: Includes other configuration files in the server
 configuration file.
 Include “test.conf”
 Include “/usr/aliases/*.conf”
Core Apache Configuration Directives
 IFModule :: Allows Module Specific Configurations.
 <IfModule module_name>
 Module Specific Configurations
 </IfModule>


 <IfModule !module_name>
 Module Specific Configurations
 </IfModule>

 <IfModule !autoindex_module>
        <IfModule dir_module>
                DirectoryIndex index.php index.html index.htm
        </IfModule>
 </IfModule>
Core Apache Configuration Directives
 Directory :: Allows group of directives applied to directory

 <Directory “/var/www">
  List of directives………………….………………..
 </Directory>

 Access Control Directives

    Determines who is allowed to access the website and who
    is kept out.
    Access can be granted based on following criteria ::
    • IP Address / Domain Name
    • Date & Time
    • Other User Defined Criteria
Core Apache Configuration Directives
 Order :: Defines ordering for allow & deny
 Order Allow,Deny
 Order Deny,Allow
 Allow :: Allows access from given IP Address or Domain Name
 Allow From all
 Allow From 192.168
 Deny :: Deny access from given IP Address or Domain Name
 Deny From 192.168
 Order :: Defines ordering for allow & deny
 Order Allow,Deny
 Order Deny,Allow
 Allow :: Allows access from given IP Address or Domain Name
 Allow From all
 Allow From 192.168
 Deny :: Deny access from given IP Address or Domain Name
 Deny From 192.168
Core Apache Configuration Directives
 In Apache Config file
 <Directory “/var/www/sandbox”>
        Order allow,deny
        Allow from all
        Deny from 192.168.
 </Directory>

 In .Htaccess

 Order allow,deny
 Allow from all
 Deny from 192.168.

 Which will get applied to the directory where the .htaccess is placed.
Core Apache Configuration Directives
 FileMatch :: Allows to define Access Rights for specific files.


 <FilesMatch "^.ht">
     Order allow,deny
     Deny from all
 </FilesMatch>


 <FilesMatch ".pdf$">
     Order allow,deny
     Deny from all
 </FilesMatch>
Core Apache Configuration Directives
 ErrorLog :: Error log File Location
 ErrorLog err-log-file location

 TransferLog :: Access Log File Location
 TransferLog access-log-file location

 CustomLog :: Custom Log File with custom Log Format
 CustomLog custom-log-file location Log-Format

 AuthType :: Type Of User Authentication
 AuthType Basic | Digest

 AuthUserFile :: File name which contains username and password
 AuthUserFile <Directory>/FileName

 The default location to look for logs are /var/log/http or /var/log/apache
 Look out for both access log and error log here.
 Tail –f /var/log/apache2/access.log will keep you update of the log display.
Core Apache Configuration Directives

 AuthType :: Type Of User Authentication
 AuthType Basic | Digest


 AuthUserFile :: File name which contains username and password
 AuthUserFile <Directory>/FileName

 AuthName :: Authorization Title used in HTTP Authentication
 AuthName Authentication Title

 Require :: Defines Type of Users/groups that can access
 Contents. Access Types can be :: group | user | valid-user.
 Require [Access Type] [ Access Name ]
 Require group admin
Virtual hosts

 Allows more than one websites to run on the same physical
 server & Apache Server.
 Two Types Of Virtual Hosts can be created
     • IP-based Virtual Hosts
     • Name-based Virtual Hosts

 Virtual Host Related Directives
     <VirtualHost [IP ADDRESS:PORT] >
         ServerAdmin
         DocumentRoot
         ServerName
         ServerAlias
         ErrorLog
     </ VirtualHost >
Virtual hosts
 Common Virtual Host Examples

    Listen 2100
    NameVirtualHost *:2100
    <VirtualHost localhost:2100>
        ServerAdmin gokul.muralidharan@aspiresys.com
        DocumentRoot “/var/www/app2100"
        ServerName localhost
    </VirtualHost>

    Listen 9090
    NameVirtualHost *:9090
    <VirtualHost *:9090>
    ServerAdmin sundaravel.somasundaram@aspiresys.com
    DocumentRoot “/var/www/app9090“
    </VirtualHost>
Virtual hosts
 Server Virtual Host Examples

 NameVirtualHost *:80

 <VirtualHost *:80>
     ServerAdmin admin@domain.com
     DocumentRoot “/var/www/production"
     ServerName www.yoursite.com
     ServerAlias yoursite.com
 </VirtualHost>


 <VirtualHost *:80>
     ServerAdmin admin@domain
     DocumentRoot "E:wwwrootdemo"
     ServerName www.example.com
     ServerAlias example.com
 </VirtualHost>
Virtual hosts
 Error Handling
 Apache Server generates Status Codes depending on the
 Page/URL Request.
    • 301 Moved Permanently
    • 401 Unauthorized
    • 403 Forbidden
    • 404 Not Found
    • 500 Internal Server Error

 ErrorDocument :: Allows to define Custom Error Pages
 ErrorDocument StatusCode <Custom Error Page Location>
 ErrorDocument 401 /error401.html
 ErrorDocument 403 /errordocs/error403.php
 ErrorDocument 404 http://www.yousite.com/error.php
Important Apache Modules
       •   mod_ssl
       •   mod_rewrite
       •   mod_expires
       •   mod_autoindex
       •   mod_deflate
       •   mod_headers
       •   mod_dir mod_include
       •   mod_alias mod_env
       •   mod_cgi
       •   mod_proxy
       •   mod_log_config
       •   mod_mime mod_fastcgi
       •   mod_auth
       •   mod_dav

       And So on….
Important Apache Modules

mod_access
Provides access control based on client hostname, IP address, or other
characteristics of the client request.
mod_alias
Provides for mapping different parts of the host filesystem in the document
tree and for URL redirection
mod_dav
Distributed Authoring and Versioning (WebDAV) functionality
mod_dav_fs
filesystem provider for mod_dav
mod_deflate
Compress content before it is delivered to the client
mod_expires
Generation of Expires and Cache-Control HTTP headers according to user-
specified criteria
mod_headers
Customization of HTTP request and response headers
Important Apache Modules

mod_ldap
LDAP connection pooling and result caching services for use by other LDAP
modules
mod_log_config
Logging of the requests made to the server
mod_mime
Associates the requested filename's extensions with the file's behavior
(handlers and filters) and content (mime-type, language, character set and
encoding)
mod_mime_magic
Determines the MIME type of a file by looking at a few bytes of its
contents.
mod_proxy
HTTP/1.1 proxy/gateway server,HTTP support module for mod_proxy
mod_rewrite
Provides a rule-based rewriting engine to rewrite requested URLs on the fly
Important Apache Modules

Mod_evasive
mod_evasive is an evasive maneuvers module for Apache to provide evasive
action in the event of an HTTP DoS or DDoS attack or brute force attack.
It is also designed to be a detection and network management tool, and can
be easily configured to talk to ipchains, firewalls, routers, and etcetera.
mod_evasive presently reports abuses via email and syslog facilities.

mod_so
Loading of executable code and modules into the server at start-up
or restart time

mod_userdir
User-specific directories
Apache server configuration & optimization

More Related Content

What's hot

Apache Server Tutorial
Apache Server TutorialApache Server Tutorial
Apache Server TutorialJagat Kothari
 
Apache web server
Apache web serverApache web server
Apache web serverzrstoppe
 
Apache Tutorial
Apache TutorialApache Tutorial
Apache TutorialGuru99
 
APACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXAPACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXwebhostingguy
 
Apache Web server Complete Guide
Apache Web server Complete GuideApache Web server Complete Guide
Apache Web server Complete Guidewebhostingguy
 
Web Server(Apache),
Web Server(Apache), Web Server(Apache),
Web Server(Apache), webhostingguy
 
Apache Presentation
Apache PresentationApache Presentation
Apache PresentationAnkush Jain
 
Apache web server
Apache web serverApache web server
Apache web serverSabiha M
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hostingwebhostingguy
 
Web server installation_configuration_apache
Web server installation_configuration_apacheWeb server installation_configuration_apache
Web server installation_configuration_apacheShaojie Yang
 
Setting up a web server in Linux (Ubuntu)
Setting up a web server in Linux (Ubuntu)Setting up a web server in Linux (Ubuntu)
Setting up a web server in Linux (Ubuntu)Zakaria Hossain
 
Webserver Administration: Apache as a case study
Webserver Administration: Apache as a case studyWebserver Administration: Apache as a case study
Webserver Administration: Apache as a case studyTata Consultancy Services
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptwebhostingguy
 

What's hot (20)

Apache web service
Apache web serviceApache web service
Apache web service
 
Apache Server Tutorial
Apache Server TutorialApache Server Tutorial
Apache Server Tutorial
 
Apache web server
Apache web serverApache web server
Apache web server
 
Apache error
Apache errorApache error
Apache error
 
Apache Web Server Setup 3
Apache Web Server Setup 3Apache Web Server Setup 3
Apache Web Server Setup 3
 
Apache Tutorial
Apache TutorialApache Tutorial
Apache Tutorial
 
APACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUXAPACHE WEB SERVER FOR LINUX
APACHE WEB SERVER FOR LINUX
 
Apache Web server Complete Guide
Apache Web server Complete GuideApache Web server Complete Guide
Apache Web server Complete Guide
 
Web Server(Apache),
Web Server(Apache), Web Server(Apache),
Web Server(Apache),
 
Apache ppt
Apache pptApache ppt
Apache ppt
 
Apache Web Server Setup 2
Apache Web Server Setup 2Apache Web Server Setup 2
Apache Web Server Setup 2
 
Apache Presentation
Apache PresentationApache Presentation
Apache Presentation
 
Apache web server
Apache web serverApache web server
Apache web server
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hosting
 
Web server installation_configuration_apache
Web server installation_configuration_apacheWeb server installation_configuration_apache
Web server installation_configuration_apache
 
Setting up a web server in Linux (Ubuntu)
Setting up a web server in Linux (Ubuntu)Setting up a web server in Linux (Ubuntu)
Setting up a web server in Linux (Ubuntu)
 
Webserver Administration: Apache as a case study
Webserver Administration: Apache as a case studyWebserver Administration: Apache as a case study
Webserver Administration: Apache as a case study
 
Installing and configuring apache
Installing and configuring apacheInstalling and configuring apache
Installing and configuring apache
 
Php1
Php1Php1
Php1
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.ppt
 

Viewers also liked

Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)Anne Nicolas
 
Kernel Recipes 2013 - Easy rootfs using Buildroot
Kernel Recipes 2013 - Easy rootfs using BuildrootKernel Recipes 2013 - Easy rootfs using Buildroot
Kernel Recipes 2013 - Easy rootfs using BuildrootAnne Nicolas
 
Web Application Firewall (WAF) DAST/SAST combination
Web Application Firewall (WAF) DAST/SAST combinationWeb Application Firewall (WAF) DAST/SAST combination
Web Application Firewall (WAF) DAST/SAST combinationTjylen Veselyj
 
Static Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and YouStatic Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and YouKevin Fealey
 
SAST vs. DAST: What’s the Best Method For Application Security Testing?
SAST vs. DAST: What’s the Best Method For Application Security Testing?SAST vs. DAST: What’s the Best Method For Application Security Testing?
SAST vs. DAST: What’s the Best Method For Application Security Testing?Cigital
 

Viewers also liked (6)

Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
 
HARDENING IN APACHE WEB SERVER
HARDENING IN APACHE WEB SERVERHARDENING IN APACHE WEB SERVER
HARDENING IN APACHE WEB SERVER
 
Kernel Recipes 2013 - Easy rootfs using Buildroot
Kernel Recipes 2013 - Easy rootfs using BuildrootKernel Recipes 2013 - Easy rootfs using Buildroot
Kernel Recipes 2013 - Easy rootfs using Buildroot
 
Web Application Firewall (WAF) DAST/SAST combination
Web Application Firewall (WAF) DAST/SAST combinationWeb Application Firewall (WAF) DAST/SAST combination
Web Application Firewall (WAF) DAST/SAST combination
 
Static Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and YouStatic Analysis Security Testing for Dummies... and You
Static Analysis Security Testing for Dummies... and You
 
SAST vs. DAST: What’s the Best Method For Application Security Testing?
SAST vs. DAST: What’s the Best Method For Application Security Testing?SAST vs. DAST: What’s the Best Method For Application Security Testing?
SAST vs. DAST: What’s the Best Method For Application Security Testing?
 

Similar to Apache server configuration & optimization

Linux System Administration - Web Server and squid setup
Linux System Administration - Web Server and squid setupLinux System Administration - Web Server and squid setup
Linux System Administration - Web Server and squid setupSreenatha Reddy K R
 
Lesson 9. The Apache Web Server
Lesson 9. The Apache Web ServerLesson 9. The Apache Web Server
Lesson 9. The Apache Web Serverwebhostingguy
 
Apache installation and configurations
Apache installation and configurationsApache installation and configurations
Apache installation and configurationsNikhil Jain
 
Web Server Administration
Web Server AdministrationWeb Server Administration
Web Server Administrationwebhostingguy
 
Web Server Administration
Web Server AdministrationWeb Server Administration
Web Server Administrationwebhostingguy
 
Web Server Administration
Web Server AdministrationWeb Server Administration
Web Server Administrationwebhostingguy
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptwebhostingguy
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptwebhostingguy
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentationwebhostingguy
 
Apache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With ApacheApache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With ApacheWildan Maulana
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologieselliando dias
 
Ch 22: Web Hosting and Internet Servers
Ch 22: Web Hosting and Internet ServersCh 22: Web Hosting and Internet Servers
Ch 22: Web Hosting and Internet Serverswebhostingguy
 
Running the Apache Web Server
Running the Apache Web ServerRunning the Apache Web Server
Running the Apache Web Serverwebhostingguy
 

Similar to Apache server configuration & optimization (20)

Http
HttpHttp
Http
 
Apache HTTP Server
Apache HTTP ServerApache HTTP Server
Apache HTTP Server
 
Linux System Administration - Web Server and squid setup
Linux System Administration - Web Server and squid setupLinux System Administration - Web Server and squid setup
Linux System Administration - Web Server and squid setup
 
Apache
ApacheApache
Apache
 
Lesson 9. The Apache Web Server
Lesson 9. The Apache Web ServerLesson 9. The Apache Web Server
Lesson 9. The Apache Web Server
 
5-WebServers.ppt
5-WebServers.ppt5-WebServers.ppt
5-WebServers.ppt
 
Apache installation and configurations
Apache installation and configurationsApache installation and configurations
Apache installation and configurations
 
Web Server Administration
Web Server AdministrationWeb Server Administration
Web Server Administration
 
Web Server Administration
Web Server AdministrationWeb Server Administration
Web Server Administration
 
Web Server Administration
Web Server AdministrationWeb Server Administration
Web Server Administration
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.ppt
 
Utosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.pptUtosc2007_Apache_Configuration.ppt
Utosc2007_Apache_Configuration.ppt
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentation
 
Apache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With ApacheApache2 BootCamp : Getting Started With Apache
Apache2 BootCamp : Getting Started With Apache
 
Apache Presentation
Apache PresentationApache Presentation
Apache Presentation
 
are available here
are available hereare available here
are available here
 
Apache
ApacheApache
Apache
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologies
 
Ch 22: Web Hosting and Internet Servers
Ch 22: Web Hosting and Internet ServersCh 22: Web Hosting and Internet Servers
Ch 22: Web Hosting and Internet Servers
 
Running the Apache Web Server
Running the Apache Web ServerRunning the Apache Web Server
Running the Apache Web Server
 

Recently uploaded

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 

Recently uploaded (20)

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 

Apache server configuration & optimization

  • 2. Topics overview Apache HTTP Server Error Virtual Hosts Essentials Handling Apache Core Apache Configuration Configuration Important Apache Q&A Files Directives Modules
  • 3. Apache Configuration Files Places for doing the configurations • httpd.conf • access.conf ( linux ) • .htaccess • .htpasswd
  • 4. Core Apache Configuration Directives ServerRoot :: Apache Installation Directory Path. ServerRoot “/etc/apache2” Listen :: IP addresses and ports that the server listens. Listen 80 Listen 10.0.2.132:9111 ServerAdmin :: Email Address that will be displayed in the error message when error occurs ServerAdmin gokul.muralidharan@aspiresys.com ServerName :: Current Server Name & Port ServerName localhost:80 ServerAlias :: Alternate Names for accessing virtual hosts. ServerAlias alias-1 alias-2
  • 5. Core Apache Configuration Directives DocumentRoot :: Main Document Directory as displayed on the Web Site. DocumentRoot “/var/www” NameVirtualHost :: Designates an IP address for name-virtual host NameVirtualHost *:2125 NameVirtualHost 10.0.2.132:9111 LoadModule :: Load Specific Apache Module. LoadModule test_module modules/mod_test.so Include:: Includes other configuration files in the server configuration file. Include “test.conf” Include “/usr/aliases/*.conf”
  • 6. Core Apache Configuration Directives IFModule :: Allows Module Specific Configurations. <IfModule module_name> Module Specific Configurations </IfModule> <IfModule !module_name> Module Specific Configurations </IfModule> <IfModule !autoindex_module> <IfModule dir_module> DirectoryIndex index.php index.html index.htm </IfModule> </IfModule>
  • 7. Core Apache Configuration Directives Directory :: Allows group of directives applied to directory <Directory “/var/www"> List of directives………………….……………….. </Directory> Access Control Directives Determines who is allowed to access the website and who is kept out. Access can be granted based on following criteria :: • IP Address / Domain Name • Date & Time • Other User Defined Criteria
  • 8. Core Apache Configuration Directives Order :: Defines ordering for allow & deny Order Allow,Deny Order Deny,Allow Allow :: Allows access from given IP Address or Domain Name Allow From all Allow From 192.168 Deny :: Deny access from given IP Address or Domain Name Deny From 192.168 Order :: Defines ordering for allow & deny Order Allow,Deny Order Deny,Allow Allow :: Allows access from given IP Address or Domain Name Allow From all Allow From 192.168 Deny :: Deny access from given IP Address or Domain Name Deny From 192.168
  • 9. Core Apache Configuration Directives In Apache Config file <Directory “/var/www/sandbox”> Order allow,deny Allow from all Deny from 192.168. </Directory> In .Htaccess Order allow,deny Allow from all Deny from 192.168. Which will get applied to the directory where the .htaccess is placed.
  • 10. Core Apache Configuration Directives FileMatch :: Allows to define Access Rights for specific files. <FilesMatch "^.ht"> Order allow,deny Deny from all </FilesMatch> <FilesMatch ".pdf$"> Order allow,deny Deny from all </FilesMatch>
  • 11. Core Apache Configuration Directives ErrorLog :: Error log File Location ErrorLog err-log-file location TransferLog :: Access Log File Location TransferLog access-log-file location CustomLog :: Custom Log File with custom Log Format CustomLog custom-log-file location Log-Format AuthType :: Type Of User Authentication AuthType Basic | Digest AuthUserFile :: File name which contains username and password AuthUserFile <Directory>/FileName The default location to look for logs are /var/log/http or /var/log/apache Look out for both access log and error log here. Tail –f /var/log/apache2/access.log will keep you update of the log display.
  • 12. Core Apache Configuration Directives AuthType :: Type Of User Authentication AuthType Basic | Digest AuthUserFile :: File name which contains username and password AuthUserFile <Directory>/FileName AuthName :: Authorization Title used in HTTP Authentication AuthName Authentication Title Require :: Defines Type of Users/groups that can access Contents. Access Types can be :: group | user | valid-user. Require [Access Type] [ Access Name ] Require group admin
  • 13. Virtual hosts Allows more than one websites to run on the same physical server & Apache Server. Two Types Of Virtual Hosts can be created • IP-based Virtual Hosts • Name-based Virtual Hosts Virtual Host Related Directives <VirtualHost [IP ADDRESS:PORT] > ServerAdmin DocumentRoot ServerName ServerAlias ErrorLog </ VirtualHost >
  • 14. Virtual hosts Common Virtual Host Examples Listen 2100 NameVirtualHost *:2100 <VirtualHost localhost:2100> ServerAdmin gokul.muralidharan@aspiresys.com DocumentRoot “/var/www/app2100" ServerName localhost </VirtualHost> Listen 9090 NameVirtualHost *:9090 <VirtualHost *:9090> ServerAdmin sundaravel.somasundaram@aspiresys.com DocumentRoot “/var/www/app9090“ </VirtualHost>
  • 15. Virtual hosts Server Virtual Host Examples NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin admin@domain.com DocumentRoot “/var/www/production" ServerName www.yoursite.com ServerAlias yoursite.com </VirtualHost> <VirtualHost *:80> ServerAdmin admin@domain DocumentRoot "E:wwwrootdemo" ServerName www.example.com ServerAlias example.com </VirtualHost>
  • 16. Virtual hosts Error Handling Apache Server generates Status Codes depending on the Page/URL Request. • 301 Moved Permanently • 401 Unauthorized • 403 Forbidden • 404 Not Found • 500 Internal Server Error ErrorDocument :: Allows to define Custom Error Pages ErrorDocument StatusCode <Custom Error Page Location> ErrorDocument 401 /error401.html ErrorDocument 403 /errordocs/error403.php ErrorDocument 404 http://www.yousite.com/error.php
  • 17. Important Apache Modules • mod_ssl • mod_rewrite • mod_expires • mod_autoindex • mod_deflate • mod_headers • mod_dir mod_include • mod_alias mod_env • mod_cgi • mod_proxy • mod_log_config • mod_mime mod_fastcgi • mod_auth • mod_dav And So on….
  • 18. Important Apache Modules mod_access Provides access control based on client hostname, IP address, or other characteristics of the client request. mod_alias Provides for mapping different parts of the host filesystem in the document tree and for URL redirection mod_dav Distributed Authoring and Versioning (WebDAV) functionality mod_dav_fs filesystem provider for mod_dav mod_deflate Compress content before it is delivered to the client mod_expires Generation of Expires and Cache-Control HTTP headers according to user- specified criteria mod_headers Customization of HTTP request and response headers
  • 19. Important Apache Modules mod_ldap LDAP connection pooling and result caching services for use by other LDAP modules mod_log_config Logging of the requests made to the server mod_mime Associates the requested filename's extensions with the file's behavior (handlers and filters) and content (mime-type, language, character set and encoding) mod_mime_magic Determines the MIME type of a file by looking at a few bytes of its contents. mod_proxy HTTP/1.1 proxy/gateway server,HTTP support module for mod_proxy mod_rewrite Provides a rule-based rewriting engine to rewrite requested URLs on the fly
  • 20. Important Apache Modules Mod_evasive mod_evasive is an evasive maneuvers module for Apache to provide evasive action in the event of an HTTP DoS or DDoS attack or brute force attack. It is also designed to be a detection and network management tool, and can be easily configured to talk to ipchains, firewalls, routers, and etcetera. mod_evasive presently reports abuses via email and syslog facilities. mod_so Loading of executable code and modules into the server at start-up or restart time mod_userdir User-specific directories