Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IWBootstrap app and Apache
#1
I have an IWBootstrap app based on one of the bootstrap demos. I have compiled it as a service and configured it to run on port 44001 and it runs correctly when accessed directly via the LAN using the server's local IP address. It switches from desktop to mobile as required.

I am wanting to deploy it with Apache. In the conf file I have created a VirtualHost entry for it as follows:

<VirtualHost *:80>
    ServerName mywebsite.com
    ProxyPass / http://127.0.0.1:44001/ disablereuse=on
    ProxyPassReverse / http://127.0.0.1:44001/ 
 </VirtualHost>

I can browse to the website from outside, but the desktop version is always rendered. It does not switch to the mobile version when browsing to it from a mobile device. Any ideas?
Reply
#2
How does it switch from desktop to mobile? Is it based on the port?
Reply
#3
(10-22-2019, 08:07 AM)Alexandre Machado Wrote: How does it switch from desktop to mobile? Is it based on the port?
I guess it's based on the browser type. All I did was take one of the sample IWBootstrap applications. When I browse to locally it from my PC it renders in desktop mode and when I browse to it (locally) on my phone it renders in mobile mode. But when accessing it from outside via Apache it only renders in desktop mode no matter what the client is. The reverse proxy functionality in Apache must not be passing on whatever is needed to make it switch to mobile mode.
Reply
#4
(10-23-2019, 09:36 AM)troberts Wrote:
(10-22-2019, 08:07 AM)Alexandre Machado Wrote: How does it switch from desktop to mobile? Is it based on the port?
I guess it's based on the browser type. All I did was take one of the sample IWBootstrap applications. When I browse to locally it from my PC it renders in desktop mode and when I browse to it (locally) on my phone it renders in mobile mode. But when accessing it from outside via Apache it only renders in desktop mode no matter what the client is. The reverse proxy functionality in Apache must not be passing on whatever is needed to make it switch to mobile mode.
I can confirm that it's not on the browser type. I tried displaying the browser name and it correctly reports "Chrome Mobile" whether I browse to the site directly via the LAN IP address, or from outside via the Apache server. My next line of thinking is that the bootstrap application must decide how to render the output based on the screen resolution. If this is the case then perhaps the reported resolution is being changed as it passes through the Apache server. I'm going to do some tests to determine whether it is or not.
Reply
#5
As far as I recall it does use screen resolution to adjust between mobile and desktop. You can see this by reducing a browser windows size on desktop and BS templates will change to mobile layout.

AMP (Accelerated Mobile Pages) can have a play in this as well. AMP is a module installed on some installations. Explicit AMP often forces pages into mobile presentation only.
Reply
#6
(10-25-2019, 03:52 PM)kudzu Wrote: As far as I recall it does use screen resolution to adjust between mobile and desktop. You can see this by reducing a browser windows size on desktop and BS templates will change to mobile layout.

AMP (Accelerated Mobile Pages) can have a play in this as well. AMP is a module installed on some installations. Explicit AMP often forces pages into mobile presentation only.
Thanks for your suggestion. I have found the problem. I compared the source of the rendered pages and it was evident that when browsing from outside via the domain name and Apache, Apache was wrapping the page in a frameset. After some investigation I discovered that Apache does this if the domain name is a simple URL redirect. Once I changed the settings on my hosting account from url redirect to using the A record in the name server configuration everything started working.

I now have multiple Intraweb websites (each with their own domain name) running on the same webserver, all accessed via a single IP address and port 80. The websites run as Windows services and Apache operates as a reverse proxy, directing requests to the appropriate service. I am happy to write up some documentation about how to set this up if anyone else would find this useful.
Reply
#7
Hi,



      I think that it would be a great contribution to know your solution to such a scenario. Could you, please, share more information on this? 

      Thanks in advance!
    
   
      Joao Lira
Reply
#8
"After some investigation I discovered that Apache does this if the domain name is a simple URL redirect. Once I changed the settings on my hosting account from url redirect to using the A record in the name server configuration everything started working."

This doesnt seem to me like standard Apache behavior but instead some method your hosting provider is using.
Reply
#9
(10-28-2019, 04:27 PM)kudzu Wrote: "After some investigation I discovered that Apache does this if the domain name is a simple URL redirect. Once I changed the settings on my hosting account from url redirect to using the A record in the name server configuration everything started working."

This doesnt seem to me like standard Apache behavior but instead some method your hosting provider is using.
Possibly that is the case. But I found other cases on forums unrelated to Intraweb where people had experienced exactly the same issue. Thanks everyone for your help with this one. I have described my setup in another post in case it's useful to others.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)