Apache Web Server

From BC$ MobileTV Wiki
Jump to: navigation, search
Apache Web Server Logo

Apache Web Server (also known as Apache HTTP Server) is the world's most popular (by volume, deployment/use) web server software platform.

Apache Web Server is definitely the Apache foundation's single most successful (top most downloaded software - #10[1], most used web server - 60.31%[2]) project to date, and is the crown jewel of the foundation's work, enabling millions to publish their works on the World Wide Web.


Specifications

.htaccess

.htaccess is the name of a configuration file Apache Web Server looks for to route HTTP requests to a given sub-domain or folder on the server. It is most commonly used in unison with a URL pattern module such as mod_rewrite[3] and/or mod_seo[4].


Installation

XAMPP

Many people know from their own experience that it's not easy to install an Apache web server and it gets harder if you want to add MySQL, PHP and Perl.

XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.

A new version of XAMPP was recently released, including:

   * Apache HTTPD 2.2.11 + Openssl 0.9.8i
   * MySQL 5.1.30
   * PHP 5.2.8
   * phpMyAdmin 3.1.1
   * FileZilla FTP Server 0.9.29
   * Mercury Mail Transport System 4.52

Windows VISTA (peculiarities)

WAMP

One possible solution to the many reported Windows problems, is to use a distribution of Apache Web Server optimized for installation and usage on Windows OS to begin with, which is the proposal of Windows Apache MySQL Php (WAMP) server.


MAMP

When it comes to running a web server on a Mac, the best option is either the built-in (yet limited) local server distributions[8] or a full-blown Apache Web Server installation via MAMP.


LAMP

The traditional open source platform is still the powerful and robust combination of Linux (), Apache Web Server, MySQL RDBMS and PHP[10].



Modules

Apache Web Server includes a highly customizable extension mechanism known as "modules" (commonly abbreviated as a mod). All module libraries are typically prefixed by mod_ such as the most popular ones:

  • mod_rewrite - URL re-writing capabilities (to re-route requests to one place over to another to determine appropriate response)
  • mod_ldap - ActiveDirectory and/or OpenLDAP integrations
  • mod_proxy - setup a Forward Proxy or Reverse Proxy
  • mod_security - Web Application Firewall (WAF)
  • mod_ssl - Apache interface to OpenSSL
  • mod_geoip - looks up the IP address of the client end user, which can then be used to perform redirection based on country.
  • mod_torcheck - blocks requests from Tor exit nodes
  • mod_cgi - allows usage of CGI scripts in your web server
  • mod_php - allows usage of PHP scripts in your web server
  • mod_perl - allows usage of Perl scripts in your web server
  • mod_python - allows usage of Python scripts in your web server
  • mod_aspdotnet - allows usage of ASP.net/C# scripts in your web server
  • mod_pagespeed - Google authored module to rewrite web pages to reduce latency & bandwidth
  • mod_upload - file upload convenience methods & security helpers
  • mod_xml - enables native XML functions to gain some parsing/serializing performance optimizations over custom scripts
  • mod_xslt - enables native transformation of XML formatted documents to other formats via XSL
  • mod_xmlrpc - enables native use of XML-RPC
  • mod_flvx - stream Flash videos

[12] [13]

Dispatcher

See AEM Dispatcher


Re-Write Rules for Web Server

Using Re-Write rules requires the mod_rewrite to be properly configured within your Apache Web Server distribution.


For example, the following mod_rewrite rules can be applied to shorten:

http://bcmoney-mobiletv.com/api/foaf/FoafWriter.php?u=bryan

|

INTO

|

http://bcmoney-mobiletv.com/bryan/foaf/


RewriteEngine on
RewriteRule ^([^/\.]+)/foaf/?$ api/foaf/FoafWriter.php?u=$1 [L]


