I have a fedora server. I installed tomcat via yum package manager. Then I deployed the nexus war on the webapps folder. I tryed using jsvc to run the server on port 80 and did not work. I saw you can also use port fowarding. What is the best alternative ?
I followed 3.8. Running Nexus Behind a Proxy from sonatype doc and I'm a bit confused. I installed httpd, and I have the following configuration, where example.com is my domain.
/etc/httpd/conf.d/nexus.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerName example.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /nexus/ http://localhost:8081/nexus/
ProxyPassReverse /nexus/ http://localhost:8081/nexus/
ProxyPreserveHost On
<Location />
Order allow,deny
Allow from all
</Location>
ErrorLog logs/nexus/error.log
CustomLog logs/nexus/access.log common
</VirtualHost>
/home/guillaume/www/nexus/conf
# Jetty section
application-port=8081
application-host=0.0.0.0
nexus-webapp=${bundleBasedir}/nexus
nexus-webapp-context-path=/nexus
# Nexus section
nexus-work=${bundleBasedir}/../sonatype-work/nexus
runtime=${bundleBasedir}/nexus/WEB-INF
pr.encryptor.publicKeyPath=/apr/public-key.txt
when I try to access
http://localhost:8081/nexus/index.html
everything workhttp://localhost/nexus/index.html
everything workhttp://example.com/nexus/index.html
just hang ( port 80 is open in the firewall )
$netstat -tulpn | grep :80
tcp 0 0 :::80 :::* LISTEN 3965/httpd
tcp 0 0 :::8081 :::* LISTEN 3811/java
udp 0 0 0.0.0.0:803 0.0.0.0:* 1051/rpc.statd
any clue on how to make that proxy work ?
I found the error, the dns was wrong: nslookup example.com
resolved to x.x.x.x
when my ip was x.x.x.y
but I did enjoy ngix configuration
server {
listen 80;
server_name example.com;
access_log off;
error_log off;
location / {
proxy_pass http://localhost:8081;
proxy_redirect off;
#Proxy Settings
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# would be a good idea to redirect static assets
}
I don't like running java app servers on port 80. Requires the process to be run as root.
The best approach is to install Apache (or Nginx) and configure nexus as a reverse proxy. For more details on how this is done I'd suggest reading the relevent section of the Nexus book:
Note