Solr with Jetty on LAMP server - Admin page access issue - linux

I have Solr with its default Jetty that came with example directory installed on Linux server which has apache2 as its web server.
Now, within the same private LAN, when I open a browser and type in http://<ip-address>:8983/solr works ONLY when I do port forwarding otherwise it doesn't work. I am not sure what could be the problem? Please note this installation has been done on a remote server in a hosting environment for production deployment and I am a beginner wrt deployment stuff.

You can use the jetty.host parameter during startup to allow direct access to Jetty.
The -D option of the java command can be used with the followin syntax:
java -Djetty.host=0.0.0.0 -jar start.jar
In this way Jetty can be reached from all the hosts.
However this is not the ideal setup IMHO. I prefere to setup Jetty to listen only on localhost, implementing the client with another frontend server which listen on port 80. If you want to implement the frontend on another server you can use iptables to limit the incoming connection, dropping everything on the 8983 port if the IP is different from the one of your frontend server.
This image depicts my preferred setup for a LAMP stack includin SOLR:

Related

Stop apache and run node server

I have a centos 7.9 linux server with whm panel installed. Apache is installed directly on the domain names I created, I don't want to run apache on the subdomain of one domain name. I want to run a node js server. When I say "service httpd stop", they all shut down. What to do?
Network services don't bind themselves to specific hostnames. You have one Apache server running. Any connection to port 80 will connect to that server. Apache then looks at the host header in the HTTP request to determine which website to respond with.
If you want one site to use Node.js then you need to pick one of these options:
Configure Apache to act as a reverse proxy for the Node.js hosted server
Run the Node.js server on a different computer and point the host name at that computer
Have multiple network interfaces for the existing computer, with their own IP addresses, configure Apache to listen on one and Node.js to listen on the other, then point the hostnames at the right IP addresses.
(I don't recommend the last one as it is the most fiddly).

IIS Apache and Node.JS HTTP all on the same server

I have one windows server already running sharepoint on 80/443 and the site works correctly.
We're trying to add more functionality by installing NodeJS and Apache
I've set apache to listen on 8080 and the default website comes up.
Node is running on 3000 and I can access the explorer that way as well.
My questions come from this. The server has a complete certificate chain installed on it and https://:8080 comes up correctly, but I can't get the node stuff to work on https: Secondly it appears while I have proxy pass set up correctly within my httpd.conf, either something is wrong within that as if I goto the https://:8080 /api/and anything beyond that, I get 503 errors and the page can't be displayed.
I'm unsure what I'm doing incorrectly here as from reading the documentation on proxy module, it seems that everything is setup and configured correctly.
Netstat shows listening on 3000 and 8080 and 80/443 for my SharePoint farm.
I had to configure the ssl settings for the proxypass to use the IP address of the local machine. After doing that I was able to connect correctly.
This allowed for connecting on :3000 via telnet to the localmachine and allowed for explorer to be viewed with https://:8080 the correct way enforcing our certificates.

Configure Linux Server as Web Server

I am currently working on my own web application. I am hosting aws linux server.
My question is:
I can deploy war file into /var/lib/webapps/test.war, and access each single page from this war, furthermore, I am binging A record to my ip address. Assume, I am binding www.test.com to my ip. So that I can access my web page from test.war by www.test.com:8080/test/single.html.
How can I access only by www.test.com/single.html?
One more thing is, if i have one file t.html under /var/www/html/t.html. I can access this file by www.test.com/t.html.
How should I deploy my test.war in order to access it by www.test.com/single.html
Let me know if any description is not clear. I tried couple of days. Hope anyone can help!
Do you need to deliver static content via the Apache HTTP?
YES: Configure Apache as reverse Proxy for Tomcat.
NO: Configure Tomcat to listen on Port 80.
EDIT:
Since i realized you need further explanation:
Apache HTTP normally listens on Port 80. A Web-Browser tries to connect on Port 80 or 443 automatically when u enter a domain or an IP. Apache HTTP usually serves content from /var/www/....
Tomcat is an Application Server and listens in your case on Port 8080. Tomcat deploys webapps from /var/lib/webapps (With your configuration).
You cant just put a Java webapp in Apache's Document root. Apache has no Idea how to handle such content...
If you want to reach your webapp on Port 80 you can either reconfigure Tomcat to listen on Port 80 or use the Apache HTTP as reverse proxy (https://en.wikipedia.org/wiki/Reverse_proxy).
READ THE DOCS!
Change the port of Tomcat from 8080 to 80. Currently, your tomcat server listens to port 8080. Only if it listens to port 80, the suffix :8080 will be hidden. Only one application can bind to a port at a time, so make sure your Apache HTTP server is not binding to 80.
Change the port of Apache HTTP or just stop this service.
Back up files in folder webapps/ROOT, because your following action will replace its content. Rename test.war to ROOT.war and deploy your application at the root in Tomcat.
Rename test.war to ROOT.war (capitalization important) and deploy it to the same location. Tomcat will use that as the "root" webapp and you won't need to include a folder in the URL.

Accessing Web application in tomcat without port numbers

I am trying to have multiple tomcat instances on a Linux server and each instance would have an web application ROOT deployed in it.
While accessing the application, the url is formed in the format : whereas I don't want the end users to remember the ip address or the port of the application.
Since more than one instances would be used in the linux server, defaulting to 80 port ( http ) and 443 ( https ) wouldn't help out.
The idea is to expose the DNS name for the application and looks like Apache HTTP server would help me solve the case. Is the approach right ?
I assume the apache server should be one per linux server vs one per tomcat instance. Could this be confirmed ?
The Apache Tomcat version is 8.5.4 and the plan is to go with the apache http server version 2.4
Setting an Apache HTTPD (or any other) as front server is a good approach.
You won't be able to use more than one Apache HTTPD per server, since you don't want to use :port notation in the url's, at least it will not be possible to use standard HTTP/HTTPS ports in more than one HTTPD at once at the same server.
If you plan to use both http and https, you should create at least one virtual host for each of them. There is a limitation on creating virtual hosts for name based virtual host while using SSL 443 port, so if you want to have more than one HTTPS port enabled you will need IP based virtual hosting.
This is the Apache HTTPD 2.4 virtual host documentation.
Then, you could forward requests to each Tomcat using mod_proxy or tomcat connector. I personally choose one or other depending on the current requirements, specially if there is straight correspondence between contexts in Tomcat and Apache HTTPD (in this case I use AJP) or there's the need to rewrite it (mod_rewrite):
httpd://apache.httpd/context1 -> tomcat:XXXX/context1 (ajp tomcat connector)
httpd://apache.httpd/ -> tomcat:XXXX/context2 (mod_rewrite)
httpd://apache.httpd/context3 -> tomcat:XXXX/context4 (mod_rewrite)

TCP server won't work on Openshift NodeJS

I've used the openshift-cartridge-tcp-endpoint cartridge to try and make a TCP server which I can access from a desktop application.
I've set it up on a scaleable application and I can see the OPENSHIFT_NODEJS_PORT_TCP and OPENSHIFT_NODEJS_PROXY_PORT_TCP values when I list the environment variables using 'export' when ssh'd into my application.
The problem is, when I do 'rhc ssh APP_NAME oo-gear-registry all', no port is listed over which I can access my TCP application and when I try to access the application over the port given by the HTTP server, it does not connect. Do I have to take additional steps to make the port show up and be accessible?
It looks like that cartridge is over 2 years old, and probably doesn't work with the current version of OpenShift Online, as it only exposes port 8080 publicly and uses an HTTP/WS reverse proxy, so only http or web services connections would work. You might try logging an issue with the cartridge's creator here (https://github.com/Filirom1/openshift-cartridge-tcp-endpoint/issues) and ask them if it still works or not.

Resources