Hi,

Hi Tudor.
 

Sorry for the delayed response.

No problem.

 
I tried your variation but it does not seem to work properly: when I go to /admin, it points the browser to localhost, instead of www.example.com.

I say it has nothing to do with pier, but I recommended to you use example.com as Server Name and to use "www" as an alias for this (but I'm not an expert). Like this:
ServerName example.com
ServerAlias www.example.com

 
It's as if the Server Hostname setting is not taken into account.

Yes.

 

Any idea why?

I am using Pharo 1.4 with Pier3. Here are my settings:

APACHE
<VirtualHost *:80>
    # set server name
    ProxyPreserveHost On
    ServerName www.example.com

    # connfigure static file serving
    DocumentRoot /srv/web
    <Directory /srv/web>
    Order deny,allow
    Allow from all
    </Directory>

    # rewrite incoming requests
    RewriteEngine On
    RewriteRule ^/admin(.*)$ http://localhost:8081/pier-admin$1 [redirect,last]
    RewriteRule ^/files/(.*)$ http://localhost:8081/files/$1 [proxy,last]
    RewriteCond /srv/web/%{REQUEST_FILENAME} !-f
    RewriteRule ^/(.*)$ http://localhost:8081/pier/$1 [proxy,last]
</VirtualHost>

IMAGE (config)
/pier-admin
        Server Hostname: www.example.com
        Server Path: /admin
        Server Port: 80
        Server Protocol: http
/pier
        Server Hostname: www.example.com
        Server Path: /
        Server Port: 80
        Server Protocol: http


Change [redirect,last] to [proxy,last]. Typo? If not, FYI "redirect" modify permanently the url, whereas that "proxy" preserve it, from site user perspective of course.

RewriteRule ^/admin(.*)$ http://localhost:8081/pier-admin$1 [proxy,last]
 
Cheers,
Doru


Cheers. 



On 9 Oct 2012, at 16:16, Gastón Dall' Oglio <gaston.dalloglio@gmail.com> wrote:

> ups I forgot the concrete answer :)
>
> For handler "example-admin" I set:
> Server Path: /admin
>
> Later to enter to admin app I go to http://example.com/admin
>
>
>
> RewriteRule ^/admin(.*)$ http://localhost:8516/example-admin$1 [proxy,last]
>
> 2012/10/9 Gastón Dall' Oglio <gaston.dalloglio@gmail.com>
> Hi Tudor.
>
> For an app named "example" my rewrite look like this:
>
> RewriteEngine on
> RewriteRule ^/config(.*)$ http://localhost:8516/config$1 [proxy,last]
> RewriteRule ^/status(.*)$ http://localhost:8516/status$1 [proxy,last]
> RewriteRule ^/upload(.*)$ http://localhost:8516/tools/versionuploader$1 [proxy,last]
> RewriteRule ^/browser(.*)$ http://localhost:8516/tools/classbrowser$1 [proxy,last]
> RewriteRule ^/setup(.*)$ http://localhost:8516/piersetup$1 [proxy,last]
> RewriteRule ^/admin(.*)$ http://localhost:8516/example-admin$1 [proxy,last]
> RewriteRule ^/files/(.*)$ http://localhost:8516/files/$1 [proxy,last]
> RewriteCond /home/example/public_html%{REQUEST_FILENAME} !-f
> RewriteRule ^/(.*)$ http://localhost:8516/example/$1 [proxy,last]
>
> Then I go to config app, and for handler "/" I set this (to be used for all apps):
>
> Server Hostname: example.com (or www.example.com)
> Server Port: 80
> Server Protocol: http
>
> For handler "config" I set:
> Server Path: /config
>
> For handler "status" I set:
> Server Path: /status
>
> ...
>
> For handler "example" I set:
> Server Path: /
>
>
> Hope this help.
> Regard.
>
> 2012/10/9 Tudor Girba <tudor@tudorgirba.com>
> Hi,
>
> I am trying to set up a Pier3 webpage with Pier Admin inside, but I
> have problems with the Apache2 configuration.
>
> Does anyone have a sample of such a configuration?
>
> Cheers,
> Doru
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>
>
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki

--
www.tudorgirba.com

"What is more important: To be happy, or to make happy?"


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki