Forum Moderators: phranque

Message Too Old, No Replies

Turning off HTTP on Apache

         

AndyGanapathy

7:55 am on Jul 23, 2004 (gmt 0)

10+ Year Member



Hello All,

I need to turn of the HTTP port 80 on Apache web server and use only HTTPS 443 in a highly secure environment.

Tried commenting the lines with PORT 80 (the HTTP port, ref #ANDY COMMENT) in httpd.conf, but this doesn't work.

#
# Port: The port to which the standalone server listens. For
# ports < 1023, you will need httpd to be run as root initially.
#
#ANDY COMMENT Port 80

##
## SSL Support
##
## When we also provide SSL we have to listen to the
## standard HTTP port (see above) and to the HTTPS port
##
<IfDefine SSL>
#ANDY COMMENT Listen 80
Listen 443
</IfDefine>

Is it possible to achieve the same? If so please let me know how?

Thanks in advance,
Anand

gergoe

1:33 pm on Jul 23, 2004 (gmt 0)

10+ Year Member



Not completelly sure but you may need to have a Port directive defined, which becomes the default port.

What is the problem with this configuration? You got an error, or the apache is not listening on any of the ports or what else?

AndyGanapathy

5:44 am on Jul 27, 2004 (gmt 0)

10+ Year Member



No.There is no problem with this config. I specifically need to turn of the HTTP port and use only HTTPS in a highly secure environment

quebrada

6:11 pm on Jul 27, 2004 (gmt 0)

10+ Year Member



Woud a firewall blocking port 80 be a option?

encyclo

6:29 pm on Jul 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are running a public server, I would perhaps look at allowing connections to port 80, but redirecting immediately any requests to the the secure server on port 443. This will avoid any problems if a user tries to type in your address but doesn't realize the address starts with https - if the server gives no response, the user is likely to think that your site is down rather than just on another port.

You could use a simple redirect like:

Redirect permanent / https://www.example.com/

hayseed

6:34 pm on Jul 27, 2004 (gmt 0)

10+ Year Member



In httpd.conf on my W2K test server, I've defined the following directive:

# see [modssl.org...] for more info
SSLMutex sem
SSLRandomSeed startup builtin
SSLSessionCache none

SSLProtocol -all +SSLv3
SSLCipherSuite HIGH:MEDIUM

SSLLog logs/SSL.log
# SSLLogLevel info
SSLLogLevel warn

<virtualhost localhost:443>
SSLEngine On
SSLCertificateFile conf/ssl/localhost.cert
SSLCertificateKeyFile conf/ssl/localhost.key
</virtualhost>

<Directory "C:/server/htdocs/admin/phpMyAdmin">
SSLRequireSSL
</Directory>

I haven't tried it, but maybe specifiying that your entire htdocs directory "RequireSSL" would work?

hayseed

6:41 pm on Jul 27, 2004 (gmt 0)

10+ Year Member



But maybe encyclo's mod_alias suggestion is your key. I'd try that first.