Herve Darce | 24 Aug 13:16

Squeak + VirtualHost + KomHTTP

Hi,

I want to use the virtual hosting. The package ModVhost can do that. 
Also, I shutdown apache and  I do use only  squeak.

I shutdown all services. "HttpService allInstancesDo: [:each | each 
stop. each unregister]."

Then, I open on my pc two virtualhosts:  localhost and mymachine.
ma := ModuleAssembly core.
ma virtualHost: 'localhost' do:
    [ma addPlug:
        [ :request |
        HttpResponse fromString: 'You are seeing content for localhost']].
ma virtualHost: 'mymachine' do:
    [ma addPlug:
        [ :request |
        HttpResponse fromString: 'You are seeing content for mymachine']].
ma addPlug:
    [ :request |
    HttpResponse fromString: 'You are seeing default content for other'].
(HttpService startOn: 8080 named: 'Example') module: ma rootModule.

I get the same page 'You are seeing default content for other' for three 
cases:
* http://localhost:8080
* http://mymachine:8080
* http://127.0.0.1

I had to get three different pages:
(Continue reading)

Herve Darce | 24 Aug 13:22

Re: Squeak + VirtualHost + KomHTTP

correction: http://localhost:8080
Herve Darce | 25 Aug 07:29

Re: Squeak + VirtualHost + KomHTTP

Problem is solved

In the method ModuleAssembly>>virtualHost:do:, I change '%0'  into '%1'.

I have three different pages:
* 'You are seeing content for localhost' for http://localhost:8080
* 'You are seeing content for mymachine' for http://mymachine:8080
* 'You are seeing default content for other' for http://127.0.0.1:8080

Herve Darce a écrit :
> Hi,
>
> I want to use the virtual hosting. The package ModVhost can do that. 
> Also, I shutdown apache and  I do use only  squeak.
>
> I shutdown all services. "HttpService allInstancesDo: [:each | each 
> stop. each unregister]."
>
> Then, I open on my pc two virtualhosts:  localhost and mymachine.
> ma := ModuleAssembly core.
> ma virtualHost: 'localhost' do:
>    [ma addPlug:
>        [ :request |
>        HttpResponse fromString: 'You are seeing content for localhost']].
> ma virtualHost: 'mymachine' do:
>    [ma addPlug:
>        [ :request |
>        HttpResponse fromString: 'You are seeing content for mymachine']].
> ma addPlug:
>    [ :request |
(Continue reading)


Gmane