<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
-------- Original Message&nbsp; --------<br>
Subject: http and https<br>
From: <a class="moz-txt-link-abbreviated" href="mailto:edwardspl@ita.org.mo">edwardspl@ita.org.mo</a><br>
To: For users of Fedora <a class="moz-txt-link-rfc2396E" href="mailto:fedora-list@redhat.com">&lt;fedora-list@redhat.com&gt;</a><br>
Date: 09/21/2007 10:06 PM<br>
<blockquote cite="mid:46F4A2EB.2060206@ita.org.mo" type="cite">
  <meta content="text/html;charset=Big5" http-equiv="Content-Type">
  <title></title>
  <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:edwardspl@ita.org.mo">edwardspl@ita.org.mo</a> wrote:
  <blockquote cite="mid46F4A016.60907@ita.org.mo" type="cite">
    <blockquote type="cite">
      <pre wrap="">&lt;snip&gt;  </pre>
    </blockquote>
    <pre wrap=""><!---->Hello Pual,

1, As the following is good for work also ?

Listen 80
Listen 443

NameVirtualHost *:80

&lt;VirtualHost *:80&gt;
    ServerAdmin <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="mailto:you.me@domain.com">you.me@domain.com</a>
    ServerName  <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="http://www.domain.com">www.domain.com</a>
    ServerAlias <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="http://www.domain.net">www.domain.net</a>
    ServerAlias <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="http://www.domain.org">www.domain.org</a>
    ErrorLog  /var/log/httpd/www_error_log
    CustomLog /var/log/httpd/www_access_log combined
    Redirect permanent / <a moz-do-not-send="true"
 class="moz-txt-link-freetext" href="https://www.domain.com/">https://www.domain.com/</a>
&lt;/VirtualHost&gt;

&lt;VirtualHost *:443&gt;
   DocumentRoot /my/doc-root/for/https/
   ServerName  <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="http://www.domain.com">www.domain.com</a>
   ServerAlias <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="http://www.domain.net">www.domain.net</a>
   ServerAlias <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="http://www.domain.org">www.domain.org</a>
   ServerAdmin <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="mailto:you.me@domain.com">you.me@domain.com</a>
&lt;/VirtualHost&gt;

2, What means by the permanent of redirect function ?

Thanks !

Edward.

  </pre>
  </blockquote>
Hello,<br>
  <br>
If there is only one IP address, then the config is okay ?<br>
</blockquote>
<br>
I am going to assume that both the secured and non-secured sites are on
the same computer. The redirect can work even if the secured site is in
a different server or even a different domain. It appears, however,
from your questions that your two sites are on the same box.<br>
<br>
1) Yes those port numbers are right. When a person types <a class="moz-txt-link-rfc2396E" href="http://">"http://"</a> in
their browser, they will connect on port 80 by default. When they type
<a class="moz-txt-link-rfc2396E" href="https://">"https://"</a> the browser knows to connect on port 443 by default.<br>
<br>
2) Yes, the web server uses the "ServerName" and "ServerAlias" in the
VirtualHost definitions to sort this out. In this example, when a
person addresses your site as <a class="moz-txt-link-rfc2396E" href="http://www.domain.com">"http://www.domain.com"</a> they will connect
to your server on port 80. This is the default , not-secured web site.
If a person does not specify a port and they use the "http" protocol
they will always connect on port 80. When this happens the web server
will see that there is a "Redirect" defined and will redirect the
person to the address you supply. In this example to
<a class="moz-txt-link-rfc2396E" href="https://www.domain.com">"https://www.domain.com"</a> <br>
<br>
This, in effect, gives your secured site two names so that a person can
access it even if they do not know or forget to say <a class="moz-txt-link-rfc2396E" href="https://">"https://"</a> instead
of <a class="moz-txt-link-rfc2396E" href="http://">"http://"</a><br>
<br>
Since the two sites (secured and not secured) are accessed on different
ports (80 and 443) having the same IP address is OK.<br>
<blockquote cite="mid:46F4A2EB.2060206@ita.org.mo" type="cite"><br>
Thanks !<br>
  <br>
Edward.<br>
</blockquote>
<br>
</body>
</html>