Apache: Difference between revisions
Content added Content deleted
(added) |
(added more) |
||
Line 3: | Line 3: | ||
<br /> |
<br /> |
||
= Intro = |
|||
⚫ | |||
= Basics = |
|||
⚫ | |||
apache2 -l |
apache2 -l |
||
Main configuration file for the Apache Http server |
*Main configuration file for the Apache Http server |
||
/etc/apache2/apache2.conf |
/etc/apache2/apache2.conf |
||
The error log of Apache is located in the |
*The error log of Apache is located in the |
||
/var/log/apache2/error.log |
/var/log/apache2/error.log |
||
grep MaxClients /var/log/apache2/error.log |
grep MaxClients /var/log/apache2/error.log |
||
=Multi-Processing-Module |
= Multi-Processing-Module = |
||
Apache HTTP can run in different modes. |
Apache HTTP can run in different modes. MPM modes determine how the web requests of users are answered. |
||
The selected mode is compiled into the server and can be checked with: |
*The selected mode is compiled into the server and can be checked with: |
||
sudo apachectl -V | grep -i mpm |
sudo apachectl -V | grep -i mpm |
||
Configuration for the event mpm is stored in below file: |
*Configuration for the event mpm is stored in below file: |
||
Configure only the module which your server is using. |
Configure only the module which your server is using. |
||
Line 29: | Line 33: | ||
One major application of this file is to redirect an URL to other URL’s. |
One major application of this file is to redirect an URL to other URL’s. |
||
The following .htacess file reroutes http:// |
*The following .htacess file reroutes http://aman.info.tm to http://www.aman.info.tm. |
||
It also redirect access to a certain webpage (/articles/SpringFramework/article.html) to another webpage via a 301 redirect. |
*It also redirect access to a certain webpage (/articles/SpringFramework/article.html) to another webpage via a 301 redirect. |
||
The 301 redirect will tell search engines that this side has moved and is the recommended way to move webpages. |
*The 301 redirect will tell search engines that this side has moved and is the recommended way to move webpages. |
||
RewriteEngine on |
RewriteEngine on |
||
RewriteCond %{HTTP_HOST} !^www\.vogella\.de$ |
RewriteCond %{HTTP_HOST} !^www\.vogella\.de$ |
||
RewriteRule ^(.*)$ http://www. |
RewriteRule ^(.*)$ http://www.aman.info.tm/$1 [L,R=301] |
||
redirect 301 /articles/SpringFramework/article.html http://www.vogella.com/tutorials/SpringDependencyInjection/article.html |
redirect 301 /articles/SpringFramework/article.html http://www.vogella.com/tutorials/SpringDependencyInjection/article.html |
||
Revision as of 17:56, 3 July 2017
Intro
Basics
- List the available modules of the Apache HTTP server
apache2 -l
- Main configuration file for the Apache Http server
/etc/apache2/apache2.conf
- The error log of Apache is located in the
/var/log/apache2/error.log grep MaxClients /var/log/apache2/error.log
Multi-Processing-Module
Apache HTTP can run in different modes. MPM modes determine how the web requests of users are answered.
- The selected mode is compiled into the server and can be checked with:
sudo apachectl -V | grep -i mpm
- Configuration for the event mpm is stored in below file:
Configure only the module which your server is using.
/etc/apache2/mods-available/mpm_event.conf
htaccess
One major application of this file is to redirect an URL to other URL’s.
- The following .htacess file reroutes http://aman.info.tm to http://www.aman.info.tm.
- It also redirect access to a certain webpage (/articles/SpringFramework/article.html) to another webpage via a 301 redirect.
- The 301 redirect will tell search engines that this side has moved and is the recommended way to move webpages.
RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.vogella\.de$ RewriteRule ^(.*)$ http://www.aman.info.tm/$1 [L,R=301] redirect 301 /articles/SpringFramework/article.html http://www.vogella.com/tutorials/SpringDependencyInjection/article.html
This section is under construction. |
- References
{{#widget:DISQUS
|id=networkm
|uniqid=Apache
|url=https://aman.awiki.org/wiki/Apache
}}