Apache: Difference between revisions
Content added Content deleted
m (→Intro: link) |
m (→htaccess: m) |
||
Line 34: | Line 34: | ||
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://vogella.com to http://www.vogella.com. |
||
*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. |
||
Line 40: | Line 40: | ||
RewriteEngine on |
RewriteEngine on |
||
RewriteCond %{HTTP_HOST} !^www\.vogella\.de$ |
RewriteCond %{HTTP_HOST} !^www\.vogella\.de$ |
||
RewriteRule ^(.*)$ http://www. |
RewriteRule ^(.*)$ http://www.vogella.com/$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 |
||
{{UC}} |
{{UC}} |
Revision as of 18:14, 3 July 2017
Intro
Source: vogella.com
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://vogella.com to http://www.vogella.com.
- 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.vogella.com/$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
}}