Where:

  • ^ means match anything before this point
  • ([^/\.]+) means match one or more characters that aren’t a forward slash or a period
  • /?$ means ensure the only thing that is found after what was just matched is a possible forward slash, and nothing else. (If anything else is found, then this RewriteRule will be ignored.)
  • FoafWriter.php is the actual page to load
  • ?u= is the URL (GET) query parameters
  • $1 is the value captured by mod_rewrite for passing to the page (in the example's case, the username bryan)

[14] [15] [16] [17] [18] [19] [20] [21] [22]



Tools


Resources


Tutorials

[24] [25] [26] [27]

[28][29][30]



External Links


References

  1. http://www.infoworld.com/d/open-source/top-10-open-source-hall-famers-848&current=11&last=1#slideshowTop
  2. April 2011 Web Server Survey: http://news.netcraft.com/archives/category/web-server-survey/
  3. Mod_Rewrite ‘How To’ tutorial: http://www.rankinglabs.com/Mod_Rewrite
  4. Keyword reach URLs in 5 minutes: http://www.helicontech.com/articles/mod_seo/
  5. wikipedia: WAMP
  6. wikipedia: WIMP (software bundle)
  7. How To Install Perl on a WAMP Server: http://webdevster.com/how-to/install-perl-on-wamp
  8. How to Turn Your Mac Into a Web Server: http:///www.macinstruct.com/node/112
  9. wikipedia: MAMP
  10. LAMP - The Open Source Web Platform: http://onlamp.com/pub/a/onlamp/2001/01/25/lamp.html
  11. wikipedia: LAMP (software bundle)
  12. Apache hardening - 10 Tips to Secure Your Apache Web Server on UNIX / Linux: https://www.thegeekstuff.com/2011/03/apache-hardening/
  13. Commonly Used Apache Moduleshttps://www.: interserver.net/tips/kb/commonly-used-apache-modules/
  14. mod_rewrite docs: http://httpd.apache.org/docs/current/rewrite/
  15. Getting .htaccess mod_rewrite rules working locally with XAMPP: http://www.web-design-talk.co.uk/126/getting-htaccess-mod-rewrite-working-locally-with-xampp/
  16. How to enable rewrite module in XAMPP, WAMP and Apache: http://www.anmsaiful.net/blog/php/enable-apache-rewrite-module.html
  17. AllowOverride explained: http://vr-zone.com/manual/en/mod/core.html#allowoverride
  18. URL Rewriting for Beginners (with plenty of examples): https://www.addedbytes.com/blog/url-rewriting-for-beginners/
  19. wikipedia: mod_proxy
  20. An In-Depth Guide to mod_rewrite for Apache: https://code.tutsplus.com/tutorials/an-in-depth-guide-to-mod_rewrite-for-apache--net-6708
  21. mod_rewrite, a beginner’s guide (with examples): http://www.workingwith.me.uk/articles/scripting/mod_rewrite
  22. Apache mod_rewrite and Examples: https://www.hostgator.com/help/article/apache-mod-rewrite-and-examples
  23. Speed Tips - Remove Last-Modified and ETag Headers (when using "Expires" header instead): http://www.askapache.com/htaccess/apache-speed-last-modified.html
  24. Where are the Apache Configuration files on Mac? – httpd.conf: https://smartwebdeveloper.com/mac/httpd-conf-location-mac
  25. Installing Apache, PHP, and MySQL on macOS Catalina: https://jasonmccreary.me/articles/install-apache-php-mysql-mac-os-x-catalina/
  26. How to Install Apache Web Server, PHP, Perl on Mac OS X Yosemite: https://crunchify.com/how-to-install-apache-web-server-on-mac-os-x-yosemite/
  27. Setting up an apache web server on mac os Sierra (macbook pro 13 2014): https://stackoverflow.com/questions/39757902/setting-up-an-apache-web-server-on-mac-os-sierra-macbook-pro-13-2014
  28. pls help to rewrite subdomains to subfolders: http://www.webmasterworld.com/apache/3163397.htm
  29. http://stackoverflow.com/questions/6725973/rewrite-folder-to-subdomain-with-htaccess
  30. http://stackoverflow.com/questions/49500/apache-rewrite-based-on-subdomain
  31. How can I add in apache referrer policy header?: https://serverfault.com/questions/880894/how-can-i-add-in-apache-referrer-policy-header
  32. How To Fix a Missing Content-Security-Policy on a Website: https://www.blackhillsinfosec.com/fix-missing-content-security-policy-website/
  33. Is it possible to set headers conditionally?: https://stackoverflow.com/questions/16074750/is-it-possible-to-set-headers-conditionally
  34. Set Apache headers conditionally: https://stackoverflow.com/questions/21270902/set-apache-headers-conditionally
  35. Apache X-Frame-Options Allow-From multiple domains: https://stackoverflow.com/questions/38744953/apache-x-frame-options-allow-from-multiple-domains
  36. X-Frame-Options -- ALLOW-FROM in firefox and chrome: https://stackoverflow.com/questions/10658435/x-frame-options-allow-from-in-firefox-and-chrome
  37. Apache mod_alias RedirectMatch everything except specific pattern: https://stackoverflow.com/questions/26399826/apache-mod-alias-redirectmatch-everything-except-specific-pattern
  38. Rewrite URLs with mod_rewrite and Apache: https://www.linode.com/docs/web-servers/apache-tips-and-tricks/rewrite-urls-with-modrewrite-and-apache/
  39. Site Performance Tip: Update to HTTP2: https://freestar.com/site-performance-tip-update-http2/

See Also

Apache | Tomcat | Web Server | Hotlinking | SEO | Security