Implement https on apache 2.0.55

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Implement https on apache 2.0.55
# 1  
Old 01-27-2009
Implement https on apache 2.0.55

I have been trying to implement https auto-redirect for a particular links. I have three configuration file /etc/apache2/apache2.conf, /etc/apache2/sites-available/default, and /etc/apache2/sites-available/ssl. In /etc/apache2/sites-available/default file I added following script
<IfModule mod_proxy.c>
ProxyRequests Off
RewriteEngine on
# send all http to https
RewriteCond %{HTTPS} !=on
RewriteRule (.*)$$1 [R]
But it is not working.

Can somebody tell me what am I missing?
Thanks in advance.
# 2  
Old 01-27-2009
The Rewrite lines look OK.

Why is the Rewrite code inside the mod_proxy stuff? Are you sure mod_proxy is being loaded prior to this config line? Put it touside the <ifmodule mod_proxy.c> stuff and see what happens.
# 3  
Old 01-28-2009
HTTPS redirect on apache

mod_proxy.c is located under directory /usr/lib/apache2/modules/. I assume that means it is enabled.

My second try.
I added following syntax on the bottom of file, /etc/apache2/apache2.conf

RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) https://mylink.edy/~username/login.php/$1 [L,R]

It is still not working.
Can somebody tell me what modules do I need and how I enable them?
# 4  
Old 01-28-2009
Originally Posted by kumarrana
mod_proxy.c is located under directory /usr/lib/apache2/modules/. I assume that means it is enabled.
No. You mus specifically tell Apache to use mod_proxy.

It is still not working.
Can somebody tell me what modules do I need and how I enable them?
The Rewrite Module is enabled; otherwise, these directives would fail.

Are you sure SSL is enabled?? Try this:
RewriteRule ^fubar$ [R]

Now reload the config, visit your server's address with "fubar" as the destination. If you don't get redirected to The UNIX and Linux Forums - Learn UNIX and Linux from Experts, then it's possible that portion of the configuration is never being hit.

One reason can be that your config has VirtualHosts and you are visiting such a VirtualHost which somehow overrides the RewriteEngine settings.
# 5  
Old 01-29-2009
Yes. SSL is enabled. I can browse site using http and https since root directory set for both are same. Biggest confusion is which file do I use to configure auto-redirect. I using this link for reference.

AFP548 - Redirect http to https
# 6  
Old 01-29-2009
Did you try my fubar rewrite rule?

Theoretically, any config file read in by httpd.conf can be used to configure the Rewrite rules.
# 7  
Old 02-03-2009
Sorry otheus, It took so long to replay your message. Your fubar rewrite rule did not work on any of three config files. What am I missing? Can you tell me how to activate what module for rewrite?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Apache - tcpdump get HTTP and HTTPS Headers

Hello I googled for "tcpdump view HOST http headers" -- that fine However can we do same for HTTPS like after the HTTPS gets decrypted by Apache ? I think this is legitimate on the server where the site is hosted since at some point the Apache itself needs to get the HOST patrameter in... (1 Reply)
Discussion started by: coolatt
1 Replies

2. Solaris

Need suggestion:- Failed HTTPS transfer to

Hi Guys, I have recently started reciving below Error message Failed HTTPS transfer to whenever I run /usr/local/bin/sudo /opt/SUNWexplo/bin/explorer -P -q -v from all Servers. Looks like the SSL certificate as Expired. Whenever I type... (4 Replies)
Discussion started by: manalisharmabe
4 Replies

3. Cybersecurity


Is it possible to rule out in alert all HTTPS traffic or rule out all the HTTPS trafic from the alerts on snort ? (3 Replies)
Discussion started by: drd0spt
3 Replies

4. Web Development

redirect http to https in apache

i read thru a few article how to do it, but i could not get it to work the way i want it. vi ../httpd.conf Redirect permanent /dev https://servername/portal/ when i type servername, works fine. my goal is to type dev, and it takes me to https://servername/portal/ (4 Replies)
Discussion started by: lawsongeek
4 Replies

5. UNIX for Dummies Questions & Answers

Setting up HTTPS in Apache with Linux

I have recently setup a HTTP server using Apache. This was my first install of Apache, so I am very new to it. What I would now like to do is setup HTTPS for my server. Unfortunately, the official Apache 2.2 manual doesn't cover setting up HTTPS, and using Google search engine I have found... (2 Replies)
Discussion started by: SSL
2 Replies

6. UNIX for Dummies Questions & Answers

http to https Apache, AllowOverride All receives 403 err htaccess

Hi new to the forum, I have a Apache server on CentOS which hosts a web site. I've set up the SSL which has been tested as I can access my website via http and https. I would like to redirect all browsers to use https instead of http. I have created the htaccess file which contains 'Allow... (3 Replies)
Discussion started by: Sai245
3 Replies

7. Shell Programming and Scripting

How to implement this?

hi i have a file like 1,"A","B" 2,"C","D" 1,"E","F" 3,"G","H" in output i need like 3,"G","H" 1,"E","F" 2,"C","D" 1,"A","B" (12 Replies)
Discussion started by: angel12345
12 Replies

8. Shell Programming and Scripting

how to implement this

Hi all, could any of you please help me on my problem.. we are doing FTP (one report out put) from one server to another server through unix shell script program. Due to the network issues, some times FTP process is hanging. So we planned to modify the existing program with the following... (2 Replies)
Discussion started by: kishore_jasthi
2 Replies

9. UNIX for Dummies Questions & Answers

apache-ssl https-problem?

hi folks. i know that this is not a realī unix problem, itīs an apache-webserver problem, but maybe you can help me? i have installed apache & mod_ssl, done a certificate, and configured my server well, but apache only understands "http://servername", not "https://servername". any ideas? ... (1 Reply)
Discussion started by: loitschix
1 Replies
Login or Register to Ask a Question

Featured Tech Videos