apache tomcat webserver
Hi all,
I wanted to redirect url from https://example.com to https://www.servercom:7777 and for this i modified the server.xml as below in tomcat config, and the below configuration doesnot seems to work. Does anyone has ideas. Please suggest. The url alone https://www.servercom:7777/ already works. But just redirection from the old to one doesnot. Its centos linux system Code:
<Host name="example.com" appBase="app" unpackWARs="true" autoDeploy="true"> |
Due to your query I tried installing httpd using cygwin at my localhost Windows 11
After installation I performed following changes: Code:
$ /usr/bin/grep "^Listen" /etc/httpd/conf/httpd.conf Code:
$ /usr/bin/cat startapache.sh C:\Users\MURUGE~1\DOCUME~1\MYWEBS~1\WebSite1 After viewing your query I have moved all files from above directory to: /srv/www/htdocs directory at windows %cygwindir%\srv\www\htdocs It is working fine for me Code:
$ /cygdrive/c/WINDOWS/system32/NETSTAT.EXE -nato | grep 7777 |
Quote:
Hi its not apache, Its tomcat webserver also I am not using Windows. Its linux server. |
I can understand this.
Since I do not have Linux, I was trying to reproduce the same at Windows 11 Today installed apache tomcat at windows 11 Command using cygwin (bash.exe) Code:
$ grep 7777 ../conf/server.xml at browser is working fine. Hence you need to set related port number at server.xml file at your OS |
Quote:
Looks like i dont need to redirect I just wanted to use the other url to be working in the same way https://example.com --> this not https://www.servercom:7777 -->this works So I see you used http.conf and all, I dont really understand if you need this ? I just used localhost in server.xml file </Host> <Host name="localhost" appBase="towl" unpackWARs="true" autoDeploy="true"> How can i make https://example.com this url working ? |
I have modified conf/server.xml
Code:
<Connector port="7777" protocol="HTTP/1.1" Code:
$ bin/shutdown.sh http://127.0.0.1 http://127.0.0.1:7777 working fine at locahost. Code:
$ bin/shutdown.sh |
Can you please put server.xml fileconfigurazion for host and connectors. I am using https not http. Thanks for your time
|
1)
can you edit your comment and remove: Thank you for removing invalid comments. 2) Sample server.xml file I have tried(after download sample file from internet) at localhost you can compare attached file with your file and view related requirements at your environment. Code:
<?xml version="1.0" encoding="UTF-8"?> That will take time. if required, send me your server.xml and I will try the same at localhost (if required) |
Thank you very much for your fast response. Removed the quote you have asked for.
Code:
<?xml version="1.0" encoding="UTF-8"?> To be clear: localhost: www.server.com alias name Or dns of localhost: example.com https://www.server.com:7777/example --> works https://example.com:7777 --> works https://example.com--> doesnotwork I am suspecting some SSL authentication is not properly set here. as https://example.com redirects toport 443 by default ? |
01)
Remove all words having the letters orry at your comment. 02) ttps://www.server.com:7777/example --> works https://example.com:7777 --> works https://example.com--> doesnotwork I need to know your comment: Quote:
Hence you need 80 port as well at https Since default port without port number is 80)? a) check 80 is not in use I have stopped windows IIS before providing my first comment validate using netstat b) validate using lsof Example at my cygwin: Code:
$ lsof -i:22 $ lsof -i:80 java.exe 5716 Services 0 113932 K PORT: 7777 80 9090 java.exe 5716 Services 0 113932 K PORT: 7777 80 9090 I am having following lines at server.xml Code:
<Connector port="80" protocol="HTTP/1.1" My server.xml having opening and close tag for: <Connector .../> How about your .xml file ? [/code] I cannot copy your .xml file to my localhost: Reason: I need to re-create all pem/crt/jsk files a lot... |
Quote:
Here we are using 8080 instead of 80 and I modfied 8443 for https Code:
lsof -i:8443 <Connector .../> https://www.server.com:8443/example --> works https://example.com:8443 --> works https://example.com--> doesnotwork --> How can i make with out port to be working ? |
As of now I cannot help you since I am unable to reproduce the same at localhost.
01) I tried copying your server.xml(after a backup of my server.xml) unable to start tomcat here using your xml file (dependent on openssl/keytool) 02) Here goes the way I am performing apache tomcat at windows: a) download apache-tomcat-11.0.0-M19.zip b) unzip and use the server.xml file I gave you without using any openssl.exe or and /cygdrive/c/PROGRA~2/Jdk17/bin/keytool at my system. Hence I am able to access: http://127.0.0.1:7777/mis_interest_valid_Dates.html http://127.0.0.1:7777/ and all sub pages. I made changes to perform: .css file and .js file acesss using tomcat config files. However I need to search or perform related(all) actions to change http to https here. if you have related automated commands/$HISTFILE for openssl share the same here for me to reproduce at my system => Using that I can resolve your error. How about: Code:
lsof -i:80 |
Hi Thanks again, I have never worked with tomcat before and I am stuck where the issue lies.
search sorry in this page.[/QUOTE] Quote:
Code:
lsof -i:80 --> nothing comesup |
Before making changes to server.xml make a backup.
My backup names: Example at my system: Code:
$ /usr/bin/ls -ltr server.xml* Code:
<?xml version="1.0" encoding="UTF-8"?> Code:
#!/bin/bash http://127.0.0.1=> automatically redirecting to https://127.0.0.1 http://127.0.0.1/mis_interest_valid_Dates.html => automatically redirecting to https://127.0.0.1/mis_interest_valid_Dates.html Hence make similar changes at your server.xml(backup files and restart) Can you share your timing ? My timing: Code:
$ /usr/bin/date "+%a %d-%b-%Y %I:%M %p %Z" https://127.0.0.1:443/mis_interest_valid_Dates.html it is automatically redirecting to: https://127.0.0.1/mis_interest_valid_Dates.html |
Thank you very much for your time, I tried to change the configuration like you provided server.xml file and now I cannot reach any of the urls. From my point of view, 8443 and 443 are two different ports. As the certificate is already there for 8443 and its working fine. I would assume that we need new certificate for 443 and then configure in apache tomcat. Not sure if this is solution. Also my server is not listening on port 443, because of this also its not possible to redirect port from 443 to 8443
My time zone is CEST. when i do wget, I have this Code:
Proxy tunneling failed: Gateway TimeoutUnable to establish SSL connection |
All times are GMT -5. The time now is 09:18 AM. |