NetTalk Central

Author Topic: Apache web server and Host.exe  (Read 9996 times)

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Apache web server and Host.exe
« on: June 19, 2015, 06:44:38 AM »
     I'm seeking some advice.  I have numerous NT8 web apps running on host.exe on my physical server.  All run using a wildcard certificate, on port 443.  I have another non-clarion app that makes use of Apache and php that I want to run on the same physical server.  I want this app to also use the same wildcard certificate on port 443.
     As an example, I have 2 NT apps: " NT1.mydomain.org" and "NT2.mydomain.org".  I want to add to this  "appache1.mydomain.org".  This is my first experience with Apache/PHP and currently this app is on port 8010.  Can someone suggest how to make all these work together on port 443?

Thanks,

Jeff King

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Apache web server and Host.exe
« Reply #1 on: June 20, 2015, 10:12:39 PM »
Hi Jeff,

I don't think it is possible unless you bind the web servers to different IP address's (see docs) but I couldn't get this to work with windows and my firewall (NT works just not the other bits). You can of course use NT and Oddjob to serve up PHP and NT ships with a basic example so that might be an option to avoid Apache.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Apache web server and Host.exe
« Reply #2 on: June 22, 2015, 10:59:43 PM »
>>  I have another non-clarion app that makes use of Apache and php that I want to run on the same physical server.  I want this
app to also use the same wildcard certificate

the certificate part should be no problem - you can install the certificate into Apache.

>> on port 443.

here there is a problem. Ultimately only one program on the machine can listen on one IP:Port combination.

So your machine either needs a new IP address (machines can have multiple IP addresses) or you need to run the programs on different ports.

Upstream from the server you may have equipment which allows for traffic to me re-mapped - so something coming in with one URL goes to one port, and something with another URL goes to another port, but this sort of option is not common.

Your best bet in the long run may just to get a second machine.

cheers
Bruce

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Apache web server and Host.exe
« Reply #3 on: June 23, 2015, 10:27:43 AM »
Kevin and Bruce,

     Thanks for the input.  I'm running low on static IP's so another VM, etc. will be tough.  One thing I am trying is the NT PHP(58) example app.  The app I'm working with is called PacsOne.  This is an open source radiology imaging system (PACS) based on PHP, and currently I have running with Apache and MySQL (WAMP).  Getting this running in NT will eliminate Apache and allow me to compile a dll for use in the Host.exe application.  At least I think I might be able to do this.  I have actually made some progress and can get to the login screen of the PHP app.  I think I'm having an issue with the vendor's licensing file so I'm waiting to hear back.  I'll follow up later.

Jeff

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Apache web server and Host.exe
« Reply #4 on: June 23, 2015, 06:27:05 PM »
Bruce,

     I have run into a snag.  For the PHP based PACS app I'm testing, all the php script files are in a folder called "pascone\php".  Since all NT files are served from the web folder I placed the pacsone\php folder there.  See image WebPath.png.  I call the login php file as follows:  http://127.0.0.1:88/pacsone/php/login.php.  I get the login screen but it contains an error message, seen in red in the attached screen shot: new_login.png.  I don't know what to look for next.  Any advice?

By the way, the PacsOne server uses MySQL as a database and it's service is running.

Thanks,

Jeff

[attachment deleted by admin]
« Last Edit: June 23, 2015, 06:45:35 PM by kingja »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Apache web server and Host.exe
« Reply #5 on: June 23, 2015, 10:47:55 PM »
Hi Jeff,

>> Since all NT files are served from the web folder I placed the pacsone\php folder there.

I'm not sure this is what I would do. The pacsone folder contains exe's and dll's and stuff, and being in the web folder this is all "subject to download". I'm guessing none of these files should be downloadable, so I would move them up.

