LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-30-2024, 04:32 AM   #31
sag2662
Member
 
Registered: Sep 2022
Posts: 69

Original Poster
Rep: Reputation: 0

Quote:
Originally Posted by murugesandins View Post
other errors error here too on using your file for my testing.
you need to analyze log files
Example:
Code:
$ cd /home/Murugesan/Din_Back/apache-tomcat-11.0.0-M19/conf
$ grep -i error ../logs/catalina.2024-04-30.log
Hi how to disable the url https://example.com/example but only https://example.com should work

Last edited by sag2662; 04-30-2024 at 07:30 AM.
 
Old 04-30-2024, 08:09 AM   #32
murugesandins
Member
 
Registered: Apr 2024
Location: Bangalore Karnataka India
Distribution: CYGWIN_NT
Posts: 61

Rep: Reputation: 0
Wait until I set all required settings at 127.0.0.1 to make my tomcat to listen to available port numbers.
Example ports I have found till now:
Code:
#0.0.0.0:22     sshd.exe
#0.0.0.0:135    svchost.exe
#0.0.0.0:1801   mqsvc.exe
I knew that following comment 10% not related to your query,
Code:
#!/bin/bash
IPv4=$(/cygdrive/c/WINDOWS/system32/ipconfig.exe 2>&1 | /usr/bin/tr -d "\r" | /usr/bin/awk '"IPv4" == $1 { print $NF}')
#0.0.0.0:22     %HOME%\..\..\usr\sbin\sshd.exe
#[::]:22        %HOME%\..\..\usr\sbin\sshd.exe
#0.0.0.0:49665  C:\WINDOWS\system32\wininit.exe
#[::]:49665     C:\WINDOWS\system32\wininit.exe
#0.0.0.0:49668  C:\WINDOWS\system32\spoolsv.exe
#[::]:49668     C:\WINDOWS\system32\spoolsv.exe
#0.0.0.0:49669  C:\WINDOWS\system32\svchost.exe
#[::]:49669     C:\WINDOWS\system32\svchost.exe
#0.0.0.0:49667  C:\WINDOWS\system32\svchost.exe
#[::]:49667     C:\WINDOWS\system32\svchost.exe
#0.0.0.0:49666  C:\WINDOWS\system32\svchost.exe
#[::]:49666     C:\WINDOWS\system32\svchost.exe
#0.0.0.0:5040   C:\WINDOWS\system32\svchost.exe
#0.0.0.0:135    C:\WINDOWS\system32\svchost.exe
#[::]:135       C:\WINDOWS\system32\svchost.exe
#0.0.0.0:49664  C:\WINDOWS\system32\lsass.exe
#[::]:49664     C:\WINDOWS\system32\lsass.exe
#0.0.0.0:49671  C:\WINDOWS\system32\services.exe
#[::]:49671     C:\WINDOWS\system32\services.exe
#0.0.0.0:49670  C:\WINDOWS\system32\mqsvc.exe
#[::]:49670     C:\WINDOWS\system32\mqsvc.exe
#0.0.0.0:1801   C:\WINDOWS\system32\mqsvc.exe
#[::]:1801      C:\WINDOWS\system32\mqsvc.exe
#0.0.0.0:2103   C:\WINDOWS\system32\mqsvc.exe
#[::2103]]      C:\WINDOWS\system32\mqsvc.exe
#0.0.0.0:2107   C:\WINDOWS\system32\mqsvc.exe
#[::]:2107      C:\WINDOWS\system32\mqsvc.exe
#0.0.0.0:2105   C:\WINDOWS\system32\mqsvc.exe
#[::]:2105      C:\WINDOWS\system32\mqsvc.exe
#0.0.0.0:5357   System
#[::]:5357      System
#$IPv4:139      System
/cygdrive/c/WINDOWS/system32/netstat.exe -nato 2>&1 |\
/usr/bin/grep -E -v "\
\[::\]:22|\
0.0.0.0:22|\
0.0.0.0:135|\
\[::\]:135|\
$IPv4:139|\
0.0.0.0:1801|\
\[::\]:1801|\
0.0.0.0:2103|\
\[::\]:2103|\
0.0.0.0:2105|\
\[::\]:2105|\
0.0.0.0:2107|\
\[::\]:2107|\
0.0.0.0:5357|\
\[::\]:5357|\
0.0.0.0:49664|\
\[::\]:49664|\
0.0.0.0:49665|\
\[::\]:49665|\
0.0.0.0:49666|\
\[::\]:49666|\
0.0.0.0:49667|\
\[::\]:49667|\
0.0.0.0:49668|\
\[::\]:49668|\
0.0.0.0:49669|\
\[::\]:49669|\
0.0.0.0:49670|\
\[::\]:49670|\
0.0.0.0:49671|\
\[::\]:49671|\
0.0.0.0:5040" |\
/usr/bin/grep LISTEN
Hence I need to use the port at tomcat excluding following ports at localhost:
Code:
22
135
139
1801
2103
2105
2107
5040
5357
49664
49665
49666
49667
49668
49669
49670
49671

