OVH Cloud OVH Cloud

Problème de RewriteEngine en apache 2

1 réponse
Avatar
Jay Ar
bonjour,

j'ai le problème suivant, sur lequel je butte depuis
un certain moment!!
je voudrais, que chaque fois qu'on accède à ma page
sur le port 443, apache transforme la requête de http
en https.
Pour cela, j'ai activé mod_rewrite, et je vous donne
mon fichier de config à la fin du mail.
mais quand je tape http://mon_serveur:443/, il me dit
"Impossible d'afficher la page", et donc la
redirection n'a pas lieu..
Help!!

----------------
fichier de conf
----------------
Listen 443

#NameVirtualHost *

<VirtualHost *:443>

ServerAdmin webmaster@localhost
DocumentRoot /var/www/
#AllowCONNECT 443

SSLEngine on
SSLProtocol -all +SSLv2
SSLCertificateFile /root/cles/fichier.crt
SSLCertificateKeyFile /root/cles/fichier.key
#SSLProxyEngine on

# REWRITE
RewriteEngine on
RewriteLog "/var/log/apache2/rewrite_log"
RewriteLogLevel 250
RewriteRule ^/(.*):443$
https://%{SERVER_NAME}/$1 [R,L]


<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
MultiViews
AllowOverride All
Order allow,deny
allow from all
# This directive allows us to have
apache2's default start page
# in /apache2-default/, but still have
/ go to the right place
RedirectMatch ^/$ /apache2-default/
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews
+SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info,
notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

#SSLEngine on
#SSLCertificateFile /root/cles/fichier.crt
#SSLCertificateKeyFile /root/cles/fichier.key
#SSLProxyEngine on
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
#AllowCONNECT 80

# REWRITE
RewriteEngine on
RewriteLog "/var/log/apache2/rewrite_log"
RewriteLogLevel 250
RewriteRule ^/(.*):443$
https://%{SERVER_NAME}/$1 [R,L]


<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>

<Directory /var/www/>
Options Indexes FollowSymLinks
MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have
apache2's default start page
# in /apache2-default/, but still have
/ go to the right place
#RedirectMatch ^/$ /apache2-default/


</Directory>

ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info,
notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

ServerSignature On
SSLEngine off
</VirtualHost>
----------------------------------------------------






__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/


--
Pensez à lire la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench

Pensez à rajouter le mot ``spam'' dans vos champs "From" et "Reply-To:"

To UNSUBSCRIBE, email to debian-user-french-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

1 réponse

Avatar
Stephane Bortzmeyer
On Tue, Apr 05, 2005 at 12:11:38PM +0200,
Jay Ar wrote
a message of 147 lines which said:

je voudrais, que chaque fois qu'on accède à ma page sur le port 443,
apache transforme la requête de http en https.



Cela me semble impossible. En Shttp, on peut mais en httpS, SSL / TLS
doit etre en route dès le début de la connexion.

mais quand je tape http://mon_serveur:443/,



https://mon_serveur/ serait plus simple...


--
Pensez à lire la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench

Pensez à rajouter le mot ``spam'' dans vos champs "From" et "Reply-To:"

To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact