Re: Web serving on OS X Server

2017-06-09 Thread John Harrington via 4D_Tech
Wow, awesome post Ron!  Thanks for such a detailed guide.  I’m looking forward 
to giving your procedure a try.  

-John

> Here’s a step by step guide
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Web serving on OS X Server

2017-06-09 Thread Lee Hinde via 4D_Tech
Thanks Ron and Jim for the great help.

On Fri, Jun 9, 2017 at 3:05 PM, James Crate via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> The easy way is to set up a webapp plist, and then just turn on that
> webapp for the appropriate domain (website).
>
> Here’s a sample plist. You should be able to mostly use the httpd.conf
> options you use behind Apache normally.
>
> 
>  http://www.apple.com/DTDs/PropertyList-1.0.dtd;>
>
> 
> 
> includeFiles
> 
> /Library/WebServer/exa
> mple.com/my_app/config/server_webapp.httpd.conf
> 
> name
> com.example.my_app
> displayName
> My WebApp
> installationIndicatorFilePath
> /Library/WebServer/example.com/my_app/config/server_
> webapp.httpd.conf
> sslPolicy
> 0
> 
> 
> 
> 
> 
> 
>
> 

Re: Web serving on OS X Server

2017-06-09 Thread James Crate via 4D_Tech
The easy way is to set up a webapp plist, and then just turn on that webapp for 
the appropriate domain (website).

Here’s a sample plist. You should be able to mostly use the httpd.conf options 
you use behind Apache normally.


http://www.apple.com/DTDs/PropertyList-1.0.dtd;>



includeFiles


/Library/WebServer/example.com/my_app/config/server_webapp.httpd.conf

name
com.example.my_app
displayName
My WebApp
installationIndicatorFilePath

/Library/WebServer/example.com/my_app/config/server_webapp.httpd.conf
sslPolicy
0








Re: Web serving on OS X Server

2017-06-09 Thread Ronald Rosell via 4D_Tech
Note, by the way, that while my server is running El Capitan my development 
system is running Sierra.  I also use this technique when locally testing 
changes, proxying through Apache.  The changes I described still work fine in 
the most current version of the OS (10.12.5)  and the server app (5.3.1)

__

Ron Rosell
President
StreamLMS


> On Jun 9, 2017, at 1:13 PM, Ronald Rosell via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I’ve done this for multiple sites (domains) accessing a 4D instance.  I’ve 
> done it through several OS versions;  currently my server’s running El 
> Capitan (10.11.8)

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Web serving on OS X Server

2017-06-09 Thread Ronald Rosell via 4D_Tech
Lee,

I’ve done this for multiple sites (domains) accessing a 4D instance.  I’ve done 
it through several OS versions;  currently my server’s running El Capitan 
(10.11.8)

Here’s a step by step guide for a domain I’ll call “mydomain.com 
”. 


1) Set up the sites with the server app, and in the “Store Web Files In” field 
have them reference the webdata folder where all of your 4D web content is 
stored (rather than the default folder that the server app would try to 
reference).

2) After creating a site (or multiple sites), go to Library -> Server -> Web -> 
Config -> apache2 -> sites and look for the configuration (.conf) file ending 
with the name of the domain name you created.  (I do this in TextWrangler, 
entering an admin password as prompted to save my changes). So in this example, 
I’m looking for the file name ending in mydomain.com.conf

At this point you have a bit of flexibility … you can put some of your code in 
an external file and “include” it in the .conf file, or you can put everything 
directly into the .conf file… but either way you basically want to set up some 
ProxyPass directives.  I do these in an external file (actually, two files), 
then reference those in the conf file for the site instance.  

I’ll first show you the two external text files I create, then show you how to 
edit the conf file for the virtual domain (mydomain.com.conf) to reference 
those files.

3) Create a separate text file, in the same Sites folder, called 
mydomainincludes.config 

In the text file write the following lines:

ProxyPass / http://mydomain.com:8080/
ProxyPassReverse / http://mydomain.com:8080/

Note that this example assumes that 4D is configured to serve web content on 
port 8080.  Adjust the web settings or config file as necessary to reference 
the correct port, and of course use the actual domain name.  I create one of 
these .config files for each domain name that I’m proxying; very simple, two 
lines of code.

4) Optionally, you can also create a config file that will be shared by all of 
your sites that are being proxied, with some settings they’ll all share.  I do 
that to tell Apache to ignore proxy settings for static content, allowing the 
Apache server to send out things like jpegs without bothering (proxying to) 
4D’s web server.

