Results 1 to 5 of 5
Hi, all
I want to config "phpmyadmin" site with https. But it works on port 65533 instead of the default 443.
This is my configuration:
Code:
LoadModule rewrite_module modules/mod_rewrite.so
listen ...
- 12-20-2008 #1Just Joined!
- Join Date
- Sep 2005
- Location
- China
- Posts
- 37
http to https rewrite rule of apache
Hi, all
I want to config "phpmyadmin" site with https. But it works on port 65533 instead of the default 443.
This is my configuration:
But it doesn't work, maybe there's something wrong with the rewriterule. Any ideas? Thanks a lot.Code:LoadModule rewrite_module modules/mod_rewrite.so listen 65533 <VirtualHost *:65533> DocumentRoot /var/www/phpMyAdmin2 SSLEngine on SSLCertificateFile /etc/pki/tls/certs/cert.crt SSLCertificateKeyFile /etc/pki/tls/certs/key.key RewriteEngine On RewriteCond %{SERVER_PORT} ^65533$ RewriteRule ^/?(.*)$ https://%{SERVER_NAME}/$1[L,R] </VirtualHost>
- 12-21-2008 #2
this should be defined in your port 80 virtual host container. you want to be able to hit http://yoursite.com and be redirected to https://yoursite.com
ort#
so you have to grab the request at the http level. I am guessing that is what you want from your title.
- 12-21-2008 #3Just Joined!
- Join Date
- Oct 2005
- Location
- India
- Posts
- 23
Redirect..
Redirect rule can be used in .htaccess file to redirect url. The way I can suggest you is to change the <VirtualHost *:65533> to <VirtualHost *:443>. Make sure under /etc/services file below 2 lines are present,
https 443/tcp # MCom
https 443/udp # MCom
Hope this helps..
- 12-21-2008 #4Just Joined!
- Join Date
- Sep 2005
- Location
- China
- Posts
- 37
Unfortunatily, there's another site runs on port 443, the rewrite works well. the rewriterule is:
And I don't want the mysql administration site open to the public. But thank you all the same. I guess there must be a http virtual host works on 65533 to make the rewrite-rule work, even it's an empty folder. But the APACHE doesn't allow me to create 2 sites on the same portCode:RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/?(.*)$ https://%{SERVER_NAME}/$1 [L,R]
- 12-21-2008 #5Just Joined!
- Join Date
- Sep 2005
- Location
- China
- Posts
- 37
I want to visit the "phpmyadmin" through the url "http://domainname:65533", and then the url will be rewrited to "https://domainname:65533" automatically by Apache2.
Now there's a "https" site works on port 65533, When I type "domainname:65533" in the browser, the browser would add "http://" head automatically. Of course, the "Apache2" returns me an error page like this:
Any suggestions are welcome. Thanks a lot.Code:Bad Request Your browser sent a request that this server could not understand. Reason: You're speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please. Hint: https://domainname:65533/


Reply With Quote
