OS X Server en handmatig aanpassingen

Pagina: 1
Acties:

Acties:
  • 0 Henk 'm!

  • afterburn
  • Registratie: Januari 2000
  • Laatst online: 27-09 17:57

afterburn

No more...

Topicstarter
Ik heb een aantal websites met handmatige aanpassingen in de .conf omdat ik deze instellingen niet via de server app kan maken. Helaas vind OS X Server het nodig om bij elke update deze instellingen weg te gooien en te vervangen door de default instellingen.

Is er een mogelijk om OS X Server te dwingen hier vanaf te blijven?

Fuji X-T1 | XF14mm F2.8 R | XF23mm F1.4 R | XF35mm F1.4 R
Nikon D800 | AF-S 24-120/f4 VR2 | AF-S 50/f1.8G
Computer specs


Acties:
  • 0 Henk 'm!

  • supersnathan94
  • Registratie: Juli 2010
  • Laatst online: 13:08
Niet dat ik weet, maar waarom heb je die instellingen dan handmatig? Kennelijk is het niet de bedoeling dat je die instelling zo maar wijzigt, want Server gaan er van uit dat dit niet het geval is.

Acties:
  • 0 Henk 'm!

  • afterburn
  • Registratie: Januari 2000
  • Laatst online: 27-09 17:57

afterburn

No more...

Topicstarter
supersnathan94 schreef op donderdag 02 juli 2015 @ 11:36:
Niet dat ik weet, maar waarom heb je die instellingen dan handmatig? Kennelijk is het niet de bedoeling dat je die instelling zo maar wijzigt, want Server gaan er van uit dat dit niet het geval is.
:)

De configuratie van Apache is binnen de OS X Server app min of meer beperkt tot het aangeven van de URL en wel of geen ssl. Da's dus nogal beperkt en Apache kan een beetje meer. Voor de meeste dingen binnen een Mac netwerk is OS X Server prima te gebruiken, lig thuis, en daarom niet veel zin om Apache los te installeren. Het maakt ook verder niet zoveel uit of ik de OS X Server apache configs met de hand aanpas of dat ik de configs van een losse apache server met de hand aanpas. Maar het zou wel prettig wezen als OS X dan ook met de tengeltjes van mijn aangepaste configs afblijft ipv ze gewoon maar te vervangen door een default configuratie.

Fuji X-T1 | XF14mm F2.8 R | XF23mm F1.4 R | XF35mm F1.4 R
Nikon D800 | AF-S 24-120/f4 VR2 | AF-S 50/f1.8G
Computer specs


Acties:
  • 0 Henk 'm!

  • afterburn
  • Registratie: Januari 2000
  • Laatst online: 27-09 17:57

afterburn

No more...

Topicstarter
Na nog meer zoeken kwam ik iets tegen over webapps.plist. Is niet veel informatie over te vinden anders dan de man page:
webapp.plist(8) BSD System Manager's Manual webapp.plist(8)

NAME
webapp.plist -- plist file defining a managed webapp

DESCRIPTION

webapp.plist(8) BSD System Manager's Manual webapp.plist(8)

NAME
webapp.plist -- plist file defining a managed webapp

DESCRIPTION
Web applications managed with servermgr_web(8) are defined by plists placed in /Library/Server/Web/Con-
fig/apache2/webapps/.

In this context, a webapp is a set of Apache configuration directives and related behaviors, usually managing a set of
processes listening on specific TCP ports responding to HTTP requests, routed through the web service via reverse proxy
mechanism. This mechanism is used for webapps bundled with Server app but can also be used for third-party or locally-
developed web apps. When certain special keys are present the webapp.plist, those webapps can be enabled/disabled via
Server app's Web panel in as well as with the standard webappctl(8) command.