So I have a second text file in the sites directory called allsites.config, and 
it contains instructions to NOT proxy several directories. (The name of the 
config file doesn’t matter; you’ll be referencing it by name later.)  Vary the 
list of directories below according to the content of your site; include any 
directories where accessing the content directly via Apache, rather than going 
through 4D, will not affect the outcome.  You wouldn’t want to include a 
directory of dynamic pages here, unless your design sends out all dynamic pages 
using Web Send File.  What you want to avoid including on the bypass list are 
dynamic .shtml pages that are directly called by a URL 
(http://mydomain.com/mypages/mypage.shtml) and contain code in them that 
executes 4D methods; those are pages you want served by 4D.

ProxyPass /media/ !
ProxyPass /js/ !
Proxypass /logos/ !

Note that if you have any directories that can be bypassed but that are 
specific to one domain, you can include those at the top of your 
domain-specific config file rather than in this shared file used by all 
domains.  (These “except for these directories” commands need to be read by 
Apache before the ProxyPass commands to route things over to 4D on port 8080.) 
So, if I have a directory called mydomainStaticStuff, which contains only 
static content relevant to that one domain, I could include the following 
directive before the first ProxyPass line in mydomain.config, described in step 
3 above, instead of putting it in a separate shared file. 

ProxyPass /mydomainStaticStuff/ !

Indeed, if you wish you can handle all of the static content that way, 
including the bypass directives in the same file as the ProxyPass directives; I 
just use the shared file because I have about a dozen directories of static 
content that are shared by several sites.

5) Now we include the above config files in the mydomain.conf file.  Open that 
file in your text editor, go to the line right after 
ErrorLog /var/log/apache2/error_log and add the following lines.  (When you 
start typing, you’ll be asked if it’s okay to unlock the file.  Say yes).

ProxyPreserveHost on
Include "/Library/Server/Web/Config/apache2/sites/allsites.config"
Include 
"/Library/Server/Web/Config/apache2/sites/mydomainincludes.config”

Of course, if you chose not to create a separate config file with directives 
shared by several sites, you can skip that “Include” line.

If you would rather put all of the code into the conf file, instead of creating 
some external config files, then your edit would look more like this:


Re: Web serving on OS X Server

2017-06-09 Thread Lee Hinde via 4D_Tech
Hi John;

Thanks for the links!

I'm punting for now and found this to just turn off the Apple Apache httpd
instances:

https://discussions.apple.com/thread/7247358?tstart=0

This has 4D doing all the serving, which i'm not keen on, especially with
this app which is graphic intensive.


I'm running Sierra server. Hopefully an update will make this easier.  (one
lives in hope.)



On Fri, Jun 9, 2017 at 12:33 PM, John Harrington via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Lee - I personally had no success in getting the new version of OS X
> Server to easily handle a reverse proxy to 4D’s port 8080 or 8443.  Snow
> Leopard Server (SLS 10.6.8) is the last version that included this granular
> feature and a simple interface to set things up with.  As of yet, I have
> found no good 3rd party alternative.  (We currently run a 4D 2004 legacy
> system, behind Apache on SLS 10.6.8, on a new Mini running OS X 10.11.6.)
>
> Tech support at MacStadium was only able to confirm they knew of no easy
> way to get OS X 10.11.6 to handle a reverse proxy to the 4D port.  Here are
> some server setup videos they produced that you may find helpful:
>
> Hosted Mountain Lion Server Part 1: Setting Up Your Server
> https://www.youtube.com/watch?v=OeJ_wwCT4tM  watch?v=OeJ_wwCT4tM>
>
> If you’re okay with it, you should be able to have 4D serve directly by
> just opening the related 4D web-port(s) in your firewall.
>
> Hosted Mountain Lion Server Part 3: Built In Firewall
> https://www.youtube.com/watch?v=AaWWmH_6oAY  watch?v=AaWWmH_6oAY>
>
> Looking forward to hearing thoughts about Apache reverse proxy on newer
> machines and solutions that may be working well for others.   -John
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Web serving on OS X Server

2017-06-09 Thread John Harrington via 4D_Tech
Lee - I personally had no success in getting the new version of OS X Server to 
easily handle a reverse proxy to 4D’s port 8080 or 8443.  Snow Leopard Server 
(SLS 10.6.8) is the last version that included this granular feature and a 
simple interface to set things up with.  As of yet, I have found no good 3rd 
party alternative.  (We currently run a 4D 2004 legacy system, behind Apache on 
SLS 10.6.8, on a new Mini running OS X 10.11.6.)

Tech support at MacStadium was only able to confirm they knew of no easy way to 
get OS X 10.11.6 to handle a reverse proxy to the 4D port.  Here are some 
server setup videos they produced that you may find helpful:  

Hosted Mountain Lion Server Part 1: Setting Up Your Server
https://www.youtube.com/watch?v=OeJ_wwCT4tM 


If you’re okay with it, you should be able to have 4D serve directly by just 
opening the related 4D web-port(s) in your firewall.  

