# Apache configuration

**URL:** <https://www.ruby-forum.com/t/apache-configuration/160885>\
**Category:** Rails\
**Created:** [February 20, 2009, 5:09pm UTC](https://www.ruby-forum.com/t/apache-configuration/160885 "2009-02-20T17:09:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashikalim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@ashikalim](https://www.ruby-forum.com/u/ashikalim)\
**Post date:** [February 20, 2009, 5:09pm UTC](https://www.ruby-forum.com/t/apache-configuration/160885/1 "2009-02-20T17:09:28Z")

</div>

To configure https we need .pem certificate file. it has both  
certificate  
and private and public keys .

Using this I configured https in apache . It is working nice . My client  
says that he send the https request using post method .

Also he says that data in post method will be encrypted .  
like this ,

data=‘msisdn=919822222222&PTRefId=12345236789012345678&PTDateTime=20090120123020&custid=1234567890&messageType=50011’  
( will be encrypted )

then he post this data using post method .

In the https scenario , I have configured my cerificate in appache  
configuration  
file .

Do I need any decryption method to decrypt this in my rails application  
?

(or)

appache is enough to do this . I request you clarify my doubts .

---

<div class="post-metadata">

**Author:** ![ashikalim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@ashikalim](https://www.ruby-forum.com/u/ashikalim)\
**Post date:** [February 20, 2009, 5:13pm UTC](https://www.ruby-forum.com/t/apache-configuration/160885/2 "2009-02-20T17:13:13Z")

</div>

On 20 Feb 2009, at 16:09, Ashikali A. wrote:

> In the https scenario , I have configured my cerificate in appache  
> configuration  
> file .

> Do I need any decryption method to decrypt this in my rails  
> application  
> ?

As far as https is concerned that will all be handled by apache.

Fred

---

<div class="post-metadata">

**Author:** ![ashikalim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@ashikalim](https://www.ruby-forum.com/u/ashikalim)\
**Post date:** [February 20, 2009, 5:37pm UTC](https://www.ruby-forum.com/t/apache-configuration/160885/3 "2009-02-20T17:37:38Z")

</div>

Frederick C. wrote:

> On 20 Feb 2009, at 16:09, Ashikali A. wrote:
> 
> > In the https scenario , I have configured my cerificate in appache  
> > configuration  
> > file .
> 
> > Do I need any decryption method to decrypt this in my rails  
> > application  
> > ?
> 
> As far as https is concerned that will all be handled by apache.
> 
> Fred

Thank you so much Fred .

I have lot of confusing over here .

Doubts :  
Please see this ruby code ,

require ‘net/http’  
require ‘net/https’

http = Net::HTTP.new(‘192.168.1.191’ , 443 )  
http.use\_ssl = true  
p http.peer\_cert  
path = ‘/main/test’  
data =  
‘msisdn=919822222222&PTRefId=12345236789012345678&PTDateTime=20090120123020&custid=1234567890&messageType=50011’  
resp, data = http.post(path, data, nil )  
puts( resp,data )

Here I am posting this data to my https apache server . Being a client  
I have to encrypt this data using public key . But here I didn’t do any  
encryption using certificate public key . But this is working how ?

can you explain me ?

cheers ,  
ashikali

---

<div class="post-metadata">

**Author:** ![ashikalim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@ashikalim](https://www.ruby-forum.com/u/ashikalim)\
**Post date:** [February 20, 2009, 6:13pm UTC](https://www.ruby-forum.com/t/apache-configuration/160885/4 "2009-02-20T18:13:00Z")

</div>

Frederick C. wrote:

> On 20 Feb 2009, at 16:37, Ashikali A. wrote:
> 
> > ,data )
> > 
> > Here I am posting this data to my https apache server . Being a client  
> > I have to encrypt this data using public key . But here I didn’t do  
> > any  
> > encryption using certificate public key . But this is working how ?
> > 
> > can you explain me ?
> 
> net/http does all the ssl stuff for you (and so for you the only  
> difference between ssl and not ssl is a different port and setting  
> that use\_ssl property.
> 
> Fred

I could not understand this ,

(and so for you the only difference between ssl and not ssl is a  
different port and setting that use\_ssl property )

cheers ,  
ashikali

---

<div class="post-metadata">

**Author:** ![ashikalim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@ashikalim](https://www.ruby-forum.com/u/ashikalim)\
**Post date:** [February 20, 2009, 5:55pm UTC](https://www.ruby-forum.com/t/apache-configuration/160885/5 "2009-02-20T17:55:15Z")

</div>

On 20 Feb 2009, at 16:37, Ashikali A. wrote:

> ,data )
> 
> Here I am posting this data to my https apache server . Being a client  
> I have to encrypt this data using public key . But here I didn’t do  
> any  
> encryption using certificate public key . But this is working how ?
> 
> can you explain me ?

net/http does all the ssl stuff for you (and so for you the only  
difference between ssl and not ssl is a different port and setting  
that use\_ssl property.

Fred

---

<div class="post-metadata">

**Author:** ![ashikalim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@ashikalim](https://www.ruby-forum.com/u/ashikalim)\
**Post date:** [February 20, 2009, 7:56pm UTC](https://www.ruby-forum.com/t/apache-configuration/160885/6 "2009-02-20T19:56:36Z")

</div>

On 20 Feb 2009, at 17:13, Ashikali A. wrote:

> > > encryption using certificate public key . But this is working how ?
> 
> (and so for you the only difference between ssl and not ssl is a  
> different port and setting that use\_ssl property )

I’m saying that for a person using net::http all you have to do is set  
use\_ssl and connect to a different port.

Fred

---

<div class="post-metadata">

**Author:** ![ashikalim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@ashikalim](https://www.ruby-forum.com/u/ashikalim)\
**Post date:** [February 21, 2009, 6:14am UTC](https://www.ruby-forum.com/t/apache-configuration/160885/7 "2009-02-21T06:14:40Z")

</div>

Frederick C. wrote:

> On 20 Feb 2009, at 17:13, Ashikali A. wrote:
> 
> > > > encryption using certificate public key . But this is working how ?
> > 
> > (and so for you the only difference between ssl and not ssl is a  
> > different port and setting that use\_ssl property )
> 
> I’m saying that for a person using net::http all you have to do is set  
> use\_ssl and connect to a different port.
> 
> Fred

I grasped from your point . Thank you so much .

In linux debian apache I configured like this  
/etc/apache2/sites-available/default  
NameVirtualHost \*  
\<VirtualHost \*\>  
ServerAdmin webmaster@localhost  
DocumentRoot /var/www/vetrivel/public/  
SSLEngine on

```
    SSLCertificateFile /etc/ssl/certs/mycert.pem

    <Directory /var/www/vetrivel/public/>
                  Options ExecCGI FollowSymLinks
                  AllowOverride all
                  Order allow,deny
                  Allow from all
    </Directory>

```

I disable the 80 port and I enabled 443 port . Then I have created  
certificate file mycert.pem using openssl( linux based ) . Then I did  
restart my apache daemon . When I call URL in firefox browser it is  
working  
fine no problem .

If I use C# ( as a browser( as a client ) ) in windows instead of linux  
ruby( refer ruby https post request )  
whether it will work or not ? Do I need to do any changes on creating  
mycert.pem  
file or I have to change any configuration settings on apache to do this  
. I request you to clarify my doubts .

cheers ,  
ashikali