Last edited by murugesandins; 04-30-2024 at 08:34 AM. Reason: ports I should not use at localhost
 
Old 04-30-2024, 09:00 AM   #33
sag2662
Member
 
Registered: Sep 2022
Posts: 69

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by murugesandins View Post
Wait until I set all required settings at 127.0.0.1 to make my tomcat to listen to available port numbers.
Example ports I have found till now:
Code:
#0.0.0.0:22     sshd.exe
#0.0.0.0:135    svchost.exe
#0.0.0.0:1801   mqsvc.exe
I knew that following comment 10% not related to your query,
Code:
#!/bin/bash
IPv4=$(/cygdrive/c/WINDOWS/system32/ipconfig.exe 2>&1 | /usr/bin/tr -d "\r" | /usr/bin/awk '"IPv4" == $1 { print $NF}')
#0.0.0.0:22     %HOME%\..\..\usr\sbin\sshd.exe
#[::]:22        %HOME%\..\..\usr\sbin\sshd.exe
#0.0.0.0:49665  C:\WINDOWS\system32\wininit.exe
#[::]:49665     C:\WINDOWS\system32\wininit.exe
#0.0.0.0:49668  C:\WINDOWS\system32\spoolsv.exe
#[::]:49668     C:\WINDOWS\system32\spoolsv.exe
#0.0.0.0:49669  C:\WINDOWS\system32\svchost.exe
#[::]:49669     C:\WINDOWS\system32\svchost.exe
#0.0.0.0:49667  C:\WINDOWS\system32\svchost.exe
#[::]:49667     C:\WINDOWS\system32\svchost.exe
#0.0.0.0:49666  C:\WINDOWS\system32\svchost.exe
#[::]:49666     C:\WINDOWS\system32\svchost.exe
#0.0.0.0:5040   C:\WINDOWS\system32\svchost.exe
#0.0.0.0:135    C:\WINDOWS\system32\svchost.exe
#[::]:135       C:\WINDOWS\system32\svchost.exe
#0.0.0.0:49664  C:\WINDOWS\system32\lsass.exe
#[::]:49664     C:\WINDOWS\system32\lsass.exe
#0.0.0.0:49671  C:\WINDOWS\system32\services.exe
#[::]:49671     C:\WINDOWS\system32\services.exe
#0.0.0.0:49670  C:\WINDOWS\system32\mqsvc.exe
#[::]:49670     C:\WINDOWS\system32\mqsvc.exe
#0.0.0.0:1801   C:\WINDOWS\system32\mqsvc.exe
#[::]:1801      C:\WINDOWS\system32\mqsvc.exe
#0.0.0.0:2103   C:\WINDOWS\system32\mqsvc.exe
#[::2103]]      C:\WINDOWS\system32\mqsvc.exe
#0.0.0.0:2107   C:\WINDOWS\system32\mqsvc.exe
#[::]:2107      C:\WINDOWS\system32\mqsvc.exe
#0.0.0.0:2105   C:\WINDOWS\system32\mqsvc.exe
#[::]:2105      C:\WINDOWS\system32\mqsvc.exe
#0.0.0.0:5357   System
#[::]:5357      System
#$IPv4:139      System
/cygdrive/c/WINDOWS/system32/netstat.exe -nato 2>&1 |\
/usr/bin/grep -E -v "\
\[::\]:22|\
0.0.0.0:22|\
0.0.0.0:135|\
\[::\]:135|\
$IPv4:139|\
0.0.0.0:1801|\
\[::\]:1801|\
0.0.0.0:2103|\
\[::\]:2103|\
0.0.0.0:2105|\
\[::\]:2105|\
0.0.0.0:2107|\
\[::\]:2107|\
0.0.0.0:5357|\
\[::\]:5357|\
0.0.0.0:49664|\
\[::\]:49664|\
0.0.0.0:49665|\
\[::\]:49665|\
0.0.0.0:49666|\
\[::\]:49666|\
0.0.0.0:49667|\
\[::\]:49667|\
0.0.0.0:49668|\
\[::\]:49668|\
0.0.0.0:49669|\
\[::\]:49669|\
0.0.0.0:49670|\
\[::\]:49670|\
0.0.0.0:49671|\
\[::\]:49671|\
0.0.0.0:5040" |\
/usr/bin/grep LISTEN
Hence I need to use the port at tomcat excluding following ports at localhost:
Code:
22
135
139
1801
2103
2105
2107
5040
5357
49664
49665
49666
49667
49668
49669
49670
49671
FYI. I just forwaded the rules from 443 to 8443 and hence the url started working.
But I wonder if [url]https://server.com:8443/towll

Thanks for your support

Last edited by sag2662; 04-30-2024 at 01:40 PM.
 
Old 04-30-2024, 10:56 PM   #34
murugesandins
Member
 
