Difference between revisions of "AppSuite:Apache Configuration"

m
(US 68424070: Remove AJP because of discontinued support)
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Apache Configuration=
+
{{Stability-experimental}}
  
If you read this in your browser you should have done this already:
+
<div class="title">Apache Configuration</div>
  
# Check out the UI from git
+
__TOC__
# Figure out Apache's document root. Common places are:
+
 
  * MacOS: /Library/WebServer/Documents
+
To setup your development environment please follow these steps.
  * Linux: /var/www
+
 
 +
==Setup build system==
 +
# Check out the UI from git
 +
# Figure out Apache's document root. Common places are:<br>MacOS: /Library/WebServer/Documents<br>Linux: /var/www
 
# Create a new folder appsuite in Apache's document root
 
# Create a new folder appsuite in Apache's document root
# You need node.js to build the UI<br>For MacOS (use /var/www instead of /Library/WebServer/Documents for debian):
+
# You need node.js to build the UI. For MacOS (use /var/www instead of /Library/WebServer/Documents for debian).
  * Visit https://sites.google.com/site/nodejsmacosx/ and install stable version.
+
 
  * Open terminal
+
===Installing node.js===
  * Set environment variable:<br>export buildir="/Library/WebServer/Documents/appsuite"
+
# Visit https://sites.google.com/site/nodejsmacosx/ and install stable version.
  * Build UI: ./build.sh
+
# Open terminal
  * Build documentation: ./build.sh docs
+
# Set environment variable:<br>''export builddir="/Library/WebServer/Documents/appsuite"''
  * Note: Instead of exporting the builddir every time your want to build the ui or run the appserver, you can also create a file '''local.conf''' and set the directory in there. This way, every time the buildsystem or appserver runs, it automatically picks up the correct directory.
+
# Build UI: '''./build.sh'''
  * local.conf:<br>export buildir="/Library/WebServer/Documents/appsuite"
+
# Note: Instead of exporting the builddir every time your want to build the ui or run the appserver, you can also create a file '''local.conf''' and set the directory in there. This way, every time the buildsystem or appserver runs, it automatically picks up the correct directory.<br>local.conf: ''export builddir="/Library/WebServer/Documents/appsuite"''
# Run the app loading server: ./appserver.sh
+
 
<br>Don't worry: If it doesn't tell you anything it's happily running.
+
===AppServer===
# If everything works fine, the documentation should be at http://localhost/appsuite/doc.
+
Run the app loading server: '''./appserver.sh''' Don't worry: If it doesn't tell you anything it's happily running.
 +
 
 +
==Apache config==
 +
Make sure Apache loads the following modules:<br>''mod_proxy, mod_proxy_http, mod_expires, mod_deflate, mod_rewrite, mod_headers, mod_mime, and mod_setenvif''
 +
 
 +
Tell your Apache to process .htaccess files and how to connect to backend:
 +
 
 +
<pre class="language-conf">
 +
ProxyPass /appsuite/api/apps/load/ http://localhost:8337/apps/load/
 +
ProxyPass /appsuite/api http://127.0.0.1:8009/ajax
 +
# optional parameters: retry=0 connectiontimeout=5 timeout=10
 +
 
 +
&lt;Directory /Library/WebServer/Documents/appsuite>
 +
  Options None +FollowSymLinks
 +
  AllowOverride Indexes FileInfo
 +
&lt;/Directory>
  
Now configure Apache:
+
</pre>
  
# Make sure Apache loads the following modules:<br>mod_proxy, mod_proxy_ajp, mod_expires, mod_deflate, mod_rewrite, mod_headers, mod_mime, and mod_setenvif
+
Use the proper document root depending on your OS or custom configuration! If backend does not run on localhost (127.0.0.1), you have to adjust the ProxyPass directive.
  
# Tell your Apache to process .htaccess files and how to connect to backend:
+
'''Restart Apache''', e.g. sudo apachectl restart. And please double check everything you're doing!
   
 
    ProxyPass /appsuite/api/apps/load/ http://localhost:8337/apps/load/
 
    ProxyPass /appsuite/api ajp://127.0.0.1:8009/ajax
 
    # optional parameters: retry=0 connectiontimeout=5 timeout=10
 
  
    <Directory /Library/WebServer/Documents/appsuite>
+
==Setup SSL support on MacOS==
      Options None +FollowSymLinks
 
      AllowOverride Indexes FileInfo
 
    </Directory>
 
  
    Use the proper document root depending on your OS or custom configuration!
+
Based on: http://webdevstudios.com/2013/05/24/how-to-set-up-ssl-with-osx-mountain-lions-built-in-apache/
  
# If backend does not run on localhost (127.0.0.1), you have to adjust the ProxyPass directive.
+
* Open terminal and '''cd /private/etc/apache2'''
 +
* Become root: '''sudo su'''
 +
* '''mkdir ssl'''
 +
* Open ''httpd.conf'' in your text editor, e.g. '''vim httpd.conf'''
 +
