PDA

View Full Version : Apache HTTPS


johntp
2007-01-02, 10:40 AM CST
Hey all,

I installed phpmyadmin (not a bit deal) but when I was configuring it one of the pages alerted me to the fact that I wasn't using a secure server (I knew this) but then I wondered. How would I configure apache if I wanted it to include https:// requests? I'm a web-developer of sorts and there will definately be a time I want to use this. Do you kinda know what I'm saying? Anyway, thanks for the help.


Thank a lot,
-John

mndar
2007-01-02, 11:47 AM CST
To accept https:// requests,open up /etc/httpd/conf.d/ssl.conf
Uncomment if commented or Add

Listen 443
<VirtualHost _default_:443>
DocumentRoot "/var/www/html"
ServerName somename:443

johntp
2007-01-02, 07:29 PM CST
Listen 443
<VirtualHost _default_:443>
DocumentRoot "/var/www/html"
ServerName localhost:443

I tried what you said so I put ^^^ in my otherwise empty ssl.conf file. Note the bold is what I changed

Then I got an error starting httpd so I put "</VirtualHost>" at the bottom of it. Httpd started fine. However, when I go to https://localhost the page doesn't load. Firefox says "The connection was interupted." I dont' know if the problem is it doesn't know where to go for the site or what. Anyway, any idea what could be the matter?

-John

daverj
2007-01-02, 09:52 PM CST
what is the output of nmap localhost? It will show the open ports.

mndar
2007-01-02, 10:42 PM CST
ssl.conf file should not have been empty. Double check the location
ssl.conf should be in /etc/httpd/conf.d not /etc/httpd/conf
I am attaching my ssl.conf in case you need it for reference.

johntp
2007-01-03, 12:11 PM CST
Ok, I basicly took your ssl.conf and make it mine. Restarted apache.... good. However, it still says "connection interrupted in firefox and yes port 443 is definately open.

[root@localhost ~]# nmap localhost

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2007-01-03 12:21 MST
Interesting ports on localhost (127.0.0.1):
Not shown: 1672 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp open rpcbind
443/tcp open https
969/tcp open unknown
3306/tcp open mysql
10000/tcp open snet-sensor-mgmt

Nmap finished: 1 IP address (1 host up) scanned in 0.082 seconds
You have new mail in /var/spool/mail/root

Zigzagcom
2007-01-03, 08:24 PM CST
What does your /etc/hosts file say?

johntp
2007-01-03, 09:40 PM CST
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost

When I start httpd (apache2) I also am getting this warning...

Starting httpd: httpd: apr_sockaddr_info_get() failed for localhost.localdomain
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName


Any idea what could be the matter with that?

mndar
2007-01-04, 01:33 PM CST
Modify your /etc/hosts . Change the 3rd line to
127.0.0.1 localhost localhost.localdomain

In httpd.conf , Uncomment the line
ServerName <somename>
Change it to
ServerName localhost

If this doesn't solve your problem, just remove apache, delete all the config files and then install it again. Its possible that your configuration files are messed up