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
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:
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 Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
beginners@lists.squeakfoundation.org