** Make sure the SSL module is enabled if it’s not. Do this by uncommenting (aka, remove the ‘#’ symbol in front) the line that looks like: ''LoadModule ssl_module libexec/apache2/mod_ssl.so''
 +
** In the same file search for and uncomment (remove the #) this line: ''Include /private/etc/apache2/extra/httpd-ssl.conf''
 +
** Save and close.
 +
* Now open ''httpd-ssl.conf'' file in your text editor, e.g. '''vim httpd-ssl.conf'''
 +
** Make sure '''ServerName''' line looks like: ''ServerName localhost''
 +
** Modify '''ServerAdmin''' line to use one of your email addresses
 +
** '''SSLCertificateFile "/private/etc/apache2/ssl/ssl.crt"'''
 +
** '''SSLCertificateKeyFile "/private/etc/apache2/ssl/ssl.key"'''
 +
** In the same file comment out (add a # to the beginning of the line) the '''SSLCACertificatePath''' and '''SSLCARevocationPath''' lines if they’re not already.
 +
** Save and close.
 +
* Now go to new ssl folder: '''cd /private/etc/apache2/ssl'''
 +
** The following steps are based on http://www.akadia.com/services/ssh_test_certificate.html<br>Don't have to read, just run the following commands:
 +
** '''openssl genrsa -des3 -out server.key 1024'''<br>Pass-phrase can be anything stupid, we'll remove it
 +
** '''openssl req -new -key server.key -out server.csr'''
 +
** '''cp server.key server.key.org<br>openssl rsa -in server.key.org -out server.key'''
 +
** '''openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt'''
 +
* Restart apache: '''apachectl restart'''
  
# Restart Apache, e.g. sudo apachectl restart
 
  
And please double check everything you're doing!
+
[[Category:AppSuite]]
 +
[[Category:UI]]

Latest revision as of 09:02, 18 November 2014

API status: In Development

Apache Configuration

To setup your development environment please follow these steps.

Setup build system

  1. Check out the UI from git
  2. Figure out Apache's document root. Common places are:
    MacOS: /Library/WebServer/Documents
    Linux: /var/www
  3. Create a new folder appsuite in Apache's document root
  4. You need node.js to build the UI. For MacOS (use /var/www instead of /Library/WebServer/Documents for debian).

Installing node.js

  1. Visit https://sites.google.com/site/nodejsmacosx/ and install stable version.
  2. Open terminal
  3. Set environment variable:
    export builddir="/Library/WebServer/Documents/appsuite"
  4. Build UI: ./build.sh
  5. Note: Instead of exporting the builddir every time your want to build the ui or run the appserver, you can also create a file local.conf and set the directory in there. This way, every time the buildsystem or appserver runs, it automatically picks up the correct directory.
    local.conf: export builddir="/Library/WebServer/Documents/appsuite"

AppServer

Run the app loading server: ./appserver.sh Don't worry: If it doesn't tell you anything it's happily running.

Apache config

Make sure Apache loads the following modules:
mod_proxy, mod_proxy_http, mod_expires, mod_deflate, mod_rewrite, mod_headers, mod_mime, and mod_setenvif

Tell your Apache to process .htaccess files and how to connect to backend:

ProxyPass /appsuite/api/apps/load/ http://localhost:8337/apps/load/
ProxyPass /appsuite/api http://127.0.0.1:8009/ajax 
# optional parameters: retry=0 connectiontimeout=5 timeout=10

<Directory /Library/WebServer/Documents/appsuite>
  Options None +FollowSymLinks
  AllowOverride Indexes FileInfo
</Directory>

Use the proper document root depending on your OS or custom configuration! If backend does not run on localhost (127.0.0.1), you have to adjust the ProxyPass directive.

Restart Apache, e.g. sudo apachectl restart. And please double check everything you're doing!

Setup SSL support on MacOS

Based on: http://webdevstudios.com/2013/05/24/how-to-set-up-ssl-with-osx-mountain-lions-built-in-apache/

  • Open terminal and cd /private/etc/apache2
  • Become root: sudo su
  • mkdir ssl
  • Open httpd.conf in your text editor, e.g. vim httpd.conf
    • Make sure the SSL module is enabled if it’s not. Do this by uncommenting (aka, remove the ‘#’ symbol in front) the line that looks like: LoadModule ssl_module libexec/apache2/mod_ssl.so
    • In the same file search for and uncomment (remove the #) this line: Include /private/etc/apache2/extra/httpd-ssl.conf
    • Save and close.
  • Now open httpd-ssl.conf file in your text editor, e.g. vim httpd-ssl.conf
    • Make sure ServerName line looks like: ServerName localhost
    • Modify ServerAdmin line to use one of your email addresses
    • SSLCertificateFile "/private/etc/apache2/ssl/ssl.crt"
    • SSLCertificateKeyFile "/private/etc/apache2/ssl/ssl.key"
    • In the same file comment out (add a # to the beginning of the line) the SSLCACertificatePath and SSLCARevocationPath lines if they’re not already.
    • Save and close.
  • Now go to new ssl folder: cd /private/etc/apache2/ssl
    • The following steps are based on http://www.akadia.com/services/ssh_test_certificate.html
      Don't have to read, just run the following commands:
    • openssl genrsa -des3 -out server.key 1024
      Pass-phrase can be anything stupid, we'll remove it
    • openssl req -new -key server.key -out server.csr
    • cp server.key server.key.org
      openssl rsa -in server.key.org -out server.key
    • openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
  • Restart apache: apachectl restart