Port 443/HTTPS Problem

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Port 443/HTTPS Problem

Postby ESC201 » 15. February 2008 04:06

Hi, I have to run apache on port 443. (Only 80 and 443 are unblocked from where I want to access my server and my ISP blocks incoming port 80.) but the only way to get to my server is to change the protocol to https in my browser. Is there any way to change this so that SSL and/or https is disabled in xampp? Or maybe something that automatically redirects traffic to https on my server? I really don't know where to go from here but any help or a point in the right direction would be awesome. Thanks. :)
ESC201
 
Posts: 3
Joined: 15. February 2008 03:58

Postby Izzy » 15. February 2008 05:12

Using .htaccess to redirect is one possible solution and these 3 Google searches may help you to sort a suitable redirect out:
htaccess redirect
htaccess redirect https and http
redirect http and https httpd.conf

You also may be able to find other search keywords to better refine the results as my links above are only a guide.

http to https seems to be the normal responses but those links above might seed some ideas for you to experiment with from https to http or look deeper in the search results for a possible solution.

BTW if you use mod_rewrite then you have to uncomment it in the httpd.conf file like so:
#LoadModule rewrite_module modules/mod_rewrite.so
to this:
LoadModule rewrite_module modules/mod_rewrite.so

Some Apache Docs for reference:
http://httpd.apache.org/docs/2.2/config ... l#htaccess
http://httpd.apache.org/docs/2.2/howto/htaccess.html
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
http://wiki.apache.org/httpd/Rewrite
http://httpd.apache.org/docs/2.2/rewrite/
http://httpd.apache.org/docs/2.2/rewrit ... guide.html
http://httpd.apache.org/docs/2.2/rewrit ... anced.html

This is an interesting subject and some research in to it's capabilities can only be helpful for you now and for the future.


One simple solution to get rid of the SSL components but requires you ad :443 to every browser request is to open the .\xampp\apache\conf\httpd.conf file in your text editor and comment out this line near the bottom of the file like so:
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf

to this:
# Secure (SSL/TLS) connections
# Include conf/extra/httpd-ssl.conf


Then up near the top of the file:
Listen 80
to this:
Listen 443

and this:
ServerName localhost:80
to this:
ServerName localhost:443

Save the httpd.conf file after making any edits then restarts Apache to have your edits recognized - and always make a backup of any conf or ini file before editing.

Now you would type this in your browser to get to localhost:
http://localhost:443
and to your web site:
http://mywebsite.com:443

I recommend you test some of the ideas in the Google searches as the above can be confusing for some of your site visitors.

Also look for the latest ridgewood posts as there is a DTX Control Panel that may also help you find a suitable solution.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby ESC201 » 18. February 2008 23:16

Izzy wrote:One simple solution to get rid of the SSL components but requires you ad :443 to every browser request is to open the .\xampp\apache\conf\httpd.conf file in your text editor and comment out this line near the bottom of the file like so:
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf

to this:
# Secure (SSL/TLS) connections
# Include conf/extra/httpd-ssl.conf


Then up near the top of the file:
Listen 80
to this:
Listen 443

and this:
ServerName localhost:80
to this:
ServerName localhost:443


Worked perfectly. Thank you! :D
ESC201
 
Posts: 3
Joined: 15. February 2008 03:58

Postby ESC201 » 26. February 2008 00:19

(Instead of starting a new thread I thought I'll reuse my existing one.)

Okay, so now I'm having a more complex HTTPS and SSL problem. I can only run my server on port 443. What I want to do is have my index page on HTTP and all subsequent pages on HTTPS. I've managed to do a .htaccess redirect in all pages I want to be on HTTPS and that works beautifully except that the HTTPS is on port 4443 so I need to change it to 443 and now I hit the problem, apache won't start if the HTTP and HTTPS port are both on 443. But I have no other option. Is there any way I can run HTTP and HTTPS on the same port and somehow tell apache not the put the index page (or root directory) on HTTPS? Once again, any help is awesome! :)
ESC201
 
Posts: 3
Joined: 15. February 2008 03:58

Postby willshire » 03. March 2008 00:42

That is what izzy suggested before, you have to use the .htaccess redirect to accomplish that. What I would do is change everything back to default ports. Now follow the .htaccess redirect instructions. There is no way you can have both on 443, and that is dumb anyways. Take a look at this for your situation. http://joseph.randomnetworks.com/archiv ... -htaccess/
willshire
 
Posts: 5
Joined: 23. September 2007 01:29


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 32 guests