how to enable HTTPS for localhost:8080 - li'l urgent please

Alles, was den Apache betrifft, kann hier besprochen werden.

how to enable HTTPS for localhost:8080 - li'l urgent please

Postby hassanali20 » 03. May 2011 10:05

Hi friends,

i'm struggling to make use of HTTPS on my apache local server running on different port. Everything is fine if I make apache run on 80 (http) and 443 (https) but my setup is not like that.

80 is used by IIS server

I've configured 8080 for apache which works fine

now, how do i make https://<mylocalhost>:8080 works

is this correct
Code: Select all
Listen 443
Listen 8080

<VirtualHost *:443>
 
  DocumentRoot "<path to the project folder>"
  ServerName localhost:8080
  ServerAlias localhost:8080

  SSLEngine On
  SSLCertificateFile conf/ssl/server.crt
  SSLCertificateKeyFile conf/ssl/server.key
  <Directory "d:/csd/crimefreeze">
    AllowOverride all
    Options +Includes +Indexes +FollowSymLinks
    Allow from all
  </Directory>
</VirtualHost>



please help me with right configuration.

regards
hassan
hassanali20
 
Posts: 4
Joined: 03. May 2011 10:01

Re: how to enable HTTPS for localhost:8080 - li'l urgent ple

Postby Nobbie » 03. May 2011 10:55

hassanali20 wrote:how do i make https://<mylocalhost>:8080 works


Das geht nicht, man kann nicht http und https auf dem gleichen Port laufen lassen. Wenn man für http den Port 8080 wählt, muss man für https einen anderen Port definieren.
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: how to enable HTTPS for localhost:8080 - li'l urgent ple

Postby hassanali20 » 03. May 2011 11:02

thanks for the reply. but how do I do it, kindly give me the steps to configure the https to be used with 8080 (https://localhost:8080)
hassanali20
 
Posts: 4
Joined: 03. May 2011 10:01

Re: how to enable HTTPS for localhost:8080 - li'l urgent ple

Postby Nobbie » 03. May 2011 11:07

hassanali20 wrote:thanks for the reply. but how do I do it, kindly give me the steps to configure the https to be used with 8080 (https://localhost:8080)


You cannot use port 8080 for both http and https!

If you want to use port 8080 for https://localhost:8080, you MUST USE A DIFFERENT PORT for http (for example 8888 or whatever you like, http://localhost:8888)

Got it now?!
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: how to enable HTTPS for localhost:8080 - li'l urgent ple

Postby hassanali20 » 03. May 2011 11:19

sorry friend, its confusing.

can i just get the virtualhost configuration?

all i want to do is browse a project http://localhost:8080 and https://localhost:8080

are you saying it should be http://localhost:8080 and https://localhost:8081 for the same project? if so how to configure the virtualhost stuff. please help.

thanks again for so quick replies.

hassan
hassanali20
 
Posts: 4
Joined: 03. May 2011 10:01

Re: how to enable HTTPS for localhost:8080 - li'l urgent ple

Postby hassanali20 » 03. May 2011 11:31

okay.

here is what i did and its working

Code: Select all
Listen 8080
Listen 8081
NameVirtualHost localhost:8081

<VirtualHost *:8081>
  DocumentRoot "project folder path"
  ServerName localhost
  ServerAlias localhost

  SSLEngine On
  SSLCertificateFile conf/ssl/server.crt
  SSLCertificateKeyFile conf/ssl/server.key
  <Directory "project folder path">
    AllowOverride all
    Options +Includes +Indexes +FollowSymLinks
    Allow from all
  </Directory>
</VirtualHost>

<VirtualHost *:8080>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "<project folder path>"
  <Directory "project folder path">
    AllowOverride all
    Options +Includes +Indexes +FollowSymLinks
    Allow from all
  </Directory>
</VirtualHost>
hassanali20
 
Posts: 4
Joined: 03. May 2011 10:01


Return to Apache

Who is online

Users browsing this forum: No registered users and 228 guests