[Newbies] Squeak + VirtualHost + KomHTTP

Herve Darce squeak at moncase.fr
Sun Aug 24 11:16:50 UTC 2008


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:
* '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

I do not understand.

Cheers

Herve Darce



More information about the Beginners mailing list