Apache: Difference between revisions
Michał Szyda (talk | contribs) (+pl:Apache) |
m (Added link to spanish translation of page) |
||
(36 intermediate revisions by 14 users not shown) | |||
Line 1: | Line 1: | ||
{{Installing Moodle}} | |||
'''This article refers to the 'Apache HTTP server'''' | |||
The Apache HTTP | The Apache HTTP server is the software that (along with the PHP scripting language) 'runs' Moodle. Note that there are alternatives (e.g. IIS on Windows) but the Apache HTTP Server is very popular on all platforms. | ||
== Installing Apache == | == Installing Apache == | ||
Installers are available for most platforms from http://httpd.apache.org/download.cgi. The official installation instructions are here: http://httpd.apache.org/docs/2.0/install.html. If you are running Linux then you are recommended to use the packaged version if you can. For example in Debian/Ubuntu it is simply: | |||
<pre> | |||
sudo apt-get install apache2 | |||
</pre> | |||
See the documentation for your particular platform for the instructions. Apache is straightforward to build from source if you have to and the PHP documentation contains an article on building both Apache and PHP together - although you should rarely need to do that. | |||
==Performance== | ==Performance== | ||
See [[Performance recommendations]] | |||
==Slasharguments== | |||
The function ''slash arguments'' is required for various features in Moodle to work correctly, as described in [[Using slash arguments]]. | |||
To turn it on, add this line to your ''httpd.conf'', or to a ''.htaccess'' file in your local directory: | |||
AcceptPathInfo On | |||
==SSL== | |||
Moodle has an option to enable HTTPS for the whole site or for just the login pages; either option requires that your web server is configured for SSL. | |||
* Whole site HTTPS is enabled by including the https:// schema in your config.php 'wwwroot' parameter. | |||
* Login only HTTPS is enabled by setting the 'loginhttps' parameter, where the wwwroot schema should remain as http:// | |||
Prior to Moodle 2.3 It was not advised to run the whole site over HTTPS due to legacy restrictions with client-side caching. This is no longer the case assuming client browsers support the 'Cache-Control: public' method, which all supported browsers for this version of Moodle do. | |||
To use HTTPS you will need to obtain an SSL certificate, you have two options: | |||
* Generate a self-signed certificate. This is fine on (say) an Intranet but unsuitable for the public internet, but users will we warned the certificated is untrusted when used publicly. | |||
* Purchase a certificate from a vendor. There is a surprising range of prices and value-added services available. Some hosting companies even provide free certificates. | |||
Debian provides instructions for installing a self-signed certificate [https://wiki.debian.org/Self-Signed_Certificate on their wiki] and includes general information on configuring Apache for SSL. | |||
If you purchase a vendor certificate you will normally receive instructions for installing it. | |||
A basic Apache SSL configuration can be summarised as: | |||
Listen 443 | |||
NameVirtualHost *:443 | |||
<VirtualHost *:443> | |||
SSLEngine On | |||
SSLCertificateFile /path/to/your/certificate.crt | |||
SSLCertificateKeyFile /path/to/your/certificate.key | |||
... | |||
</VirtualHost> | |||
== See also == | == See also == | ||
Line 110: | Line 56: | ||
* [http://httpd.apache.org/ The Apache HTTP Server Project homepage] | * [http://httpd.apache.org/ The Apache HTTP Server Project homepage] | ||
* [http://en.wikipedia.org/wiki/Apache_HTTP_Server Wikipedia article on the Apache HTTP Server] | * [http://en.wikipedia.org/wiki/Apache_HTTP_Server Wikipedia article on the Apache HTTP Server] | ||
* [http://httpd.apache.org/docs/2.0/misc/perf-tuning.html Apache Performance Tuning article at the official homepage] | |||
* [https://els.earlham.edu/cayaraa/weblog/1468.html Making Moodle work with SSL] | |||
* [http://www.krufix.de/ Using the same Moodle twice in local network and Internet via SSL-Proxy] (in German) | |||
[[pl:Apache]] | [[pl:Apache]] | ||
[[ja:Apache]] | |||
[[de:Apache]] | |||
[[es:Apache]] |
Latest revision as of 19:30, 13 June 2015
This article refers to the 'Apache HTTP server'
The Apache HTTP server is the software that (along with the PHP scripting language) 'runs' Moodle. Note that there are alternatives (e.g. IIS on Windows) but the Apache HTTP Server is very popular on all platforms.
Installing Apache
Installers are available for most platforms from http://httpd.apache.org/download.cgi. The official installation instructions are here: http://httpd.apache.org/docs/2.0/install.html. If you are running Linux then you are recommended to use the packaged version if you can. For example in Debian/Ubuntu it is simply:
sudo apt-get install apache2
See the documentation for your particular platform for the instructions. Apache is straightforward to build from source if you have to and the PHP documentation contains an article on building both Apache and PHP together - although you should rarely need to do that.
Performance
See Performance recommendations
Slasharguments
The function slash arguments is required for various features in Moodle to work correctly, as described in Using slash arguments.
To turn it on, add this line to your httpd.conf, or to a .htaccess file in your local directory:
AcceptPathInfo On
SSL
Moodle has an option to enable HTTPS for the whole site or for just the login pages; either option requires that your web server is configured for SSL.
- Whole site HTTPS is enabled by including the https:// schema in your config.php 'wwwroot' parameter.
- Login only HTTPS is enabled by setting the 'loginhttps' parameter, where the wwwroot schema should remain as http://
Prior to Moodle 2.3 It was not advised to run the whole site over HTTPS due to legacy restrictions with client-side caching. This is no longer the case assuming client browsers support the 'Cache-Control: public' method, which all supported browsers for this version of Moodle do.
To use HTTPS you will need to obtain an SSL certificate, you have two options:
- Generate a self-signed certificate. This is fine on (say) an Intranet but unsuitable for the public internet, but users will we warned the certificated is untrusted when used publicly.
- Purchase a certificate from a vendor. There is a surprising range of prices and value-added services available. Some hosting companies even provide free certificates.
Debian provides instructions for installing a self-signed certificate on their wiki and includes general information on configuring Apache for SSL. If you purchase a vendor certificate you will normally receive instructions for installing it.
A basic Apache SSL configuration can be summarised as:
Listen 443 NameVirtualHost *:443 <VirtualHost *:443> SSLEngine On SSLCertificateFile /path/to/your/certificate.crt SSLCertificateKeyFile /path/to/your/certificate.key ... </VirtualHost>