Hosted Mountain Lion Server Part 3: Built In Firewall
https://www.youtube.com/watch?v=AaWWmH_6oAY 


Looking forward to hearing thoughts about Apache reverse proxy on newer 
machines and solutions that may be working well for others.   -John
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Web serving on OS X Server

2017-06-09 Thread Lee Hinde via 4D_Tech
For reasons that aren’t clear, Server uses different configuration files and 
processes.I.e, it’s not https.conf anymore.

 Sorting through what’s new to me is the basis for the request for help here.


> On Jun 9, 2017, at 12:06 PM, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
> Ive not setup apache - but what I was trying to get to is..
> whatever you have done in the past for apache (and maybe I mis-read 
> your question), just do that, the 'server' part should not make 
> anything change.
> 
> 
> On Fri, 9 Jun 2017 12:03:05 -0700, Lee Hinde via 4D_Tech wrote:
>> Correct, I need other parts of OS X Server on this computer.
>> 
>>> On Jun 9, 2017, at 11:54 AM, Chip Scheide 
>>> <4d_o...@pghrepository.org> wrote:
>>> 
>>> OS X server is OS X with a server application.
>>> 
>>> On Fri, 9 Jun 2017 11:14:02 -0700, Lee Hinde via 4D_Tech wrote:
 I've setup apache as a front end to 4D on 'regular' macs without 
 issue. But
 now I need to do it on a Mac running the Server software and I'm not clear
 where/how to configure that and my google fu is failing me.
 
 Has anyone done that and can you point to directions?
 
 I'd settle for having 4D serve directly, but OS X Server is running apache
 even with Websites off.
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Web serving on OS X Server

2017-06-09 Thread Chip Scheide via 4D_Tech
Ive not setup apache - but what I was trying to get to is..
whatever you have done in the past for apache (and maybe I mis-read 
your question), just do that, the 'server' part should not make 
anything change.


On Fri, 9 Jun 2017 12:03:05 -0700, Lee Hinde via 4D_Tech wrote:
> Correct, I need other parts of OS X Server on this computer.
> 
>> On Jun 9, 2017, at 11:54 AM, Chip Scheide 
>> <4d_o...@pghrepository.org> wrote:
>> 
>> OS X server is OS X with a server application.
>> 
>> On Fri, 9 Jun 2017 11:14:02 -0700, Lee Hinde via 4D_Tech wrote:
>>> I've setup apache as a front end to 4D on 'regular' macs without 
>>> issue. But
>>> now I need to do it on a Mac running the Server software and I'm not clear
>>> where/how to configure that and my google fu is failing me.
>>> 
>>> Has anyone done that and can you point to directions?
>>> 
>>> I'd settle for having 4D serve directly, but OS X Server is running apache
>>> even with Websites off.
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Web serving on OS X Server

2017-06-09 Thread Lee Hinde via 4D_Tech
Correct, I need other parts of OS X Server on this computer.

> On Jun 9, 2017, at 11:54 AM, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
> OS X server is OS X with a server application.
> 
> On Fri, 9 Jun 2017 11:14:02 -0700, Lee Hinde via 4D_Tech wrote:
>> I've setup apache as a front end to 4D on 'regular' macs without issue. But
>> now I need to do it on a Mac running the Server software and I'm not clear
>> where/how to configure that and my google fu is failing me.
>> 
>> Has anyone done that and can you point to directions?
>> 
>> I'd settle for having 4D serve directly, but OS X Server is running apache
>> even with Websites off.


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Web serving on OS X Server

2017-06-09 Thread Chip Scheide via 4D_Tech
OS X server is OS X with a server application.

On Fri, 9 Jun 2017 11:14:02 -0700, Lee Hinde via 4D_Tech wrote:
> I've setup apache as a front end to 4D on 'regular' macs without issue. But
> now I need to do it on a Mac running the Server software and I'm not clear
> where/how to configure that and my google fu is failing me.
> 
> Has anyone done that and can you point to directions?
> 
> I'd settle for having 4D serve directly, but OS X Server is running apache
> even with Websites off.
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Web serving on OS X Server

2017-06-09 Thread David Ringsmuth via 4D_Tech
Lee,

I’ve done a lot with nginx, very very little with apache.

https://engineering.datica.com/local-web-development-with-nginx-on-el-capitan.html

David Ringsmuth

From: Lee Hinde via 4D_Tech
Sent: Friday, June 9, 2017 1:14 PM
To: 4D iNug Tech
Cc: Lee Hinde
Subject: Web serving on OS X Server

I've setup apache as a front end to 4D on 'regular' macs without issue. But
now I need to do it on a Mac running the Server software and I'm not clear
where/how to configure that and my google fu is failing me.

Has anyone done that and can you point to directions?

I'd settle for having 4D serve directly, but OS X Server is running apache
even with Websites off.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**