Changes

Jump to: navigation, search

Package:Apache

608 bytes added, 6 years ago
no edit summary
|Homepage=http://httpd.apache.org/
}}
apache Apache is a powerful web server. apache serves html/css/cgi/pl out of the box, and other languages/frameworks via extensions.
== Install ==
== Configuration ==
=== System ===
Many packages have apache2 use flags, and require them . These use flags are often required for an application to be supported by apacheApache. Setting a system wide apache2 use flag is a good idea.
{{file|name=/etc/portage/make.conf|desc=set system wide apache2 useflag|body=
USE="apache2 ........,apache2,..."
}}
*<code>/etc/apache2/vhosts.d/*</code>
<code>conf.d </code> controls the init script, adding things to it such as -D SECURITY & -D PHP5 will enable web application fire-walling & the php scripting language.
<code>httpd.conf </code> controls how the server behaves, at the bottom of the file it has directives to include configuration files ending in .conf in <code>/etc/apache2/modules.d & </code> and <code>/etc/apache2/vhosts.d</code>
== Service ==
To start apache immediately:
<console>###i## rc-service apache2 start</console>
To start apache upon boot:
<console>###i## rc-update add apache2</console>
== mod_rewrite ==
=== What is <code>mod_rewrite</code>? ===
The [ http://httpd.apache.org/docs/current/mod/mod_rewrite.html Apache documentation ] describes <code>mod_rewrite</code> as:
<blockquote>
The mod_rewrite module uses a rule-based rewriting engine, based on a PCRE regular-expression parser, to rewrite requested URLs on the fly. By default, mod_rewrite maps a URL to a filesystem path. However, it can also be used to redirect one URL to another URL, or to invoke an internal proxy fetch.
</blockquote>
 
=== Setting it up ===
mod_rewrite has a reputation of being difficult to set up. mod_rewrite requires following symlinks & Order allow,deny (apache 2.2) or Require all granted (apache 2.4) is set. To test functionality of mod_rewrite we will need to make a few files.
Then point your browser @ http://127.0.0.1/test.html the text from rewrite.html should be loaded.
 
{{EbuildFooter}}
wiki-moderators
504
edits

Navigation menu