Thursday, March 5, 2015

apache 2.4 - App running in subdirectory but needs 8080 port access, can't figure out reverse proxy

I'm very new to managing a server, so please bear with me.



I have a cloud server from Microsoft Azure (not by choice) running Ubuntu 16.04 and Apache 2.4.18. I have multiple apps (/omeka, /wordpress, etc) running in web subdirectories that I can access just fine via any web browser and don't require any specific port proxies or forwarding. I'm trying to run another app (ArchivesSpace) in another web subdirectory (/archivesspace). The app has multiple interaction points at different ports:




localhost:8089/ – the backend
localhost:8080/ – the staff interface
localhost:8081/ – the public interface
localhost:8090/ – the Solr admin console





I've installed AS successfully. I can tell because when connected to the server via SSH, I can use $ curl localhost:8080 and the output is the HTML of the AS homepage.



My netstat shows:



Proto  Recv-Q  Send-Q  Local Address  Foreign Address  State   PID
tcp6 0 0 :::8080 :::* LISTEN 1985/java
tcp6 0 0 :::8081 :::* LISTEN 1985/java
tcp6 0 0 :::8089 :::* LISTEN 1985/java
tcp6 0 0 :::8090 :::* LISTEN 1985/java



I can't access any of those ports from a browser. I get always get an ERR_EMPTY_RESPONSE error.



I've tried talking with ArchivesSpace folks about this and their final word was basically "set up Apache as a reverse proxy." So I've tried doing that and have had zero luck. I'm hoping someone here can help. Here's what I have for reverse proxy stuff so far in my 000-default.conf file, just trying to get one of the ports (8080) working.




ServerAdmin webmaster@localhost
DocumentRoot /var/www/html



Listen 8080


ProxyHTMLStripComments on
ProxyRequests off
SetOutputFilter proxy-html
ProxyHTMLDoctype XHTML
ProxyPreserveHost On


ServerName http://server.net/archivesspace


ProxyPass http://server.net:8080
ProxyPassReverse http://server.net:8080
Order allow,deny
Allow from all





I've enabled all of these Apache mods: proxy, proxy_ajp, proxy_http, rewrite, deflate, headers, proxy_balancer, proxy_connect, proxy_html



I'm clearly doing something wrong, I just have no idea what. I also am not even entirely sure what the appropriate URLs I need are. I'm assuming that server.net:8081 (or maybe server.net:8081/archivesspace ?) is supposed to take you to the AS public interface. Ideally it would be server.net/archivesspace. Is reverse proxy even the right way to go about this?



The instructions for the apache-2.4 tag say to post the output of apache2ctl -S, so here's that.



[Wed Feb 15 16:34:59.401845 2017] [proxy_html:notice] [pid 3722] AH01425: I18n support in mod_proxy_html requires mod_xml2enc. Without it, non-ASCII characters in proxied pages are likely to display incorrectly.
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.2.0.4. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:

*:80 10.2.0.4 (/etc/apache2/sites-enabled/000-default.conf:1)
*:8080 server.net/archivesspace (/etc/apache2/sites-enabled/000-default.conf:34)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex proxy: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl

Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used


Please let me know if there's any additional info I can provide that would help identify my problem. Thanks in advance for any guidance you can offer.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...