<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Latest snippets tagged apache</title>
  <link rel="alternate" href="http://snippets.prendreuncafe.com/snippets/tagged/apache/order_by/date"></link>
  <id>http://snippets.prendreuncafe.com/snippets/tagged/apache/order_by/date</id>
  <updated>2007-10-09T14:51:43Z</updated>
  <author>
    <name>Symfony</name>
    <author_email>noreply@symfony-project.com</author_email>
  </author>
<entry>
  <title>Configuration de base d'un VHost pour Apache</title>
  <link href="http://snippets.prendreuncafe.com/snippet/70"></link>
  <updated>2007-10-09T14:51:43Z</updated>
  <id>70</id>
  <summary type="html">[code]
NameVirtualHost www.mywebsite.com:port
&lt;VirtualHost www.mywebsite.com:port&gt;

ServerAdmin admin@mywebsite.com
DocumentRoot /path_to_htdocs/
&lt;Directory /&gt;
Options FollowSymLinks
AllowOverride None
&lt;/Directory&gt;
&lt;Directory /path_to_htdocs/&gt;
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
&lt;/Directory&gt;
ErrorLog /var/log/apache2/error-mywebsite.log
LogLevel warn
CustomLog /var/log/apache2/access-mywebsite.log combined
&lt;/VirtualHost&gt;
[/code]

A placer dans un fichier dans /etc/apache2/sites-enable/</summary>
</entry>
<entry>
  <title>Redirect HTTP -&gt; HTTPS requests in a VirtualHost</title>
  <link href="http://snippets.prendreuncafe.com/snippet/26"></link>
  <updated>2006-12-19T11:35:21Z</updated>
  <id>26</id>
  <summary type="html">[code]
&lt;VirtualHost 100.101.102.103:80&gt;

  ServerName    subdomain.domain.tld
  DocumentRoot  /path/to/docroot

  &lt;IfModule mod_rewrite.c&gt;
    RewriteEngine   on
    RewriteLog      /var/log/apache2/https_rewrite.log
    RewriteLogLevel 1
    RewriteCond     %{SERVER_PORT} !^443$
    RewriteCond     %{SERVER_NAME} ^subdomain.domain.tld$
    RewriteRule     ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
  &lt;/IfModule&gt;

&lt;/VirtualHost&gt;

&lt;VirtualHost 100.101.102.103:443&gt;

  ServerName    subdomain.domain.tld
  DocumentRoot  /path/to/docroot

  SSLEngine On
  SSLCertificateFile     /etc/apache2/ssl_conf/myservicename.crt
  SSLCertificateKeyFile  /etc/apache2/ssl_conf/myservicename.key


&lt;/VirtualHost&gt;
[/code]</summary>
</entry>
</feed>
