Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5F178200C45 for ; Tue, 14 Mar 2017 02:26:34 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5DAAF160B85; Tue, 14 Mar 2017 01:26:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 80DC7160B5D for ; Tue, 14 Mar 2017 02:26:33 +0100 (CET) Received: (qmail 35195 invoked by uid 500); 14 Mar 2017 01:26:27 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 35171 invoked by uid 99); 14 Mar 2017 01:26:26 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Mar 2017 01:26:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5C7981819E4 for ; Tue, 14 Mar 2017 01:26:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.302 X-Spam-Level: X-Spam-Status: No, score=-0.302 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id DY595x90ANRG for ; Tue, 14 Mar 2017 01:26:23 +0000 (UTC) Received: from z9m9z.htt-consult.com (z9m9z.htt-consult.com [50.253.254.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 1CA685F252 for ; Tue, 14 Mar 2017 01:26:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by z9m9z.htt-consult.com (Postfix) with ESMTP id 42C566224D for ; Mon, 13 Mar 2017 21:26:13 -0400 (EDT) X-Virus-Scanned: amavisd-new at htt-consult.com Received: from z9m9z.htt-consult.com ([127.0.0.1]) by localhost (z9m9z.htt-consult.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8tig7GoA-J2N for ; Mon, 13 Mar 2017 21:26:05 -0400 (EDT) Received: from lx120e.htt-consult.com (unknown [64.114.24.115]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by z9m9z.htt-consult.com (Postfix) with ESMTPSA id 59E9F621E2 for ; Mon, 13 Mar 2017 21:26:05 -0400 (EDT) To: users@httpd.apache.org References: From: Robert Moskowitz Message-ID: <71dba505-9887-2e53-c6f4-1aaf366c4e89@htt-consult.com> Date: Mon, 13 Mar 2017 18:26:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------B667AC9431F6271694C49458" Subject: Re: [users@httpd] Apache 2.4 : Rewrite to keep the original URL archived-at: Tue, 14 Mar 2017 01:26:34 -0000 --------------B667AC9431F6271694C49458 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Fabio, Right now I am not in the position to test this. Your .conf attempt looks a LOT like what I tried. I was told: Rewriterules and https. Actually, looking at what you have doesn't really tell me why it gets applied to everything and not just the webmail. However, I'd say that your roundcubemail.conf is much overworked. We use something like that on openssl.org, but it generally looks like this: ServerAdmin webmaster@localhost ServerName ${HOSTNAME} ServerAlias ${HOSTALIASES} Redirect permanent /https://${HOSTNAME}/ Since you already know that the host is correct and that's the port 80 virtualhost, there's no point testing that with those RewriteCond you have. Also, Redirect is faster and preferable to RewriteRule for this kind of stuff, seehttps://httpd.apache.org/docs/2.4/rewrite/avoid.html Also, specifically for virtualhost config files, they should be located in sites-available/ rather than conf.d/, see 'man a2ensite'. conf.d/ is older style configuration of general stuff... or well, that's at least true for Debian, I'm not sure this is specific for Debian distributions and their derivates or if it's a native Apache thing. You'll have to check the manuals to confirm. I need to check out sites-available directory for Centos7... But see what this does, and let me know! I am at the IEEE 802 conference this week, and testing is challenging right now..... On 03/11/2017 05:07 AM, Fabio S. Schmidt wrote: > Hi, > > I'm trying to setup an environment with a frontend interface which > login and redirects to my application. > > The scenario is: The user access with webmail.domain.com > and the login page redirects to the > application, running on the same host, but on port 81. > > How could I keep the original URL? I mean, the browser should keep the > "webmail.domain.com " as the address. > > My Apache configuration: > > > DocumentRoot "/var/www/html/login_domain" > DirectoryIndex index.html *.php > ServerName webmail.domain.com > SSLEngine on > SSLCertificateFile /etc/ssl/crt/apache.crt > SSLCertificateKeyFile /etc/ssl/crt/apache.key > SSLCertificateChainFile /etc/ssl/crt/ca.crt > > > > DocumentRoot "/var/www/html/login_domain" > DirectoryIndex index.html *.php > ServerName webmail.domain.com > > > Kind regards. > Fabio S. Schmidt --------------B667AC9431F6271694C49458 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit Fabio,

Right now I am not in the position to test this. Your .conf attempt looks a LOT like what I tried.

I was told:

Rewriterules and https.  Actually, looking at what you have doesn't
really tell me why it gets applied to everything and not just the
webmail.  However, I'd say that your roundcubemail.conf is much
overworked.  We use something like that on openssl.org, but it
generally looks like this:

    <VirtualHost *:80>
            ServerAdmin webmaster@localhost
            ServerName ${HOSTNAME}
            ServerAlias ${HOSTALIASES}
    
            Redirect permanent / https://${HOSTNAME}/
    </VirtualHost>

Since you already know that the host is correct and that's the port 80
virtualhost, there's no point testing that with those RewriteCond you
have.  Also, Redirect is faster and preferable to RewriteRule for this
kind of stuff, see https://httpd.apache.org/docs/2.4/rewrite/avoid.html

Also, specifically for virtualhost config files, they should be
located in sites-available/ rather than conf.d/, see 'man a2ensite'.
conf.d/ is older style configuration of general stuff...  or well,
that's at least true for Debian, I'm not sure this is specific for
Debian distributions and their derivates or if it's a native Apache
thing.  You'll have to check the manuals to confirm.

I need to check out sites-available directory for Centos7...

But see what this does, and let me know! I am at the IEEE 802 conference this week, and testing is challenging right now.....


On 03/11/2017 05:07 AM, Fabio S. Schmidt wrote:
Hi,

I'm trying to setup an environment with a frontend interface which login and redirects to my application.

The scenario is: The user access with webmail.domain.com and the login page redirects to the application, running on the same host, but on port 81.

How could I keep the original URL? I mean, the browser should keep the "webmail.domain.com" as the address.

My Apache configuration:

<VirtualHost *:443>
DocumentRoot "/var/www/html/login_domain"
DirectoryIndex index.html *.php
ServerName webmail.domain.com
SSLEngine on
SSLCertificateFile /etc/ssl/crt/apache.crt
SSLCertificateKeyFile /etc/ssl/crt/apache.key
SSLCertificateChainFile /etc/ssl/crt/ca.crt
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "/var/www/html/login_domain"
DirectoryIndex index.html *.php
ServerName webmail.domain.com
</VirtualHost>

Kind regards.
Fabio S. Schmidt

--------------B667AC9431F6271694C49458--