Squeak + VirtualHost + KomHTTP

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Squeak + VirtualHost + KomHTTP

Herve Darce-2
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

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Squeak + VirtualHost + KomHTTP

Herve Darce-2
correction: http://localhost:8080
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Squeak + VirtualHost + KomHTTP

Herve Darce-2
In reply to this post by Herve Darce-2
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 |
>    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:8080
>
> I do not understand.
>
> Cheers
>
> Herve Darce
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners