Guillaume
Guillaume

Reputation: 279

Running Opa server on port 80

What would be the cleanest way to run an opa app on port 80 :

Thanks

Kayhman

Upvotes: 2

Views: 455

Answers (3)

o-town
o-town

Reputation: 143

Here's what I do on my apache/vhost server to run an Opa app on just one domain. It requires mod_proxy on your apache server.

  1. Run Opa as a non privileged user, on port 8081.
  2. Configure the virtualhost within apache as follows:

    <VirtualHost *:80>
      ServerAdmin [email protected]
      ServerName www.example.com
      ServerAlias example.com
      DocumentRoot /var/www/domains/example.com/www/htdocs
      ErrorLog /var/log/apache2/www.example.com-error_log
      CustomLog /var/log/apache2/www.example.com-access_log common
    
      ProxyPreserveHost On
      ProxyRequests Off
    
      <Proxy *>
        Order deny,allow
        Allow from all
      </Proxy>
    
      ProxyPass / http://localhost:8081/
      ProxyPassReverse / http://localhost:8081/
    </VirtualHost>
    

This forwards all requests to example.com to the opa server running on port 8081.

Upvotes: 2

C&#233;drics
C&#233;drics

Reputation: 1994

You can use:

  • Authbind to start your app directly on port 80 via a non-privileged user
  • or start the app behind a proxy like nginx or haproxy.

Upvotes: 3

Quentin Pradet
Quentin Pradet

Reputation: 4771

Option 3: use a reverse proxy such as nginx (Apache would be overkill here) and leave opa on port 8080.

Upvotes: 2

Related Questions