ajp/1.3 port no is not showing in apache tomcat - java

I was running my web program in eclipse ide using apache tomcat but while changing my port number I didn't find ajp/1.3 port, I think in past while solving an error I tried to change it and now it's not there, I tried to reinstall apache tomcat but still, it's not coming.
please help me

Go to the Tomcat server conf($Tomcat_Home/conf) directory and check the AJP connector available or not in server.xml. If not the add below entry in server.xml after HTTP connector.
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Related

Apache Tomcat SSL Http11AprProtocol Connector

I am working on Link-OS web-service with self-signed CA.
I followed this to create a self-signed CA
I deployed the printer server by following these instructions
https://github.com/ZebraDevs/LinkOS-Webservices-Samples
Whenever I add this part to server.xml, no page will work including localhost:8080 although the server is running without showing or throwing errors or exceptions.
<Connector
protocol="org.apache.coyote.http11.Http11AprProtocol"
SSLEnabled="true" SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"
maxThreads="200" port="8443" SSLVerifyClient="optional"
scheme="https" secure="true"
SSLCertificateFile="C:\cert\SERVER.crt"
SSLCertificateKeyFile="C:\cert\SERVER.key"
/>
what could go wrong with these steps? I have followed them step by step
I am using:
Java 8
Tomcat 7
APR 1.7
following this solution will make the server works fine, but it won't work with the printers, so it is not what I am looking for.
You used an APR Connector here. (protocol="org.apache.coyote.http11.Http11AprProtocol")
APR implementation needs Apache Portable Runtime (APR) and Tomcat Native library.
You can install them with these commands:
apt install libtcnative-1
apt install libapr1-dev libssl-dev
or if either package is not found, try this answer.
I think you should implement cert-sign certification without APR, because an APR connector needs extra libraries. İf you want, try these instructions.

Apache in front of Tomcat not working

I am using the following example file: https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/ and have deployed it on Tomcat.
I want to put Apache in front of Tomcat. I have the following config on my Tomcat's server.xml:
<Connector port="8081" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />
My Apache is running on port 80, and my workers.properties looks as follows:
worker.list=jboss,tomcat
worker.jboss.port=8009
worker.jboss.host=127.0.0.1
worker.jboss.type=ajp13
worker.tomcat.port=8010
worker.tomcat.host=127.0.0.1
worker.tomcat.type=ajp13
Note that I also have JBoss running. Then my uriworkermap.properties looks as follows:
/App/*=jboss
/sample/*=tomcat
/sample=tomcat
/sample/=tomcat
The JBoss config works fine. If I go to http://localhost:8081/sample/ my webpage is displayed. But if I go to http://localhost:80/sample/ I get a
The Webpage cannot be found error. What am I doing wrong?
This is what http://localhost:8081/sample/ looks like:
you can't run a java app on apache web server. you need a servlet container like tomcat to run a java app. If you want to use apache as a gateway to your app deployed at tomcat, you can have some static file or cgi script in your apache server and that script or html file could call your app deployed at tomcat. URL http://localhost:80/sample/ is not working because it's expecting a file name sample in your apache's www (usually) directory and your probably don't have that file in there.

How do I use http://example.com instead of http://example.com/Example/?

Here /Example is my .war file and all file in it in .jsp format.
I have access my .war via http://example.com:8080.
How can I access it via http://example.com?
You can find the anwser in the Tomcat documentation at: https://tomcat.apache.org/tomcat-6.0-doc/config/http.html
You can do one of the following:
1) Edit the conf/server.xml file in your tomcat installation folder. (I assume you are using tomcat, if not - look for an equivalent file for your web server). Here is a sample entry (edit the port here)
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
Restart tomcat.
2) The second way is to use re-directs or url-rewrites to forward traffic to port 8080 to port 80.
Change the http connector port from 8080 to 80 in your tomcat's server.xml. Look for <Connector tag and there you will see port attribute
Rename your WAR file to ROOT.war, the name ROOT for tomcat means that it is the root context (all capital letters) and the name is reserved for such this purpose. See https://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming
Next, change the listener port in conf/server.xml from 8080 to 80.

How to deploy a java application as root in tomcat without allow access to other webapps

I have a java application.war and I copied the file to tomcat7/webapps directory.
I'm able to access it with www.application.com/application (My domain points to ip 200.xyz.12.jk:8080) BUT
I want to access it through www.application.com (without the name of the folder inside webapps directory)
Also i dont want to allow access to other folders inside webapps.
I have tried some topics but didnt succeed.
Failed to help:
Deploying my application at the root in Tomcat
https://josefbetancourt.wordpress.com/2011/02/12/tomcat7-change-root-app/
Tomcat 6: How to change the ROOT application
Thank you so much
Place your tomcat under apache http server then point it to tomcat's AJP protocol.
Example of Apache httpd.conf configuration:
Listen 80
ProxyPass / ajp://application.com:8009/application
In tomcat server.xml file you should have below ajp connector:
<Connector port="8009" protocol="AJP/1.3" />
As a result www.application.com/ url points to the application entire directory over ajp protocol.
Hope this will help you.

Corrupted special characters using Jersey and Tomcat 7

I have a strange problem with special characters. They are corrupted but
when I run it on localhost (Tomcat 7.0.12) is everything ok, when I deploy it at remote server (Tomcat 7.0.34) the characters are corrupted. I am realy confused.
Does anybody have similiar problem?
localhost:
wikicategory_Languages_of_São_Tomé_and_Príncipe
wikicategory_Subject–verb–object_languages
remote server:
wikicategory_Languages_of_S��o_Tom��_and_Pr��ncipe
wikicategory_Subject���verb���object_languages,
note: I have set utf-8
in endpoint:
#Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
in server configuration:
server.xml
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="utf-8"
maxPostSize="0"
maxHttpHeaderSize="131072" />

Categories

Resources