# HTTPS with Apache2?

## RobinVossen

First remember, I am new to Apache. I never really used it..

But, well I need to add SSL Support to it.

So, I did read: http://gentoo-wiki.com/Apache_Modules_mod_ssl

I did emerge apache2 with the SSL USE-Flag

but later on in  the guide I need to do:

```

In /etc/apache2/modules.d/41_mod_ssl.default-vhost.conf make sure the following are correct:

SSLCertificateFile /etc/apache2/ssl/server.crt

SSLCertificateKeyFile /etc/apache2/ssl/server.key 

```

But, well the file isnt there.

So I did look at "http://www.modssl.org/source/" but I need apache 1.3.x for that.

I wonder now, what did I do wrong?

Cheers,

Robin

----------

## bunder

if you followed the howto, you created those files in the first step.  move them into the proper directory and check /etc/conf.d/apache for the -D SSL option.

cheers

----------

## RobinVossen

I did follow the how to..

and well it says:

emerge -pv apache. If " ssl" is highlighted in red, you are good to go

That was true so I was good to go.

The 40_mod_ssl is there. but the 41_mod_ssl.default-vhost.conf isnt.

Cheers,

Robin

----------

## elgato319

Which apache version do you use?

in 2.2.x the correct file would be: /etc/apache2/vhosts.d/00_default_ssl_vhost.conf

if you compiled apache with ssl support you should enable it in conf.d/apache2 and restart apache

```

-D SSL -D SSL_DEFAULT_VHOST

```

----------

## RobinVossen

Well I use apache2 and I did compile it with ssl.

But I dont have the vhost file :S

Ill try that Method later on. (for if you didnt compile ssl) but I know 100% I did do ssl.

----------

## RobinVossen

When i do /etc/conf.d/apache2 -D SSL -D SSL_DEFAULT_VHOST

I get access denied when I run as root..

----------

## Anarcho

 *RobinVossen wrote:*   

> When i do /etc/conf.d/apache2 -D SSL -D SSL_DEFAULT_VHOST
> 
> I get access denied when I run as root..

 

Hehe  :Wink: 

You should edit the file "/etc/conf.d/apache2" and add "-D SSL -D SSL_DEFAULT_VHOST" to the options there.

Best regards from your neighbour country!

----------

## RobinVossen

Damn... Well I always am a Moron when we are talking about apache..

I already did set it up.. but I didnt know -.-'

The defaults were ok for me..

I thought that SSL only was the law instatly.  :Wink: 

But well so I try to connect now using HTTPS and I get..

```
Alert <ip> has sent an incorrect or unexpected message. Error Code: -12263
```

so i get I do something wrong after all.. -.-'

Cheers, from your Neighbor.. Nice airport btw..

----------

## RobinVossen

BUMP  :Smile: 

I am not 100% if I am allowed to Brint Up My Post .. But well I still have lots of problems with HTTPS.

Same problem.

Cheers,

Robin

Edit:

I get the error -12263..

Can this be that the website is under 10080 that get redirrected by the NAT -> portforwarded to port 80

so: Website:10080 <-NAT-> Server:80

Can this Include with the Problem?

Cheers,

Robin

----------

## newtonian

Hi-

After doing some googling on this it seems that your error message is often related to not adding

 *Quote:*   

> SSLEngine on 

 

to the site's conf file ie. vhosts.conf

Cheers,

----------

## andreas_st

 *RobinVossen wrote:*   

> Can this be that the website is under 10080 that get redirrected by the NAT -> portforwarded to port 80
> 
> so: Website:10080 <-NAT-> Server:80
> 
> 

 

HTTPS happens on port 443. You will probably need another port forwarded from your NAT router.

----------