Registered: Apr 2024
Location: Bangalore Karnataka India
Distribution: CYGWIN_NT
Posts: 61

Rep: Reputation: 0
Quote:
Originally Posted by sag2662 View Post
FYI. I just forwaded the rules from 443 to 8443 and hence the url started working.
Hence I wrote my automated script for using available ports at any OS.

Quote:
Originally Posted by sag2662 View Post
My comment to above comment you need to wait.

Reason for long term query:
I don't have Linux here.
Very difficult to reproduce your error at cygwin_nt
Example server.xml file which I have tested now:
a)
Following server.xml working fine only for:
http://127.0.0.1:7777
http://127.0.0.1:80
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="9090" shutdown="SHUTDOWN">
        <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
<servlet-mapping>
  <servlet-name>default</servlet-name>
  <url-pattern>/css/*</url-pattern>
</servlet-mapping>
    <Connector port="7777" protocol="HTTP/1.1"
                connectionTimeout="20000"
                redirectPort="9018" />
    <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="9018" />
    <Connector
                connectionTimeout="20000"
                acceptCount="100"
                scheme="https"
                secure="true"
                clientAuth="false"
                sslProtocol="TLS"
                port="9018"
                maxThreads="150"
                protocol="org.apache.coyote.http11.Http11NioProtocol"
                keystoreFile="/conf/localhost-rsa.jks"
                keystorePass="passwd"
                keyAlias="server"
                SSLEnabled="true">
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
                <Certificate certificateKeyFile="C:/Users/Murugesan/cygwin/home/Murugesan/apache-tomcat-11.0.0-M19/conf/privkey.pem"
                        certificateFile="C:/Users/Murugesan/cygwin/home/Murugesan/apache-tomcat-11.0.0-M19/conf/cert.pem"
                        certificateChainFile="C:/Users/Murugesan/cygwin/home/Murugesan/apache-tomcat-11.0.0-M19/conf/chain.pem"
                type="RSA" />
        </SSLHostConfig>
    </Connector>
    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  </Service>
</Server>
I will update you once I test other server.xml files (after my modifications)
 
Old 05-01-2024, 01:04 AM   #35
murugesandins
Member
 
Registered: Apr 2024
Location: Bangalore Karnataka India
Distribution: CYGWIN_NT
Posts: 61

Rep: Reputation: 0
Your old comment of using my server.xml:
Quote:
like you
>> without using copy and paste.

Quote:
Proxy tunneling failed: Gateway TimeoutUnable to establish SSL connection
a)
Not now, during 2023/2013/... while downloading using wget/wget.exe/firefox.exe (wget inside vmplayer at windows)
I used to disable proxy settings at windows I proxy (you can perform the same at your OS)
After completing the download I used to enable proxy.
I agree that disabling proxy used to disconnect putty/mstsc/... other connections which are dependent on proxy.
However this step never provided status error at microsoft teams/chat over the years from 2003 to till now.
b)
my wget at localhost:
wget -c --no-check-certificate URL
or
wget -c --no-check-certificate URL parameters
if the provider is allowing --no-check-certificate option to download.
One more way:
logon using firefox/browser using microsoft account
open about:downloads
Right click pause
Right click and click Copy Download link
Use that download link and wget to download using bash/vmplayer without:
1. closing the browser
2. clearing cookies.
3. logout from browser.
I have written microsoft account name here.
microsoft account => can be your user name where you have subscribed at related url (eg: external library providers at opensource).

==================
following server.xml is working fine for me when I am using:
http://127.0.0.1:7777
http://127.0.0.1:80
http://127.0.0.1:8444
http://127.0.0.1:8445
https://127.0.0.1:9018
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="9090" shutdown="SHUTDOWN">
        <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
<servlet-mapping>
  <servlet-name>default</servlet-name>
  <url-pattern>/css/*</url-pattern>
</servlet-mapping>
    <Connector port="7777" protocol="HTTP/1.1"
                connectionTimeout="20000"
                redirectPort="8443" />
    <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
        <!-- Define an HTTP/1.1 Connector on port 8444, JSSE NIO implementation -->
        <Connector port="8444" protocol="org.apache.coyote.http11.Http11NioProtocol"
           sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
           />
        <!-- Define an HTTP/1.1 Connector on port 8445, JSSE NIO2 implementation -->
        <Connector port="8445" protocol="org.apache.coyote.http11.Http11Nio2Protocol"
                sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
                />
        <!-- Define an SSL Coyote HTTP/1.1 Connector on port 8443 -->
        <Connector port="8443"
                protocol="org.apache.coyote.http11.Http11AprProtocol"
                maxThreads="200"
                maxParameterCount="1000"
                scheme="https"
                secure="true"
                SSLEnabled="true"
                SSLCertificateFile="conf/server.crt"
                SSLCertificateKeyFile="conf/cert.pem"
                SSLVerifyClient="optional"
                SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"/>
    <Connector port="9018"
                connectionTimeout="20000"
                acceptCount="100"
                scheme="https"
                secure="true"
                clientAuth="false"
                sslProtocol="TLS"
                maxThreads="150"
                protocol="org.apache.coyote.http11.Http11NioProtocol"
                keystoreFile="conf/localhost-rsa.jks"
                keystorePass="Openssl@123"
                keyAlias="server"
                SSLEnabled="true">
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
                <Certificate certificateKeyFile="conf/privkey.pem"
                        certificateFile="conf/cert.pem"
                        certificateChainFile="conf/chain.pem"
                type="RSA" />
        </SSLHostConfig>
    </Connector>
    <Engine name="Catalina" defaultHost="127.0.0.1">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="127.0.0.1"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  </Service>
</Server>
After this change I have modified environment variable at windows using:
C:\Windows\System32\rundll32.exe sysdm.cpl,EditEnvironmentVariables
%misint%
Reason for last comment:
You can set related environment variable inside automated script to open using firefox/browser at your OS to test your url
After this I tried modifying my server.xml file to:
Code:
$ cd webapps
$ mkdir murugesan_openssl
$ mv ROOT/*.html ROOT/*.css murugesan_openssl
$ ../conf/cleanstart.sh
$ cat ../conf/server.xml
<?xml version="1.0" encoding="UTF-8"?>
<Server port="9090" shutdown="SHUTDOWN">
        <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
<servlet-mapping>
  <servlet-name>default</servlet-name>
  <url-pattern>/css/*</url-pattern>
</servlet-mapping>
    <Connector port="7777" protocol="HTTP/1.1"
                connectionTimeout="20000"
                redirectPort="8443" />
    <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
        <!-- Define an HTTP/1.1 Connector on port 8444, JSSE NIO implementation -->
        <Connector port="8444" protocol="org.apache.coyote.http11.Http11NioProtocol"
           sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
           />
        <!-- Define an HTTP/1.1 Connector on port 8445, JSSE NIO2 implementation -->
        <Connector port="8445" protocol="org.apache.coyote.http11.Http11Nio2Protocol"
                sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
                />
        <!-- Define an SSL Coyote HTTP/1.1 Connector on port 8443 -->
        <Connector port="8443"
                protocol="org.apache.coyote.http11.Http11AprProtocol"
                maxThreads="200"
                maxParameterCount="1000"
                scheme="https"
                secure="true"
                SSLEnabled="true"
                SSLCertificateFile="conf/server.crt"
                SSLCertificateKeyFile="conf/cert.pem"
                SSLVerifyClient="optional"
                SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"/>
    <Connector port="9018"
                connectionTimeout="20000"
                acceptCount="100"
                scheme="https"
                secure="true"
                clientAuth="false"
                sslProtocol="TLS"
                maxThreads="150"
                protocol="org.apache.coyote.http11.Http11NioProtocol"
                keystoreFile="conf/localhost-rsa.jks"
                keystorePass="Openssl@123"
                keyAlias="server"
                SSLEnabled="true">
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
                <Certificate certificateKeyFile="conf/privkey.pem"
                        certificateFile="conf/cert.pem"
                        certificateChainFile="conf/chain.pem"
                type="RSA" />
        </SSLHostConfig>
    </Connector>
    <Engine name="Catalina" defaultHost="127.0.0.1">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="127.0.0.1"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  </Service>
</Server>
$
After related update and restart
https://127.0.0.1:9018
automatically redirecting to:
https://127.0.0.1:9018/murugesan_openssl/index.html
Code:
$ /usr/bin/ls -trd webapps/ROOT/index.jsp*
webapps/ROOT/index.jsp.Original  webapps/ROOT/index.jsp
$ cat webapps/ROOT/index.jsp
<%
        response.sendRedirect("/murugesan_openssl/index.html");
%>
================= Next change =======================
Sorry/puri for adding more comments.
puri => Dharmapuri => Dharma puri => provide dharmam using tamil => provide donation.
I have modified one more time at server.xml and webweb.xml files
Code:
$ cat server.xml
<?xml version="1.0" encoding="UTF-8"?>
<Server port="9090" shutdown="SHUTDOWN">
        <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
<servlet-mapping>
  <servlet-name>default</servlet-name>
  <url-pattern>/css/*</url-pattern>
</servlet-mapping>
        <!--
    <Connector port="7777" protocol="HTTP/1.1"
                connectionTimeout="20000"
                redirectPort="8443" />
    <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
        -->
        <!-- Define an HTTP/1.1 Connector on port 8444, JSSE NIO implementation -->
        <!--
        <Connector port="8444" protocol="org.apache.coyote.http11.Http11NioProtocol"
           sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
           />
        -->
        <!-- Define an HTTP/1.1 Connector on port 8445, JSSE NIO2 implementation -->
        <!--
        <Connector port="8445" protocol="org.apache.coyote.http11.Http11Nio2Protocol"
                sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
                />
        -->
        <!-- Define an SSL Coyote HTTP/1.1 Connector on port 8443 -->
        <Connector port="8443"
                protocol="org.apache.coyote.http11.Http11AprProtocol"
                maxThreads="200"
                maxParameterCount="1000"
                scheme="https"
                secure="true"
                SSLEnabled="true"
                SSLCertificateFile="conf/server.crt"
                SSLCertificateKeyFile="conf/cert.pem"
                SSLVerifyClient="optional"
                SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"/>
        <Connector port="80"
                scheme="https"
                URIEncoding="UTF-8"
                acceptCount="100"
                enableLookups="false"
                maxThreads="150"
                redirectPort="9018"
        />
    <Connector port="9018"
                connectionTimeout="20000"
                acceptCount="100"
                scheme="https"
                secure="true"
                clientAuth="false"
                sslProtocol="TLS"
                maxThreads="150"
                protocol="org.apache.coyote.http11.Http11NioProtocol"
                keystoreFile="conf/localhost-rsa.jks"
                keystorePass="Openssl@123"
                keyAlias="server"
                SSLEnabled="true">
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
                <Certificate certificateKeyFile="conf/privkey.pem"
                        certificateFile="conf/cert.pem"
                        certificateChainFile="conf/chain.pem"
                type="RSA" />
        </SSLHostConfig>
    </Connector>
    <Engine name="Catalina" defaultHost="127.0.0.1">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="127.0.0.1"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  </Service>
</Server>
Added lines above the last bottom line => above the line having </web-app>

Last edited by murugesandins; 05-01-2024 at 06:04 AM. Reason: Updated code and updated test cases.
 
Old 05-01-2024, 06:08 AM   #36
murugesandins
Member
 
Registered: Apr 2024
Location: Bangalore Karnataka India
Distribution: CYGWIN_NT
Posts: 61

Rep: Reputation: 0
text code allowed only 30000 characters and not like IDOC/EDI/XML files
Code:
$ # Last line updated at  web.xml
#...
</welcome-file-list>
<!-- murugesandins HAPPY INTERNATIONAL WORKERS DAY. Last Updated Wed 01-May-2024 04:10 PM IST
		Force HTTP to redirect to for HTTPS -->
	<security-constraint>
		<web-resource-collection>
			<web-resource-name>Protected Context</web-resource-name>
			<url-pattern>/*</url-pattern>
		</web-resource-collection>
	<!-- auth-constraint goes here if we need for authentication (SSL) -->
		<user-data-constraint>
			<transport-guarantee>CONFIDENTIAL</transport-guarantee>
		</user-data-constraint>
	</security-constraint>
<!-- murugesandins HAPPY INTERNATIONAL WORKERS DAY. Last Updated Wed 01-May-2024 04:10 PM IST -->
</web-app>
$ ./cleanstart.sh >/dev/null 2>&1
After this I have tested following url:
http://127.0.0.1:80 => Automatically redirecting to https://127.0.0.1:9018/murugesan_openssl/index.html
http://127.0.0.1:8080 => Automatically redirecting to https://127.0.0.1:9018/murugesan_openssl/index.html
https://127.0.0.1:9018/ => Automatically redirecting to https://127.0.0.1:9018/murugesan_openssl/index.html
You need to test your tomcat like my testing using updated server.xml /web.xml file changes and backup(ddmmmyyyyhhmmss format.tgz) each time.
My updated server.xml file after above test:
Code:
$ cat ./server.xml
<?xml version="1.0" encoding="UTF-8"?>
<Server port="9090" shutdown="SHUTDOWN">
        <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
<servlet-mapping>
  <servlet-name>default</servlet-name>
  <url-pattern>/css/*</url-pattern>
</servlet-mapping>
	<!--
    <Connector port="7777" protocol="HTTP/1.1"
                connectionTimeout="20000"
                redirectPort="8443" />
    <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
	-->
	<!-- Define an HTTP/1.1 Connector on port 8444, JSSE NIO implementation -->
	<!--
	<Connector port="8444" protocol="org.apache.coyote.http11.Http11NioProtocol"
	   sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
	   />
	-->
	<!-- Define an HTTP/1.1 Connector on port 8445, JSSE NIO2 implementation -->
	<!--
	<Connector port="8445" protocol="org.apache.coyote.http11.Http11Nio2Protocol"
		sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
		/>
	-->
	<!-- Define an SSL Coyote HTTP/1.1 Connector on port 8443 -->
	<Connector port="8443"
		protocol="org.apache.coyote.http11.Http11AprProtocol"
		maxThreads="200"
		maxParameterCount="1000"
		scheme="https"
		secure="true"
		SSLEnabled="true"
		SSLCertificateFile="conf/server.crt"
		SSLCertificateKeyFile="conf/cert.pem"
		SSLVerifyClient="optional"
		SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"/>
	<Connector port="80"
                scheme="https"
		URIEncoding="UTF-8"
		acceptCount="100"
		enableLookups="false"
		maxThreads="150"
		redirectPort="9018"
	/>
	<Connector URIEncoding="UTF-8" port="80" acceptCount="100" enableLookups="false" maxThreads="150" redirectPort="9018"/>
	<Connector URIEncoding="UTF-8" port="8080" acceptCount="100" enableLookups="false" maxThreads="150" redirectPort="9018"/>
	    <Connector port="9018"
                connectionTimeout="20000"
                acceptCount="100"
                scheme="https"
                secure="true"
                clientAuth="false"
                sslProtocol="TLS"
                maxThreads="150"
                protocol="org.apache.coyote.http11.Http11NioProtocol"
                keystoreFile="conf/localhost-rsa.jks"
                keystorePass="Openssl@123"
                keyAlias="server"
                SSLEnabled="true">
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
                <Certificate certificateKeyFile="conf/privkey.pem"
                        certificateFile="conf/cert.pem"
                        certificateChainFile="conf/chain.pem"
                type="RSA" />
        </SSLHostConfig>
    </Connector>
    <Engine name="Catalina" defaultHost="127.0.0.1">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>
      <Host name="127.0.0.1"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  </Service>
</Server>
 
Old Yesterday, 06:06 AM   #37
sag2662
Member
 
Registered: Sep 2022
Posts: 69

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by murugesandins View Post
Your old comment of using my server.xml:

>> without using copy and paste.


a)
Not now, during 2023/2013/... while downloading using wget/wget.exe/firefox.exe (wget inside vmplayer at windows)
I used to disable proxy settings at windows I proxy (you can perform the same at your OS)
After completing the download I used to enable proxy.
I agree that disabling proxy used to disconnect putty/mstsc/... other connections which are dependent on proxy.
However this step never provided status error at microsoft teams/chat over the years from 2003 to till now.
b)
my wget at localhost:
wget -c --no-check-certificate URL
or
wget -c --no-check-certificate URL parameters
if the provider is allowing --no-check-certificate option to download.
One more way:
logon using firefox/browser using microsoft account
open about:downloads
Right click pause
Right click and click Copy Download link
Use that download link and wget to download using bash/vmplayer without:
1. closing the browser
2. clearing cookies.
3. logout from browser.
I have written microsoft account name here.
microsoft account => can be your user name where you have subscribed at related url (eg: external library providers at opensource).

==================
following server.xml is working fine for me when I am using:
http://127.0.0.1:7777
http://127.0.0.1:80
http://127.0.0.1:8444
http://127.0.0.1:8445
https://127.0.0.1:9018
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="9090" shutdown="SHUTDOWN">
        <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
<servlet-mapping>
  <servlet-name>default</servlet-name>
  <url-pattern>/css/*</url-pattern>
</servlet-mapping>
    <Connector port="7777" protocol="HTTP/1.1"
                connectionTimeout="20000"
                redirectPort="8443" />
    <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
        <!-- Define an HTTP/1.1 Connector on port 8444, JSSE NIO implementation -->
        <Connector port="8444" protocol="org.apache.coyote.http11.Http11NioProtocol"
           sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
           />
        <!-- Define an HTTP/1.1 Connector on port 8445, JSSE NIO2 implementation -->
        <Connector port="8445" protocol="org.apache.coyote.http11.Http11Nio2Protocol"
                sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
                />
        <!-- Define an SSL Coyote HTTP/1.1 Connector on port 8443 -->
        <Connector port="8443"
                protocol="org.apache.coyote.http11.Http11AprProtocol"
                maxThreads="200"
                maxParameterCount="1000"
                scheme="https"
                secure="true"
                SSLEnabled="true"
                SSLCertificateFile="conf/server.crt"
                SSLCertificateKeyFile="conf/cert.pem"
                SSLVerifyClient="optional"
                SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"/>
    <Connector port="9018"
                connectionTimeout="20000"
                acceptCount="100"
                scheme="https"
                secure="true"
                clientAuth="false"
                sslProtocol="TLS"
                maxThreads="150"
                protocol="org.apache.coyote.http11.Http11NioProtocol"
                keystoreFile="conf/localhost-rsa.jks"
                keystorePass="Openssl@123"
                keyAlias="server"
                SSLEnabled="true">
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
                <Certificate certificateKeyFile="conf/privkey.pem"
                        certificateFile="conf/cert.pem"
                        certificateChainFile="conf/chain.pem"
                type="RSA" />
        </SSLHostConfig>
    </Connector>
    <Engine name="Catalina" defaultHost="127.0.0.1">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="127.0.0.1"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  </Service>
</Server>
After this change I have modified environment variable at windows using:
C:\Windows\System32\rundll32.exe sysdm.cpl,EditEnvironmentVariables
%misint%
Reason for last comment:
You can set related environment variable inside automated script to open using firefox/browser at your OS to test your url
After this I tried modifying my server.xml file to:
Code:
$ cd webapps
$ mkdir murugesan_openssl
$ mv ROOT/*.html ROOT/*.css murugesan_openssl
$ ../conf/cleanstart.sh
$ cat ../conf/server.xml
<?xml version="1.0" encoding="UTF-8"?>
<Server port="9090" shutdown="SHUTDOWN">
        <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
<servlet-mapping>
  <servlet-name>default</servlet-name>
  <url-pattern>/css/*</url-pattern>
</servlet-mapping>
    <Connector port="7777" protocol="HTTP/1.1"
                connectionTimeout="20000"
                redirectPort="8443" />
    <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
        <!-- Define an HTTP/1.1 Connector on port 8444, JSSE NIO implementation -->
        <Connector port="8444" protocol="org.apache.coyote.http11.Http11NioProtocol"
           sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
           />
        <!-- Define an HTTP/1.1 Connector on port 8445, JSSE NIO2 implementation -->
        <Connector port="8445" protocol="org.apache.coyote.http11.Http11Nio2Protocol"
                sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
                />
        <!-- Define an SSL Coyote HTTP/1.1 Connector on port 8443 -->
        <Connector port="8443"
                protocol="org.apache.coyote.http11.Http11AprProtocol"
                maxThreads="200"
                maxParameterCount="1000"
                scheme="https"
                secure="true"
                SSLEnabled="true"
                SSLCertificateFile="conf/server.crt"
                SSLCertificateKeyFile="conf/cert.pem"
                SSLVerifyClient="optional"
                SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"/>
    <Connector port="9018"
                connectionTimeout="20000"
                acceptCount="100"
                scheme="https"
                secure="true"
                clientAuth="false"
                sslProtocol="TLS"
                maxThreads="150"
                protocol="org.apache.coyote.http11.Http11NioProtocol"
                keystoreFile="conf/localhost-rsa.jks"
                keystorePass="Openssl@123"
                keyAlias="server"
                SSLEnabled="true">
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
                <Certificate certificateKeyFile="conf/privkey.pem"
                        certificateFile="conf/cert.pem"
                        certificateChainFile="conf/chain.pem"
                type="RSA" />
        </SSLHostConfig>
    </Connector>
    <Engine name="Catalina" defaultHost="127.0.0.1">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="127.0.0.1"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  </Service>
</Server>
$
After related update and restart
https://127.0.0.1:9018
automatically redirecting to:
https://127.0.0.1:9018/murugesan_openssl/index.html
Code:
$ /usr/bin/ls -trd webapps/ROOT/index.jsp*
webapps/ROOT/index.jsp.Original  webapps/ROOT/index.jsp
$ cat webapps/ROOT/index.jsp
<%
        response.sendRedirect("/murugesan_openssl/index.html");
%>
================= Next change =======================
Sorry/puri for adding more comments.
puri => Dharmapuri => Dharma puri => provide dharmam using tamil => provide donation.
I have modified one more time at server.xml and webweb.xml files
Code:
$ cat server.xml
<?xml version="1.0" encoding="UTF-8"?>
<Server port="9090" shutdown="SHUTDOWN">
        <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
<servlet-mapping>
  <servlet-name>default</servlet-name>
  <url-pattern>/css/*</url-pattern>
</servlet-mapping>
        <!--
    <Connector port="7777" protocol="HTTP/1.1"
                connectionTimeout="20000"
                redirectPort="8443" />
    <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
        -->
        <!-- Define an HTTP/1.1 Connector on port 8444, JSSE NIO implementation -->
        <!--
        <Connector port="8444" protocol="org.apache.coyote.http11.Http11NioProtocol"
           sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
           />
        -->
        <!-- Define an HTTP/1.1 Connector on port 8445, JSSE NIO2 implementation -->
        <!--
        <Connector port="8445" protocol="org.apache.coyote.http11.Http11Nio2Protocol"
                sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
                />
        -->
        <!-- Define an SSL Coyote HTTP/1.1 Connector on port 8443 -->
        <Connector port="8443"
                protocol="org.apache.coyote.http11.Http11AprProtocol"
                maxThreads="200"
                maxParameterCount="1000"
                scheme="https"
                secure="true"
                SSLEnabled="true"
                SSLCertificateFile="conf/server.crt"
                SSLCertificateKeyFile="conf/cert.pem"
                SSLVerifyClient="optional"
                SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"/>
        <Connector port="80"
                scheme="https"
                URIEncoding="UTF-8"
                acceptCount="100"
                enableLookups="false"
                maxThreads="150"
                redirectPort="9018"
        />
    <Connector port="9018"
                connectionTimeout="20000"
                acceptCount="100"
                scheme="https"
                secure="true"
                clientAuth="false"
                sslProtocol="TLS"
                maxThreads="150"
                protocol="org.apache.coyote.http11.Http11NioProtocol"
                keystoreFile="conf/localhost-rsa.jks"
                keystorePass="Openssl@123"
                keyAlias="server"
                SSLEnabled="true">
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
                <Certificate certificateKeyFile="conf/privkey.pem"
                        certificateFile="conf/cert.pem"
                        certificateChainFile="conf/chain.pem"
                type="RSA" />
        </SSLHostConfig>
    </Connector>
    <Engine name="Catalina" defaultHost="127.0.0.1">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="127.0.0.1"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  </Service>
</Server>
Added lines above the last bottom line => above the line having </web-app>

Hi I donot need any URLS to be redirected, I just wanted to disable one url with the aliasname and wanted to allow url the hostname

Code:
server.com --> hostname
example.com--> alias name

https://example.com/ --> should work
but https://example.com/towl --> should not work and to be restricted

Last edited by sag2662; Yesterday at 08:12 AM.
 
Old Yesterday, 08:06 AM   #38
murugesandins
Member
 
Registered: Apr 2024
Location: Bangalore Karnataka India
Distribution: CYGWIN_NT
Posts: 61

Rep: Reputation: 0
Quote:
I do not need any URLS to be redirected, I just wanted to disable one url with the aliasname and wanted to allow url the hostname
Actually I wrote index.jsp to have:
Code:
<%
        response.sendRedirect("/murugesan_openssl/index.html");
%>
Hence opening https://127.0.0.1:9018/
making my default home page to:
https://127.0.0.1:9018/murugesan_openssl/index.html
Like the same you can have index.jsp at similar format for you to open https://example.com/towl when opening https://example.com/
Due to your comment I made changes to:
Code:
$ cp index.jsp index.jsp.autoredirect
$ cp index.jsp.Original index.jsp
/usr/bin/cp -i index.jsp.Original index.jsp
/usr/bin/cp: overwrite 'index.jsp'? y
Hence https://127.0.0.1:9018/ is opening default tomcat index page.
Also if I open
https://127.0.0.1:9018/murugesan_openssl/index.html
it is working fine since I am having following folder:
~/apache-tomcat-11.0.0-M19/webapps/murugesan_openssl/index.html
you need to have towl inside webapps directory.
if not required gzip towl and move that to backup folder.
if you want restricted after moving towl
create new webapps/towl directory and create index.html having access denied /not available content inside that index.html
OR
towl having index.jsp having the content to redirect to ../index.jsp or other required files

Last edited by murugesandins; Yesterday at 08:09 AM. Reason: quote tags update
 
Old Yesterday, 08:12 AM   #39
sag2662
Member
 
Registered: Sep 2022
Posts: 69

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by murugesandins View Post
Actually I wrote index.jsp to have:
Code:
<%
        response.sendRedirect("/murugesan_openssl/index.html");
%>
Hence opening https://127.0.0.1:9018/
making my default home page to:
https://127.0.0.1:9018/murugesan_openssl/index.html
Like the same you can have index.jsp at similar format for you to open https://example.com/towl when opening https://example.com/
Due to your comment I made changes to:
Code:
$ cp index.jsp index.jsp.autoredirect
$ cp index.jsp.Original index.jsp
/usr/bin/cp -i index.jsp.Original index.jsp
/usr/bin/cp: overwrite 'index.jsp'? y
Hence https://127.0.0.1:9018/ is opening default tomcat index page.
Also if I open
https://127.0.0.1:9018/murugesan_openssl/index.html
it is working fine since I am having following folder:
~/apache-tomcat-11.0.0-M19/webapps/murugesan_openssl/index.html
you need to have towl inside webapps directory.
if not required gzip towl and move that to backup folder.
if you want restricted after moving towl
create new webapps/towl directory and create index.html having access denied /not available content inside that index.html
OR
towl having index.jsp having the content to redirect to ../index.jsp or other required files
I need otherwise around. I wanted https://example.com --> to be working. it is working
I wanted to disable https://example.com/towl --> disable this one
 
Old Yesterday, 10:45 PM   #40
murugesandins
Member
 
Registered: Apr 2024
Location: Bangalore Karnataka India
Distribution: CYGWIN_NT
Posts: 61

Rep: Reputation: 0
Quote:
I wanted to disable https://example.com/towl --> disable this one
Validate if your webapps directory having twol (like the way I am having murugesan_openssl directory inside webapps).
I need to know output of following command at conf directory:
Code:
grep -i towl  server.xml web.xml *.xml 2>/dev/null
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to set up Apache webserver proxy in front of Apache Tomcat on Red Hat Linux LXer Syndicated Linux News 0 10-01-2018 01:32 PM
apache webserver and tomcat fachhoch@gmail.com Linux - Newbie 1 05-11-2012 09:40 PM
Session replication using apache+mod_jk+tomcat(5.5.28-veriosn of tomcat) sreejithp Linux - Server 1 12-24-2010 06:46 AM
apache-tomcat and jakarta-tomcat shifter Programming 1 07-28-2007 10:36 PM
Why use Apache with Tomcat rather than just Tomcat itself? davee Linux - Software 1 08-21-2003 09:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration