Some problems with Virtual Host setup and SSL
am 18.08.2007 11:55:04 von via.lej
Hello !
I've some problems with Virtual Hosts on Apache2, please have a look at=
my config files:
==================== =====
===3D
File sites-enabled/default
==================== =====
===3D
-------------------------------->
NameVirtualHost *
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, cr=
it,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
DocumentRoot /var/www/phpmyadmin
ServerSignature On
RewriteEngine on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
<---------------------------------------
==================== =====
=======3D
File sites-enabled/ssl
==================== =====
========
-------------------------------------->
NameVirtualHost *:443
# change: address of web admin
ServerAdmin webmaster@localhost
SSLEngine On
SSLCertificateFile /etc/ssl/CA/private/Administration-key-cert.pem
ServerSignature On
Options FollowSymLinks
AllowOverride None
ProxyHTMLLogVerbose On
ProxyHTMLExtended On
ProxyRequests Off
Order deny,allow
Allow from all
ProxyPass /ntop/ https://localhost:3000/
ProxyPassReverse /ntop/ https://localhost:3000/
<-------------------------------------------
When i go to http://server/, it redirects to https://server/ and i have =
a 404 error.
I just want to redirect http://admin.server/phpmyadmin (not http://serve=
r/phpmyadmin byt http://admin.server/phpmyadmin) to https://admin.server=
/phpmyadmin
I would also redirect the web pages of a software running on localhost:3=
000 (on the server) to https://admin.server/ntop/
How can i do that ?
Thanks !
Vianney
____________________________________________________________ __________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List modssl-users@modssl.org
Automated List Manager majordomo@modssl.org
RE: Some problems with Virtual Host setup and SSL (UNCLASSIFIED)
am 20.08.2007 20:26:41 von Dwight.Victor.ctr
This is a multi-part message in MIME format.
------=_NextPart_000_0046_01C7E303.D56D5DF0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Classification: UNCLASSIFIED
Caveats: NONE
Hi Vianney,
"When i go to http://server/, it redirects to https://server/ and i have a
404 error."
This is happening because you have this:
RewriteEngine on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
in your main VirtualHost definition. If you have SSL enabled, any request
for anything (signified by the ^.*$) would be redirected to the https
server. Do you have a default page setup? Check your httpd.conf file to
see what suffixes are set.
"I just want to redirect http://admin.server/phpmyadmin (not
http://server/phpmyadmin byt http://admin.server/phpmyadmin) to
https://admin.server/phpmyadmin"
Does your server have a DNS record for "admin" or do you have something in
your /etc/hosts file that points to "admin?" This syntax "admin.domain"
usually means that you want to get to the "admin" machine on the "domain"
domain. To set this up, you have to have something that tells Apache which
machine will answer to the name "admin." Then you'll want to edit your
rewrite rule to just redirect calls to "admin.domain."
"I would also redirect the web pages of a software running on localhost:3000
(on the server) to https://admin.server/ntop/"
Read up on the use of the mod_rewrite module:
For Apache 1.3 => http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
For Apache 2 => http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
Hope that helps,
Dwight...
---
Dwight Victor, CISSP (Contractor)
DISA-PAC EMSS Gateway Hawaii
EMAIL: dwight.victor.ctr@disa.mil
TEL: (808) 653-3677 ext 229
Classification: UNCLASSIFIED
Caveats: NONE
------=_NextPart_000_0046_01C7E303.D56D5DF0
Content-Type: application/x-pkcs7-signature;
name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="smime.p7s"
MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEH AQAAoII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E2vFlvQADNFVHp
WLOhrmG/M82EMwJJpgaINJTnHJuTxT11UIVQ0RR7DylUHKpYhT6xHUxuDoVG XppqC9j3yEj+grpk
NZm8p6uTaOdNer39Z8qOwvt6yfAYRwPMVSIAAAAAAAA=
------=_NextPart_000_0046_01C7E303.D56D5DF0--
____________________________________________________________ __________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List modssl-users@modssl.org
Automated List Manager majordomo@modssl.org