The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
Difference between revisions of "Package:Apache"
Threesixes (talk | contribs) (initial commit (more to come, just want to save what ive got so far)) |
Threesixes (talk | contribs) m (add mod_rewrite testing setup) |
||
Line 28: | Line 28: | ||
httpd.conf controls how the server behaves, at the bottom of the file it has directives to include configuration files ending in .conf in /etc/apache2/modules.d & /etc/apache2/vhosts.d | httpd.conf controls how the server behaves, at the bottom of the file it has directives to include configuration files ending in .conf in /etc/apache2/modules.d & /etc/apache2/vhosts.d | ||
== Service == | == Service == | ||
Line 41: | Line 36: | ||
To start apache upon boot: | To start apache upon boot: | ||
<console>###i## rc-update add apache2</console> | <console>###i## rc-update add apache2</console> | ||
== mod_rewrite == | |||
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. | |||
{{fancynote|If you want to test this for web applications such as mediawiki adjust the path to /var/www/localhost/htdocs/mediawiki/.htaccess & so on}} | |||
{{file|name=/var/www/localhost/htdocs/.htaccess|desc=enable the rewrite engine|body= | |||
RewriteEngine on | |||
RewriteRule ^test.html$ rewrite.html | |||
}} | |||
{{file|name=/var/www/localhost/htdocs/test.html|desc=set system wide apache2 useflag|body= | |||
rewrite is not working | |||
}} | |||
{{file|name=/var/www/localhost/htdocs/rewrite.html|desc=set system wide apache2 useflag|body= | |||
rewrite is working | |||
}} | |||
Then point your browser @ http://127.0.0.1/test.html the text from rewrite.html should be loaded. | |||
{{EbuildFooter}} | {{EbuildFooter}} |
Revision as of 16:35, August 27, 2014
Apache
We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.
apache is a powerful web server. apache serves html/css/cgi/pl out of the box, and other languages/frameworks via extensions.
Install
root # emerge apache
Configuration
System
Many packages have apache2 use flags, and require them to be supported by apache. Setting a system wide apache2 use flag is a good idea.
/etc/portage/make.conf
- set system wide apache2 useflagUSE="apache2 ..........."
Package
Apache's configuration files are broken up and located in several spots.
/etc/conf.d/apache2
/etc/apache2/httpd.conf
/etc/apache2/modules.d/*
/etc/apache2/vhosts.d/*
conf.d controls the init script, adding things to it such as -D SECURITY & -D PHP5 will enable web application fire-walling & the php scripting language.
httpd.conf controls how the server behaves, at the bottom of the file it has directives to include configuration files ending in .conf in /etc/apache2/modules.d & /etc/apache2/vhosts.d
Service
To start apache immediately:
root # rc-service apache2 start
To start apache upon boot:
root # rc-update add apache2
mod_rewrite
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.
If you want to test this for web applications such as mediawiki adjust the path to /var/www/localhost/htdocs/mediawiki/.htaccess & so on
/var/www/localhost/htdocs/.htaccess
- enable the rewrite engineRewriteEngine on
RewriteRule ^test.html$ rewrite.html
/var/www/localhost/htdocs/test.html
- set system wide apache2 useflagrewrite is not working
/var/www/localhost/htdocs/rewrite.html
- set system wide apache2 useflagrewrite is working
Then point your browser @ http://127.0.0.1/test.html the text from rewrite.html should be loaded.