Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Can't make http and https work at the same time |
|
Author |
|
williamchen180
Joined: 09 Feb 2011 Posts: 2
|
Posted: Wed 09 Feb '11 12:18 Post subject: Can't make http and https work at the same time |
|
|
Hi All,
This is really weird. I just can't make http and https work together. I will attach my httpd.conf below.
I try to make http and https work together with below httpd.conf. With this httpd.conf, 'https' works but 'http' doesn't. The reason 'http' doesn't work is that the server stops sending data to browser. For example:
Code: |
$ curl -v -v http://172.19.148.109
* About to connect() to 172.19.148.109 port 80 (#0)
* Trying 172.19.148.109... connected
* Connected to 172.19.148.109 (172.19.148.109) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.19.3 (i686-pc-linux-gnu) libcurl/7.19.3 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1
> Host: 172.19.148.109
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Wed, 09 Feb 2011 10:17:09 GMT
< Server: Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8k PHP/5.2.17
< X-Powered-By: PHP/5.2.17
< Set-Cookie: PHPSESSID=736ff90ed3806167558073e683187256; path=/
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Transfer-Encoding: chunked
< Content-Type: text/html
<
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="wd_nas/jquery_ui/themes/default/ui.all.css"/>
<link rel="stylesheet" type="text/css" href="wd_nas/global.css"/>
|
It just stops responding at almost the same place.
But I am sure the port 80 is bound by httpd because :
Code: |
$ telnet 172.19.148.109 80
Trying 172.19.148.109...
Connected to 172.19.148.109.
Escape character is '^]'.
GET / HTTP/1.1
HTTP/1.1 400 Bad Request
Date: Wed, 09 Feb 2011 10:06:28 GMT
Server: Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8k
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>
Connection closed by foreign host.
|
If I comment "Listen 443" like below, the http works and of course https doesn't work now.
Code: |
<IfModule mod_ssl.c>
NameVirtualHost *:443
#Listen 443
</IfModule>
|
I really have no idea how to make them work together. Please help if you know what the wrong is. Thanks a lot.
Here is my httpd.conf
Code: |
ServerRoot "/webserver"
Listen 80
<IfModule mod_ssl.c>
NameVirtualHost *:443
Listen 443
</IfModule>
LoadModule php5_module /webserver/modules/libphp5.so
PHPIniDir "/webserver/php"
RewriteEngine on
RewriteRule ^/(.*):SSL$ https://%{SERVER_NAME}/$1 [R,L]
RewriteRule ^/(.*):NOSSL$ http://%{SERVER_NAME}/$1 [R,L]
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User root
Group root
</IfModule>
</IfModule>
ServerAdmin you@example.com
DocumentRoot "/webserver/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "/webserver/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.php
</IfModule>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
ErrorLog "logs/error_log"
LogLevel debug
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/webserver/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "/webserver/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
DefaultType text/plain
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php .phtml
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
SSLRandomSeed startup file:/dev/urandom 1024
SSLRandomSeed connect file:/dev/urandom 1024
SSLSessionCache shm:/webserver/logs/ssl_cache_shm
SSLSessionCacheTimeout 600
SSLCertificateFile /tmp/WDTVPriv/.orion/server.crt
SSLCertificateKeyFile /tmp/WDTVPriv/.orion/server.key
SSLVerifyClient none
SSLProxyEngine off
<VirtualHost _default_:443>
DocumentRoot /webserver/htdocs
SSLEngine on
#SSLOptions +StrictRequire
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<IfModule mime.c>
AddType application/x-x509-ca-cert .cert
AddType application/x-pkcs7-crl .crl
</IfModule>
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
SSLProtocol -all +TLSv1 +SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM
</VirtualHost>
|
|
|
Back to top |
|
williamchen180
Joined: 09 Feb 2011 Posts: 2
|
Posted: Wed 09 Feb '11 13:43 Post subject: Re: Can't make http and https work at the same time |
|
|
For more information, I am doing this in MIPS platform.
I am using httpd-2.2.17 and busybox.
This is how I compile httpd:
Code: |
$ ./configure --prefix=/webserver --build=i686 --host=mipsel-linux --target=mipsel-linux --enable-so --enable-static-support --enable-cgi --enable-rewrite --enable-auth-digest --disable-suexec --enable-ssl --with-ssl=/home/william/working/rv.20110106/src/libs/../../build/binary/third_party_build/ --with-mpm=prefork
|
|
|
Back to top |
|
|
|
|
|
|