EXAMPLE XML PROPERTY LIST
The following is an example of an XML Property List defining a webapp named com.example.mywebapp, which will proxy URI
path /mywebapp to a balancer group of two URLs on the localhost, and activate one Apache include file and one Apache mod-
ule in a designated virtual host config file, using the default SSL policy:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>com.example.mywebapp</string>
<key>displayName</key> <!-- Name shown in Server app, alongside a checkbox to enable/disable this webapp -->
<string>MyWebApp</string>
<key>includeFiles</key>
<array> <!-- Include files are activated in virtual host when webapp is started -->
<string>/Library/Server/Web/Config/apache2/httpd_myinclude.conf</string>
</array>
<key>launchKeys</key>
<array> <!-- Launchd plists in /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons are loaded when webapp is started -->
<string>com.example.mywebapp</string>
</array>
<key>proxies</key> <!-- ProxyPass/ProxyPassReverse directives are activated when webapp is started -->
<dict>
<key>/mywebapp</key> <!-- Sets up a reverse proxy -->
<dict>
<key>keysAndValues</key>
<string></string>
<key>path</key>
<string>/mywebapp</string>
<key>urls</key> <!-- URLs comprise a proxy_balancer group -->
<array>
<string>http://localhost:3000</string>
<string>http://localhost:3001</string>
</array>
</dict>
</dict>
<key>requiredModuleNames</key>
<array> <!-- Apache plugin modules are enabled when webapp is started -->
<string>mystuff_module</string>
</array>
<key>requiredWebAppNames</key>
<array> <!-- Required Web apps are started when this webapp is started -->
<string>com.example.myotherwebapp</string>
</array>
<key>preflightCommand</key> <!-- return non-0 fails, return 0 means ok to start -->
<string>/usr/local/bin/preflightmywebapp</string>
<key>startCommand</key>
<string>/usr/local/bin/startmywebapp</string>
<key>stopCommand</key>
<string>/usr/local/bin/stopmywebapp</string>
<key>installationIndicatorFilePath</key> <!-- The presence of this file indicates web app is installed -->
<string>/usr/local/bin/mywebapp</string>
<key>sslPolicy</key> <!-- Determines webapp SSL behavior -->
<integer>0</integer> <!-- 0: default, UseSSLWhenEnabled -->
<!-- 1: UseSSLAlways -->
<!-- 2: UseSSLOnlyWhenCertificateIsTrustable -->
<!-- 3: UseSSLNever -->
<!-- 4: UseSSLAndNonSSL -->
</dict>
</plist>

KEYS FOR LOCALLY-INSTALLED WEBAPPS
displayName
A string to be presented in Server app's WebApp table view.

preflightCommand
A path to a command to run when the webapp is about to be started for the first time; it performs any required one-
time initialization (like setting up postgres relations) and returns true if and only if the webapp is fit for
starting.

startCommand
A path to a command to run when the webapp is started, to replace or augment the loading of a launchd.plis

stopCommand
A path to a command to run when the webapp is stopped, to replace or augment the unloading of a launchd.plist

installationIndicatorFilePath
A path to a file that is present if and only if the webapp is installed

ACTIVATION
A webapp plist can be associated with a specific virtual host and activated/deactivated either via the webappctl(8) com-
mand or via the get/setWebAppState commands of servermgr_web(8). Webapp plists for locally-installed applications, with
suitable keys noted above, can also be associated with a specific virtual host and activated/deactivated via Server app's
WebApp panel.

FILES
/Library/Server/Web/Config/apache2/webapps/
The directory where webapp plists must be placed

/Library/Server/Web/Config/apache2/webapp_scripts/
The directory where scripts to manage third-party webapps can be placed

/Library/Server/Web/Config/apache2/webapps/com.example.mywebapp.plist
An example webapp plist

SEE ALSO
servermgr_web(8) webappctl(8)

Server app July 25, 2013 Server app
(END)
Echter, als je het voorbeeld als basis gebruikt kom je er uiteindelijk uit. Ben er nog niet achter hoe je een webapp zichtbaar kunt maken in de OS X Server app, ondanks dat dit volgens de man page kan maar dat is minder belangrijk. Het belangrijkste is dat nu met een webapp als het goed is de custom configuratie (ik gebruik mod_proxy) nu blijft werken, ook na een update.

Fuji X-T1 | XF14mm F2.8 R | XF23mm F1.4 R | XF35mm F1.4 R
Nikon D800 | AF-S 24-120/f4 VR2 | AF-S 50/f1.8G
Computer specs


Acties:
  • 0 Henk 'm!

  • afterburn
  • Registratie: Januari 2000
  • Laatst online: 27-09 17:57

afterburn

No more...

Topicstarter
Ook gelukt. :)

Als je in je webapps plist het item:
code:
1
<key>installationIndicatorFilePath</key>

gevolgd door een string met als waarde een pad naar een file, mag een lege file zijn, en die file bestaat dan duikt je applicatie ineens op in de server app.

Fuji X-T1 | XF14mm F2.8 R | XF23mm F1.4 R | XF35mm F1.4 R
Nikon D800 | AF-S 24-120/f4 VR2 | AF-S 50/f1.8G
Computer specs