Then again I'm not sure if they're needed at all. Seems to me like you need the php pages (which I'd probably put directly int he \web\ folder) but I don't think any other part of they system will be used.

Of course I'm completely speculating here - this is more along the lines of musings than advice...

cheers
Bruce



kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Apache web server and Host.exe
« Reply #6 on: June 24, 2015, 03:30:45 AM »
Bruce,

The vendor of PacsOne suggested leaving the PacsOne folder where it was originally installed:

Here are his comments:
 
1. Can you trying logging into MySQL using the very same "root" username/password from a local command shell? e.g.,
 
C:\mysql\bin>mysql.exe -u root -p BreastPACS
 
2. You need to create the "pacsone" website alias which is linked to the "php/" sub-folder where PacsOne Server is installed, instead of just copying all the PHP scripts into the HTDOCS folder of your web server.


I'm not sure what he means by alias.  I wonder, is it possible to have NT serve just the files in the original php folder without copying them to a folder under the web folder?

Thanks,

Jeff

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Apache web server and Host.exe
« Reply #7 on: June 24, 2015, 04:03:11 AM »
I'm likely not going to be terribly helpful here Jeff - PHP is fairly far outside my skill set, and of course I have absolutely no idea how the PacsOne software itself is put together.

with regard to point 2) though - I think he's saying the equivalent of
"you need to tell the server where to serve the files from".
In nettalk we default this to the web folder - but it can be pointed anywhere (and indeed the Multi site host Exe has a setting for this very thing.

cheers
Bruce

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Apache web server and Host.exe
« Reply #8 on: June 24, 2015, 07:53:47 PM »
Bruce,

     Is there a way to cause the NT PHP example app to use a different PHP-CGI.exe?  I have a later one installed with the PacsOne server and want to try it.

Thanks,

Jeff

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Apache web server and Host.exe
« Reply #9 on: June 24, 2015, 10:38:07 PM »
Hi Jeff,

the name is currently hard-coded to php-cgi.exe. You can edit this in netweb.clw if you need to experiment with it. (I can obviously make it a variable if this approach works for you.)

The _location_ of the exe though is a property. It's in
p_web.site.phpPath
you can set this in WebHandler, in the _SendPhpFile method, before the parent call.
It defaults to app folder\php

Cheers
Bruce


kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Apache web server and Host.exe
« Reply #10 on: June 25, 2015, 06:04:01 AM »
Bruce,

     Thanks, that is what I was looking for.  I believe I am running the later version of the php-cgi.exe since it is also using the php.ini from this other location.  However, I still have an issue.  When I try to load the home.php script I get the following error message:

Status: 302 Moved Temporarily X-Powered-By: PHP/5.5.12 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: login.php?message=Welcome+to+PacsOne+Server Content-type: text/html

     This message indicates I'm using PHP vs 5.5.12, whereas the original PHP(58) uses 5.2.x I believe.  This seems to validate that newer php-cgi.exe is being used now. 
     There is a hello.php script that works and it shows the detailed configuration of the php set up, so I'm getting somewhere.  I know you are not a PHP expert so I'll post this on the NG's to see if anyone has any ideas on the Status 302 Moved Temporarily message.

Thanks,

Jeff

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Apache web server and Host.exe
« Reply #11 on: June 25, 2015, 06:21:14 AM »
Bruce,

     I forgot to ask, I have attached an image showing how I set my "web directory".  Is this the correct way to do this?

Thanks,

Jeff

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Apache web server and Host.exe
« Reply #12 on: June 26, 2015, 06:16:07 AM »
yes that should be ok.
(obviously hard-coding it is not ideal, but the idea is right.)

cheers
Bruce

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Apache web server and Host.exe
« Reply #13 on: June 26, 2015, 06:44:27 AM »
Bruce,

     I have made a bit of progress but keep getting the following error message:

Status: 302 Moved Temporarily X-Powered-By: PHP/5.5.12 Set-Cookie: PHPSESSID=obbsu55gc1cg95ikvv513bf471; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: login.php?message=Welcome+to+PacsOne+Server Content-type: text/html

 A Google search indicates this is a redirection issue. I believe I have redirection turned off with the following code in php.ini:

cgi.force_redirect = 0

The PacsOne vendor replied:

"This is a standard PHP redirect as the Home page requires user authentication thus the redirect to the Login.php page, but your web server does not appear to be following the redirect to the Login page properly, so you should check the technical support for your custom-built web server, and make sure it can follow the HTTP redirect properly."

Is there anything I should check in NetTalk with regards to redirect?

Thanks,

Jeff

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Apache web server and Host.exe
« Reply #14 on: June 27, 2015, 05:58:49 PM »
Bruce,

     I looked in netweb.clw and found code that sets the Server_Name variable, however, it is commented out.  Similarly, there is other code dealing with redirect that is commented out.  See attached image.
     I commented out this code and recompiled.  This did not seem to help.  Perhaps I should use php.exe or php-win.exe instead of php-cgi?  Any other thoughts?

Thanks,

Jeff

[attachment deleted by admin]