You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sandip Gaikwad <sa...@gmail.com> on 2015/01/01 06:19:54 UTC

Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Hi,

Could you please let me know how to block direct access to tomcat and allow
access through apache http server only?

I used http://
http://www.slideshare.net/mohanraj_nagasamy/integrating-tomcat-and-apache-on-windows-presentation
for
reference.

What indicates that each request is coming from apache httpd only?

Example:
i have added following code in httpd.conf
# Send everything for context /example1 to worker named worker1 (ajp13)
JkMount /example1/* worker1

in tomcat i have two apps example1 and example2

I am expecting to access only http://localhost/example1 . But i can access
http://localhost/example2 as well.

How can i stop http://localhost/example2 from being accessed?


Thanks,
Sandip

Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Sandip Gaikwad <sa...@gmail.com>.
Hi Andre,

Did you look at what is in the mod_jk.log file ?
Yes. Following is mod_jk log:
[Thu Jan 08 09:18:24 2015] [4800:4424] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 09:18:25 2015] [4800:4424] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 09:18:25 2015] [1316:4200] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 09:18:26 2015] [1316:4200] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 09:30:40 2015] [4612:5748] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 09:30:40 2015] [4612:5748] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 09:30:41 2015] [5596:4580] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 09:30:41 2015] [5596:4580] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 13:41:50 2015] [1456:1460] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 13:41:51 2015] [1456:1460] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 13:41:51 2015] [1832:1836] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 13:41:52 2015] [1832:1836] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 15:53:41 2015] [1456:1460] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 15:53:41 2015] [1456:1460] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 15:53:42 2015] [1808:1812] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Thu Jan 08 15:53:42 2015] [1808:1812] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized
[Fri Jan 09 17:35:37 2015] [1424:1428] [info] init_jk::mod_jk.c (3383):
mod_jk/1.2.40 initialized


Are you sure that the call "http://localhost/jenkins/" really gets proxied
to Tomcat ?
No. I don't see anything in mod_jk log.

If you do not see anything in the mod_jk.log file when you request "
http://localhost/jenkins/", then it is probably not happening, and then
also, the error page which you get in the browser is coming from the
front-end Apache httpd, not from Tomcat (these error pages have a quite
distinctive style between httpd and Tomcat, so you should be able to tell -
with a browser other than IE).
Right. What is going wrong?

Please refer attached files.


On Thu, Jan 8, 2015 at 2:15 PM, André Warnier <aw...@ice-sa.com> wrote:

> Sandip Gaikwad wrote:
>
>> Hi Terence,
>>
>>  [ snip ]
>
>>
>>
>> When i access http://localhost/jenkins/ i am getting following error:
>> Not Found
>>
>> The requested URL http://jenkins/ was not found on this server.
>>
>>  ...
>
>
>>>> *httpd.conf*
>>>> LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
>>>> JkWorkersFile "C:/tomcat-connectors-1.2.40-src/conf/workers.properties"
>>>> JkLogFile "C:/Apache24/logs/mod_jk.log"
>>>> JkLogLevel info
>>>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>>> JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
>>>> JkRequestLogFormat "%w %V %T"
>>>> JkMount /jenkins/* worker1
>>>>
>>>
> Did you look at what is in the mod_jk.log file ?
>
> Are you sure that the call "http://localhost/jenkins/" really gets
> proxied to Tomcat ?
>
> If you do not see anything in the mod_jk.log file when you request "
> http://localhost/jenkins/", then it is probably not happening, and then
> also, the error page which you get in the browser is coming from the
> front-end Apache httpd, not from Tomcat (these error pages have a quite
> distinctive style between httpd and Tomcat, so you should be able to tell -
> with a browser other than IE).
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Sandip Gaikwad
9987626799

Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Sandip Gaikwad <sa...@gmail.com>.
Thanks Rainer for your help on this. I will go through apache web server
documentation and get back to you if I need any help.
On 10 Jan 2015 23:08, "Rainer Jung" <ra...@kippdata.de> wrote:

> Hi Sandip,
>
> Am 10.01.2015 um 12:56 schrieb Sandip Gaikwad:
>
>> Hi Andre/Rainer,
>>
>> Please find below httpd.conf file's content:
>>
>
> I think you need to get used to the Apache web server configuration
> basics. For instance learn what the lines
>
> Include conf/extra/httpd-vhosts.conf
>
> and
>
> Include conf/extra/httpd-sni.conf
>
> in your config actually do. Then get back to my original mail about
> JkMountCopy and look for existing <VirtualHost...> blocks in any config
> file which is part of your complete Apache web server configuration.
>
> Regards,
>
> Rainer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Sandip,

Am 10.01.2015 um 12:56 schrieb Sandip Gaikwad:
> Hi Andre/Rainer,
>
> Please find below httpd.conf file's content:

I think you need to get used to the Apache web server configuration 
basics. For instance learn what the lines

Include conf/extra/httpd-vhosts.conf

and

Include conf/extra/httpd-sni.conf

in your config actually do. Then get back to my original mail about 
JkMountCopy and look for existing <VirtualHost...> blocks in any config 
file which is part of your complete Apache web server configuration.

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Sandip Gaikwad <sa...@gmail.com>.
Hi Andre/Rainer,

Please find below httpd.conf file's content:
#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
# server as "/usr/local/apache2/logs/access_log", whereas
"/logs/access_log"
# will be interpreted as '/logs/access_log'.
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which httpd.exe is located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths to avoid confusion.

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used.  If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#

Define SRVROOT "/Apache24"
ServerRoot "${SRVROOT}"

#
# Mutex: Allows you to set the mutex mechanism and mutex file directory
# for individual mutexes, or change the global defaults
#
# Uncomment and change the directory if mutexes are file-based and the
default
# mutex file directory is not on a local disk or is not appropriate for some
# other reason.
#
# Mutex default:logs

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO
you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
#LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule auth_form_module modules/mod_auth_form.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_core_module modules/mod_authn_core.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authn_socache_module modules/mod_authn_socache.so
#LoadModule authnz_fcgi_module modules/mod_authnz_fcgi.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule authz_core_module modules/mod_authz_core.so
#LoadModule authz_dbd_module modules/mod_authz_dbd.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule buffer_module modules/mod_buffer.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule cache_disk_module modules/mod_cache_disk.so
#LoadModule cache_socache_module modules/mod_cache_socache.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
#LoadModule data_module modules/mod_data.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule dav_lock_module modules/mod_dav_lock.so
#LoadModule dbd_module modules/mod_dbd.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule dumpio_module modules/mod_dumpio.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule filter_module modules/mod_filter.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule heartbeat_module modules/mod_heartbeat.so
#LoadModule heartmonitor_module modules/mod_heartmonitor.so
#LoadModule ident_module modules/mod_ident.so
#LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
#LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
#LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
#LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
#LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
#LoadModule ldap_module modules/mod_ldap.so
#LoadModule logio_module modules/mod_logio.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_debug_module modules/mod_log_debug.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule lua_module modules/mod_lua.so
#LoadModule macro_module modules/mod_macro.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_express_module modules/mod_proxy_express.so
#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_html_module modules/mod_proxy_html.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
#LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
#LoadModule ratelimit_module modules/mod_ratelimit.so
#LoadModule reflector_module modules/mod_reflector.so
#LoadModule remoteip_module modules/mod_remoteip.so
#LoadModule request_module modules/mod_request.so
#LoadModule reqtimeout_module modules/mod_reqtimeout.so
#LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule sed_module modules/mod_sed.so
#LoadModule session_module modules/mod_session.so
#LoadModule session_cookie_module modules/mod_session_cookie.so
#LoadModule session_crypto_module modules/mod_session_crypto.so
#LoadModule session_dbd_module modules/mod_session_dbd.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
#LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
#LoadModule socache_dbm_module modules/mod_socache_dbm.so
#LoadModule socache_memcache_module modules/mod_socache_memcache.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
#LoadModule speling_module modules/mod_speling.so
LoadModule ssl_module modules/mod_ssl.so
#LoadModule status_module modules/mod_status.so
#LoadModule substitute_module modules/mod_substitute.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule version_module modules/mod_version.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule watchdog_module modules/mod_watchdog.so
#LoadModule xml2enc_module modules/mod_xml2enc.so

<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User daemon
Group daemon

</IfModule>

# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g. admin@your-domain.com
#
ServerAdmin admin@example.com

#
# ServerName gives the name and port that the server uses to identify
itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address
here.
#
ServerName localhost:80

#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
    AllowOverride none
    Require all denied
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI
MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess
files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ".ht*">
    Require all denied
</Files>

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog "logs/error.log"

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here.  Contrariwise, if you *do*
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and *not* in this file.
    #
    CustomLog "logs/access.log" common

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    #CustomLog "logs/access.log" combined
</IfModule>

<IfModule alias_module>
    #
    # Redirect: Allows you to tell clients about documents that used to
    # exist in your server's namespace, but do not anymore. The client
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://www.example.com/bar

    #
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.

    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client.  The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ "${SRVROOT}/cgi-bin/"

</IfModule>

<IfModule cgid_module>
    #
    # ScriptSock: On threaded servers, designate the path to the UNIX
    # socket used to communicate with the CGI daemon of mod_cgid.
    #
    #Scriptsock logs/cgisock
</IfModule>

#
# "${SRVROOT}/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "${SRVROOT}/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig conf/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the
server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    #AddHandler cgi-script .cgi

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
</IfModule>

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type.  The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
#MIMEMagicFile conf/magic

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# MaxRanges: Maximum number of Ranges in a request before
# returning the entire resource, or one of the special
# values 'default', 'none' or 'unlimited'.
# Default setting is to accept 200 Ranges.
#MaxRanges unlimited

#
# EnableMMAP and EnableSendfile: On systems that support it,
# memory-mapping or the sendfile syscall may be used to deliver
# files.  This usually improves server performance, but must
# be turned off when serving from networked-mounted
# filesystems or if support for these functions is otherwise
# broken on your system.
# Defaults: EnableMMAP On, EnableSendfile Off
#
#EnableMMAP off
#EnableSendfile on

#AcceptFilter http none
#AcceptFilter https none

# Supplemental configuration
#
# The configuration files in the conf/extra/ directory can be
# included to add extra features or to modify the default configuration of
# the server, or you may simply copy their contents here and change as
# necessary.

# Server-pool management (MPM specific)
#Include conf/extra/httpd-mpm.conf

# Multi-language error messages
#Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
#Include conf/extra/httpd-autoindex.conf

# Language settings
#Include conf/extra/httpd-languages.conf

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
#Include conf/extra/httpd-info.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
#Include conf/extra/httpd-dav.conf

# Various default settings
#Include conf/extra/httpd-default.conf

# Configure mod_proxy_html to understand HTML4/XHTML1
<IfModule proxy_html_module>
Include conf/extra/proxy-html.conf
</IfModule>

# Secure (SSL/TLS) connections
# Note: The following must must be present to support
#       starting without SSL on platforms with no /dev/random equivalent
#       but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
#Include conf/extra/httpd-ssl.conf
Include conf/extra/httpd-sni.conf
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>


# Load mod_jk module
# Update this path to match your modules location
LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
# Declare the module for <IfModule directive>
#AddModule "C:/tomcat-connectors-1.2.40-src/native/apache-2.0/mod_jk.c"
# Where to find workers.properties
# Update this path to match your conf directory location (put
workers.properties next to httpd.conf)
JkWorkersFile "C:/tomcat-connectors-1.2.40-src/conf/workers.properties"
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log
next to access_log)
JkLogFile "C:/Apache24/logs/mod_jk.log"
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Send everything for context /jenkins to worker named worker1 (ajp13)
JkMount /jenkins/* worker1


Thanks,
Sandip

On Sat, Jan 10, 2015 at 1:07 PM, André Warnier <aw...@ice-sa.com> wrote:

> Sandip Gaikwad wrote:
>
>> Hi Rainer,
>>
>> In addition to the comments form André: JkMount is by default only active
>> in the vhost in which you configure it. If your Apache config contains
>> some
>> <VirtualHost> which matches your request but doesn't contain the JkMount
>> in
>> its ocnfig, then the rule will not trigger.
>>
>> You can add
>>
>> JkMountCopy All
>>
>> in the above mod_jk config block, which will active the JkMounts in any
>> VirtualHost. If it is working then, you should remove JkMountCopy again,
>> find the correct VirtualHost and move the JkMount from the global config
>> to
>> the VirtualHost.
>>
>> No. I have not configured Virtual Host. Please refer attached file.
>>
>
> Rainer was referring to Virtual Hosts in Apache httpd, not in Tomcat.
>
>
>
>> On Thu, Jan 8, 2015 at 6:31 PM, Rainer Jung <ra...@kippdata.de>
>> wrote:
>>
>>  Am 08.01.2015 um 09:45 schrieb André Warnier:
>>>
>>>  Sandip Gaikwad wrote:
>>>
>>>> Hi Terence,
>>>>>
>>>>>  [ snip ]
>>>>>
>>>>> When i access http://localhost/jenkins/ i am getting following error:
>>>>> Not Found
>>>>>
>>>>> The requested URL http://jenkins/ was not found on this server.
>>>>>
>>>>>  ...
>>>>>
>>>>
>>>>  *httpd.conf*
>>>>>>> LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
>>>>>>> JkWorkersFile "C:/tomcat-connectors-1.2.40-
>>>>>>> src/conf/workers.properties"
>>>>>>> JkLogFile "C:/Apache24/logs/mod_jk.log"
>>>>>>> JkLogLevel info
>>>>>>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>>>>>> JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
>>>>>>> JkRequestLogFormat "%w %V %T"
>>>>>>> JkMount /jenkins/* worker1
>>>>>>>
>>>>>>>  Did you look at what is in the mod_jk.log file ?
>>>>
>>>> Are you sure that the call "http://localhost/jenkins/" really gets
>>>> proxied to Tomcat ?
>>>>
>>>> If you do not see anything in the mod_jk.log file when you request
>>>> "http://localhost/jenkins/", then it is probably not happening, and
>>>> then
>>>> also, the error page which you get in the browser is coming from the
>>>> front-end Apache httpd, not from Tomcat (these error pages have a quite
>>>> distinctive style between httpd and Tomcat, so you should be able to
>>>> tell - with a browser other than IE).
>>>>
>>>>  In addition to the comments form André: JkMount is by default only
>>> active
>>> in the vhost in which you configure it. If your Apache config contains
>>> some
>>> <VirtualHost> which matches your request but doesn't contain the JkMount
>>> in
>>> its ocnfig, then the rule will not trigger.
>>>
>>> You can add
>>>
>>> JkMountCopy All
>>>
>>> in the above mod_jk config block, which will active the JkMounts in any
>>> VirtualHost. If it is working then, you should remove JkMountCopy again,
>>> find the correct VirtualHost and move the JkMount from the global config
>>> to
>>> the VirtualHost.
>>>
>>> Regards,
>>>
>>> Rainer
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Sandip Gaikwad
9987626799

Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by André Warnier <aw...@ice-sa.com>.
Sandip Gaikwad wrote:
> Hi Rainer,
> 
> In addition to the comments form André: JkMount is by default only active
> in the vhost in which you configure it. If your Apache config contains some
> <VirtualHost> which matches your request but doesn't contain the JkMount in
> its ocnfig, then the rule will not trigger.
> 
> You can add
> 
> JkMountCopy All
> 
> in the above mod_jk config block, which will active the JkMounts in any
> VirtualHost. If it is working then, you should remove JkMountCopy again,
> find the correct VirtualHost and move the JkMount from the global config to
> the VirtualHost.
> 
> No. I have not configured Virtual Host. Please refer attached file.

Rainer was referring to Virtual Hosts in Apache httpd, not in Tomcat.


> 
> On Thu, Jan 8, 2015 at 6:31 PM, Rainer Jung <ra...@kippdata.de> wrote:
> 
>> Am 08.01.2015 um 09:45 schrieb André Warnier:
>>
>>  Sandip Gaikwad wrote:
>>>> Hi Terence,
>>>>
>>>>  [ snip ]
>>>>
>>>> When i access http://localhost/jenkins/ i am getting following error:
>>>> Not Found
>>>>
>>>> The requested URL http://jenkins/ was not found on this server.
>>>>
>>>>  ...
>>>
>>>>>> *httpd.conf*
>>>>>> LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
>>>>>> JkWorkersFile "C:/tomcat-connectors-1.2.40-
>>>>>> src/conf/workers.properties"
>>>>>> JkLogFile "C:/Apache24/logs/mod_jk.log"
>>>>>> JkLogLevel info
>>>>>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>>>>> JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
>>>>>> JkRequestLogFormat "%w %V %T"
>>>>>> JkMount /jenkins/* worker1
>>>>>>
>>> Did you look at what is in the mod_jk.log file ?
>>>
>>> Are you sure that the call "http://localhost/jenkins/" really gets
>>> proxied to Tomcat ?
>>>
>>> If you do not see anything in the mod_jk.log file when you request
>>> "http://localhost/jenkins/", then it is probably not happening, and then
>>> also, the error page which you get in the browser is coming from the
>>> front-end Apache httpd, not from Tomcat (these error pages have a quite
>>> distinctive style between httpd and Tomcat, so you should be able to
>>> tell - with a browser other than IE).
>>>
>> In addition to the comments form André: JkMount is by default only active
>> in the vhost in which you configure it. If your Apache config contains some
>> <VirtualHost> which matches your request but doesn't contain the JkMount in
>> its ocnfig, then the rule will not trigger.
>>
>> You can add
>>
>> JkMountCopy All
>>
>> in the above mod_jk config block, which will active the JkMounts in any
>> VirtualHost. If it is working then, you should remove JkMountCopy again,
>> find the correct VirtualHost and move the JkMount from the global config to
>> the VirtualHost.
>>
>> Regards,
>>
>> Rainer
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Sandip Gaikwad <sa...@gmail.com>.
Hi Rainer,

In addition to the comments form André: JkMount is by default only active
in the vhost in which you configure it. If your Apache config contains some
<VirtualHost> which matches your request but doesn't contain the JkMount in
its ocnfig, then the rule will not trigger.

You can add

JkMountCopy All

in the above mod_jk config block, which will active the JkMounts in any
VirtualHost. If it is working then, you should remove JkMountCopy again,
find the correct VirtualHost and move the JkMount from the global config to
the VirtualHost.

No. I have not configured Virtual Host. Please refer attached file.

On Thu, Jan 8, 2015 at 6:31 PM, Rainer Jung <ra...@kippdata.de> wrote:

> Am 08.01.2015 um 09:45 schrieb André Warnier:
>
>  Sandip Gaikwad wrote:
>>
>>> Hi Terence,
>>>
>>>  [ snip ]
>>
>>>
>>>
>>> When i access http://localhost/jenkins/ i am getting following error:
>>> Not Found
>>>
>>> The requested URL http://jenkins/ was not found on this server.
>>>
>>>  ...
>>
>>
>>>>> *httpd.conf*
>>>>> LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
>>>>> JkWorkersFile "C:/tomcat-connectors-1.2.40-
>>>>> src/conf/workers.properties"
>>>>> JkLogFile "C:/Apache24/logs/mod_jk.log"
>>>>> JkLogLevel info
>>>>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>>>> JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
>>>>> JkRequestLogFormat "%w %V %T"
>>>>> JkMount /jenkins/* worker1
>>>>>
>>>>
>> Did you look at what is in the mod_jk.log file ?
>>
>> Are you sure that the call "http://localhost/jenkins/" really gets
>> proxied to Tomcat ?
>>
>> If you do not see anything in the mod_jk.log file when you request
>> "http://localhost/jenkins/", then it is probably not happening, and then
>> also, the error page which you get in the browser is coming from the
>> front-end Apache httpd, not from Tomcat (these error pages have a quite
>> distinctive style between httpd and Tomcat, so you should be able to
>> tell - with a browser other than IE).
>>
>
> In addition to the comments form André: JkMount is by default only active
> in the vhost in which you configure it. If your Apache config contains some
> <VirtualHost> which matches your request but doesn't contain the JkMount in
> its ocnfig, then the rule will not trigger.
>
> You can add
>
> JkMountCopy All
>
> in the above mod_jk config block, which will active the JkMounts in any
> VirtualHost. If it is working then, you should remove JkMountCopy again,
> find the correct VirtualHost and move the JkMount from the global config to
> the VirtualHost.
>
> Regards,
>
> Rainer
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Sandip Gaikwad
9987626799

Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Rainer Jung <ra...@kippdata.de>.
Am 08.01.2015 um 09:45 schrieb André Warnier:
> Sandip Gaikwad wrote:
>> Hi Terence,
>>
> [ snip ]
>>
>>
>> When i access http://localhost/jenkins/ i am getting following error:
>> Not Found
>>
>> The requested URL http://jenkins/ was not found on this server.
>>
> ...
>
>>>>
>>>> *httpd.conf*
>>>> LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
>>>> JkWorkersFile "C:/tomcat-connectors-1.2.40-src/conf/workers.properties"
>>>> JkLogFile "C:/Apache24/logs/mod_jk.log"
>>>> JkLogLevel info
>>>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>>> JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
>>>> JkRequestLogFormat "%w %V %T"
>>>> JkMount /jenkins/* worker1
>
> Did you look at what is in the mod_jk.log file ?
>
> Are you sure that the call "http://localhost/jenkins/" really gets
> proxied to Tomcat ?
>
> If you do not see anything in the mod_jk.log file when you request
> "http://localhost/jenkins/", then it is probably not happening, and then
> also, the error page which you get in the browser is coming from the
> front-end Apache httpd, not from Tomcat (these error pages have a quite
> distinctive style between httpd and Tomcat, so you should be able to
> tell - with a browser other than IE).

In addition to the comments form André: JkMount is by default only 
active in the vhost in which you configure it. If your Apache config 
contains some <VirtualHost> which matches your request but doesn't 
contain the JkMount in its ocnfig, then the rule will not trigger.

You can add

JkMountCopy All

in the above mod_jk config block, which will active the JkMounts in any 
VirtualHost. If it is working then, you should remove JkMountCopy again, 
find the correct VirtualHost and move the JkMount from the global config 
to the VirtualHost.

Regards,

Rainer


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by André Warnier <aw...@ice-sa.com>.
Sandip Gaikwad wrote:
> Hi Terence,
> 
[ snip ]
> 
> 
> When i access http://localhost/jenkins/ i am getting following error:
> Not Found
> 
> The requested URL http://jenkins/ was not found on this server.
> 
...

>>>
>>> *httpd.conf*
>>> LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
>>> JkWorkersFile "C:/tomcat-connectors-1.2.40-src/conf/workers.properties"
>>> JkLogFile "C:/Apache24/logs/mod_jk.log"
>>> JkLogLevel info
>>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>> JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
>>> JkRequestLogFormat "%w %V %T"
>>> JkMount /jenkins/* worker1

Did you look at what is in the mod_jk.log file ?

Are you sure that the call "http://localhost/jenkins/" really gets proxied to Tomcat ?

If you do not see anything in the mod_jk.log file when you request 
"http://localhost/jenkins/", then it is probably not happening, and then also, the error 
page which you get in the browser is coming from the front-end Apache httpd, not from 
Tomcat (these error pages have a quite distinctive style between httpd and Tomcat, so you 
should be able to tell - with a browser other than IE).



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Sandip Gaikwad <sa...@gmail.com>.
Hi Terence,


I removed following line



*<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"               redirectPort="8443" /> *
Replaced *<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>*
with *<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"
address="127.0.0.1"/>* .

I have removed example2 from tomcat's webapps.

Please refer attached files.

When i access http://localhost/jenkins/ i am getting following error:
Not Found

The requested URL http://jenkins/ was not found on this server.


Thanks,

On Sat, Jan 3, 2015 at 9:15 AM, Terence M. Bandoian <te...@tmbsw.com>
wrote:

> On 1/1/2015 9:20 AM, Sandip Gaikwad wrote:
>
>> Hi,
>>
>> Following are entries in files. Please let me know what is going wrong.
>>
>> *workers.properties*
>> worker.list=worker1
>> # Set properties for worker1 (ajp13)
>> worker.worker1.type=ajp13
>> worker.worker1.host=localhost
>> worker.worker1.port=8009
>> worker.worker1.connection_pool_size=10
>> worker.worker1.connection_pool_timeout=600
>> worker.worker1.socket_keepalive=true
>> worker.worker1.socket_timeout=300
>>
>>
>> *httpd.conf*
>> LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
>> JkWorkersFile "C:/tomcat-connectors-1.2.40-src/conf/workers.properties"
>> JkLogFile "C:/Apache24/logs/mod_jk.log"
>> JkLogLevel info
>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>> JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
>> JkRequestLogFormat "%w %V %T"
>> JkMount /jenkins/* worker1
>>
>> *server.xml*
>> <?xml version='1.0' encoding='utf-8'?>
>> <Server port="8005" shutdown="SHUTDOWN">
>>   <Listener className="org.apache.jk.config.ApacheConfig"
>> modJk="C:/Apache24/modules/mod_jk.so"/>
>>   <Listener className="org.apache.catalina.startup.VersionLoggerListener"
>> />
>>   <Listener className="org.apache.catalina.core.AprLifecycleListener"
>> SSLEngine="on" />
>>   <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">
>>
>>     <Connector port="8080" protocol="HTTP/1.1"
>>                connectionTimeout="20000"
>>                redirectPort="8443" />
>>
>
>
> If you don't want to allow direct access to Tomcat, the Connector above
> should be removed.
>
>
>      <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
>>
>
>
> The address attribute should probably be set on the Connector above.
> Setting it 127.0.0.1 (address="127.0.0.1") will limit access to the local
> host.
>
> -Terence Bandoian
>
>
>      <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">
>>         <Listener className="org.apache.jk.config.ApacheConfig"
>> modJk="C:/Apache24/modules/mod_jk.so"/>
>>         <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>
>>
>> Thanks,
>> Sandip
>>
>>
>> On Thu, Jan 1, 2015 at 7:45 PM, Christopher Schultz <
>> chris@christopherschultz.net <ma...@christopherschultz.net>>
>> wrote:
>>
>>     -----BEGIN PGP SIGNED MESSAGE-----
>>     Hash: SHA256
>>
>>     Sandip,
>>
>>     On 1/1/15 12:19 AM, Sandip Gaikwad wrote:
>>     > Could you please let me know how to block direct access to tomcat
>>     > and allow access through apache http server only?
>>     >
>>     > I used http://
>>     >
>>     http://www.slideshare.net/mohanraj_nagasamy/integrating-
>> tomcat-and-apache-on-windows-presentation
>>     >
>>     >
>>     for reference.
>>
>>     tl;dr
>>
>>     > What indicates that each request is coming from apache httpd only?
>>
>>     Nothing, really. There are ways to determine this, but you are better
>>     off solving the root problem.
>>
>>     > Example: i have added following code in httpd.conf # Send
>>     > everything for context /example1 to worker named worker1 (ajp13)
>>     > JkMount /example1/* worker1
>>     >
>>     > in tomcat i have two apps example1 and example2
>>     >
>>     > I am expecting to access only http://localhost/example1 . But i can
>>     > access http://localhost/example2 as well.
>>     >
>>     > How can i stop http://localhost/example2 from being accessed?
>>
>>     Only one process can bind to a single interface+port, so you need to
>>     figure out whether Tomcat or httpd is using port 80.
>>
>>     If httpd is bound to port 80, then the only reasons why a request to
>>     /example2 would hit your application are:
>>
>>        a) You have a JkMount somewhere for that
>>        b) You have made your DocumentRoot = appbase
>>
>>     The first is easy to fix: just remove that JkMount.
>>     The second is a horrible security problem that you'll need to fix
>>     immediately.
>>
>>     - -chris
>>     -----BEGIN PGP SIGNATURE-----
>>     Version: GnuPG v1
>>     Comment: GPGTools - http://gpgtools.org
>>
>>     iQIcBAEBCAAGBQJUpVaXAAoJEBzwKT+lPKRYY5AQAJ6+2NAhVtCWl1KMSQj2FGr8
>>     TMh/cpFAUiFY8NYbxLhPLZnELf/PhoCZlBAHnUJN7j+ozr5YbjbBW7sVJ9kI3yu8
>>     W1lB5zlxZKuVGBp3+GZsMdQcMDr/tg4Jkr8/TFKqUZOo5RPeTVoXxy+azdCNyMuy
>>     BdogSIpqpxc1k6r1lQOGljiKzXiZJDdpkJwDau1mnzY8eO54pxZWHIJI63c4gu5y
>>     akinaEncJDzI5dFwAQWiL/C+CtO8ujiUePH+FfpwfzoQozqIa+hpCaipwtOdc+0Z
>>     V1qCSzLQDMAIKcuPWGnFrn9D8s24f8SasfAh83ca6oA8Ht4YoOEJILhCC81gRFhj
>>     HGBLuVtAyfIKYza8Vn3QIoGDzqM/YqCdeOSrZKPkfnhma/lYy7JeuNfzXs8av3Eg
>>     q0R8+4K1Bdl8I1J3rDZv/fuQMpWcYcuXpbdHJJ8Iwr7yeSVESrKT/HLtEZJIqBwI
>>     F4FucgZUtkzgxodFqKrZBNgHNt0Bqnph04xVivqidhZvdE6SKap3/U5iSHXBNWcP
>>     AGlWdWt2pqiWzCA0sHdQaw9AWlOB5RAGGebotnidu2V8PNiNwsjO5Llg0feagr9a
>>     rikDkOpwChF3+u5z9yztCBgcNHBo1Nf4UW2eijqtsci+0OJ4cA75A4xjpd5AvrAj
>>     Bz0SrueuRUKvwSEvJus7
>>     =pJXZ
>>     -----END PGP SIGNATURE-----
>>
>>     ---------------------------------------------------------------------
>>     To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>     <ma...@tomcat.apache.org>
>>     For additional commands, e-mail: users-help@tomcat.apache.org
>>     <ma...@tomcat.apache.org>
>>
>>
>>
>>
>> --
>> Sandip Gaikwad
>> 9987626799
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Sandip Gaikwad
9987626799

Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
Please see inline comments from previous message.

-Terence Bandoian


On 1/2/2015 9:45 PM, Terence M. Bandoian wrote:
> On 1/1/2015 9:20 AM, Sandip Gaikwad wrote:
>> Hi,
>>
>> Following are entries in files. Please let me know what is going wrong.
>>
>> *workers.properties*
>> worker.list=worker1
>> # Set properties for worker1 (ajp13)
>> worker.worker1.type=ajp13
>> worker.worker1.host=localhost
>> worker.worker1.port=8009
>> worker.worker1.connection_pool_size=10
>> worker.worker1.connection_pool_timeout=600
>> worker.worker1.socket_keepalive=true
>> worker.worker1.socket_timeout=300
>>
>>
>> *httpd.conf*
>> LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
>> JkWorkersFile "C:/tomcat-connectors-1.2.40-src/conf/workers.properties"
>> JkLogFile "C:/Apache24/logs/mod_jk.log"
>> JkLogLevel info
>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>> JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
>> JkRequestLogFormat "%w %V %T"
>> JkMount /jenkins/* worker1
>>
>> *server.xml*
>> <?xml version='1.0' encoding='utf-8'?>
>> <Server port="8005" shutdown="SHUTDOWN">
>>   <Listener className="org.apache.jk.config.ApacheConfig" 
>> modJk="C:/Apache24/modules/mod_jk.so"/>
>>   <Listener 
>> className="org.apache.catalina.startup.VersionLoggerListener" />
>>   <Listener className="org.apache.catalina.core.AprLifecycleListener" 
>> SSLEngine="on" />
>>   <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">
>>
>>     <Connector port="8080" protocol="HTTP/1.1"
>>                connectionTimeout="20000"
>>                redirectPort="8443" />
>
>
> If you don't want to allow direct access to Tomcat, the Connector 
> above should be removed.
>
>
>>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
>
>
> The address attribute should probably be set on the Connector above.  
> Setting it 127.0.0.1 (address="127.0.0.1") will limit access to the 
> local host.
>
> -Terence Bandoian
>
>
>>     <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">
>>         <Listener className="org.apache.jk.config.ApacheConfig" 
>> modJk="C:/Apache24/modules/mod_jk.so"/>
>>         <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>
>>
>> Thanks,
>> Sandip
>>
>>
>> On Thu, Jan 1, 2015 at 7:45 PM, Christopher Schultz 
>> <chris@christopherschultz.net <ma...@christopherschultz.net>> 
>> wrote:
>>
>>     -----BEGIN PGP SIGNED MESSAGE-----
>>     Hash: SHA256
>>
>>     Sandip,
>>
>>     On 1/1/15 12:19 AM, Sandip Gaikwad wrote:
>>     > Could you please let me know how to block direct access to tomcat
>>     > and allow access through apache http server only?
>>     >
>>     > I used http://
>>     >
>> http://www.slideshare.net/mohanraj_nagasamy/integrating-tomcat-and-apache-on-windows-presentation
>>     >
>>     >
>>     for reference.
>>
>>     tl;dr
>>
>>     > What indicates that each request is coming from apache httpd only?
>>
>>     Nothing, really. There are ways to determine this, but you are 
>> better
>>     off solving the root problem.
>>
>>     > Example: i have added following code in httpd.conf # Send
>>     > everything for context /example1 to worker named worker1 (ajp13)
>>     > JkMount /example1/* worker1
>>     >
>>     > in tomcat i have two apps example1 and example2
>>     >
>>     > I am expecting to access only http://localhost/example1 . But i 
>> can
>>     > access http://localhost/example2 as well.
>>     >
>>     > How can i stop http://localhost/example2 from being accessed?
>>
>>     Only one process can bind to a single interface+port, so you need to
>>     figure out whether Tomcat or httpd is using port 80.
>>
>>     If httpd is bound to port 80, then the only reasons why a request to
>>     /example2 would hit your application are:
>>
>>        a) You have a JkMount somewhere for that
>>        b) You have made your DocumentRoot = appbase
>>
>>     The first is easy to fix: just remove that JkMount.
>>     The second is a horrible security problem that you'll need to fix
>>     immediately.
>>
>>     - -chris
>>     -----BEGIN PGP SIGNATURE-----
>>     Version: GnuPG v1
>>     Comment: GPGTools - http://gpgtools.org
>>
>> iQIcBAEBCAAGBQJUpVaXAAoJEBzwKT+lPKRYY5AQAJ6+2NAhVtCWl1KMSQj2FGr8
>> TMh/cpFAUiFY8NYbxLhPLZnELf/PhoCZlBAHnUJN7j+ozr5YbjbBW7sVJ9kI3yu8
>> W1lB5zlxZKuVGBp3+GZsMdQcMDr/tg4Jkr8/TFKqUZOo5RPeTVoXxy+azdCNyMuy
>> BdogSIpqpxc1k6r1lQOGljiKzXiZJDdpkJwDau1mnzY8eO54pxZWHIJI63c4gu5y
>> akinaEncJDzI5dFwAQWiL/C+CtO8ujiUePH+FfpwfzoQozqIa+hpCaipwtOdc+0Z
>> V1qCSzLQDMAIKcuPWGnFrn9D8s24f8SasfAh83ca6oA8Ht4YoOEJILhCC81gRFhj
>> HGBLuVtAyfIKYza8Vn3QIoGDzqM/YqCdeOSrZKPkfnhma/lYy7JeuNfzXs8av3Eg
>> q0R8+4K1Bdl8I1J3rDZv/fuQMpWcYcuXpbdHJJ8Iwr7yeSVESrKT/HLtEZJIqBwI
>> F4FucgZUtkzgxodFqKrZBNgHNt0Bqnph04xVivqidhZvdE6SKap3/U5iSHXBNWcP
>> AGlWdWt2pqiWzCA0sHdQaw9AWlOB5RAGGebotnidu2V8PNiNwsjO5Llg0feagr9a
>> rikDkOpwChF3+u5z9yztCBgcNHBo1Nf4UW2eijqtsci+0OJ4cA75A4xjpd5AvrAj
>>     Bz0SrueuRUKvwSEvJus7
>>     =pJXZ
>>     -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>>     To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>     <ma...@tomcat.apache.org>
>>     For additional commands, e-mail: users-help@tomcat.apache.org
>>     <ma...@tomcat.apache.org>
>>
>>
>>
>>
>> -- 
>> Sandip Gaikwad
>> 9987626799
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
On 1/1/2015 9:20 AM, Sandip Gaikwad wrote:
> Hi,
>
> Following are entries in files. Please let me know what is going wrong.
>
> *workers.properties*
> worker.list=worker1
> # Set properties for worker1 (ajp13)
> worker.worker1.type=ajp13
> worker.worker1.host=localhost
> worker.worker1.port=8009
> worker.worker1.connection_pool_size=10
> worker.worker1.connection_pool_timeout=600
> worker.worker1.socket_keepalive=true
> worker.worker1.socket_timeout=300
>
>
> *httpd.conf*
> LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
> JkWorkersFile "C:/tomcat-connectors-1.2.40-src/conf/workers.properties"
> JkLogFile "C:/Apache24/logs/mod_jk.log"
> JkLogLevel info
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
> JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
> JkRequestLogFormat "%w %V %T"
> JkMount /jenkins/* worker1
>
> *server.xml*
> <?xml version='1.0' encoding='utf-8'?>
> <Server port="8005" shutdown="SHUTDOWN">
>   <Listener className="org.apache.jk.config.ApacheConfig" 
> modJk="C:/Apache24/modules/mod_jk.so"/>
>   <Listener 
> className="org.apache.catalina.startup.VersionLoggerListener" />
>   <Listener className="org.apache.catalina.core.AprLifecycleListener" 
> SSLEngine="on" />
>   <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">
>
>     <Connector port="8080" protocol="HTTP/1.1"
>                connectionTimeout="20000"
>                redirectPort="8443" />


If you don't want to allow direct access to Tomcat, the Connector above 
should be removed.


>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


The address attribute should probably be set on the Connector above.  
Setting it 127.0.0.1 (address="127.0.0.1") will limit access to the 
local host.

-Terence Bandoian


>     <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">
>         <Listener className="org.apache.jk.config.ApacheConfig" 
> modJk="C:/Apache24/modules/mod_jk.so"/>
>         <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>
>
> Thanks,
> Sandip
>
>
> On Thu, Jan 1, 2015 at 7:45 PM, Christopher Schultz 
> <chris@christopherschultz.net <ma...@christopherschultz.net>> 
> wrote:
>
>     -----BEGIN PGP SIGNED MESSAGE-----
>     Hash: SHA256
>
>     Sandip,
>
>     On 1/1/15 12:19 AM, Sandip Gaikwad wrote:
>     > Could you please let me know how to block direct access to tomcat
>     > and allow access through apache http server only?
>     >
>     > I used http://
>     >
>     http://www.slideshare.net/mohanraj_nagasamy/integrating-tomcat-and-apache-on-windows-presentation
>     >
>     >
>     for reference.
>
>     tl;dr
>
>     > What indicates that each request is coming from apache httpd only?
>
>     Nothing, really. There are ways to determine this, but you are better
>     off solving the root problem.
>
>     > Example: i have added following code in httpd.conf # Send
>     > everything for context /example1 to worker named worker1 (ajp13)
>     > JkMount /example1/* worker1
>     >
>     > in tomcat i have two apps example1 and example2
>     >
>     > I am expecting to access only http://localhost/example1 . But i can
>     > access http://localhost/example2 as well.
>     >
>     > How can i stop http://localhost/example2 from being accessed?
>
>     Only one process can bind to a single interface+port, so you need to
>     figure out whether Tomcat or httpd is using port 80.
>
>     If httpd is bound to port 80, then the only reasons why a request to
>     /example2 would hit your application are:
>
>        a) You have a JkMount somewhere for that
>        b) You have made your DocumentRoot = appbase
>
>     The first is easy to fix: just remove that JkMount.
>     The second is a horrible security problem that you'll need to fix
>     immediately.
>
>     - -chris
>     -----BEGIN PGP SIGNATURE-----
>     Version: GnuPG v1
>     Comment: GPGTools - http://gpgtools.org
>
>     iQIcBAEBCAAGBQJUpVaXAAoJEBzwKT+lPKRYY5AQAJ6+2NAhVtCWl1KMSQj2FGr8
>     TMh/cpFAUiFY8NYbxLhPLZnELf/PhoCZlBAHnUJN7j+ozr5YbjbBW7sVJ9kI3yu8
>     W1lB5zlxZKuVGBp3+GZsMdQcMDr/tg4Jkr8/TFKqUZOo5RPeTVoXxy+azdCNyMuy
>     BdogSIpqpxc1k6r1lQOGljiKzXiZJDdpkJwDau1mnzY8eO54pxZWHIJI63c4gu5y
>     akinaEncJDzI5dFwAQWiL/C+CtO8ujiUePH+FfpwfzoQozqIa+hpCaipwtOdc+0Z
>     V1qCSzLQDMAIKcuPWGnFrn9D8s24f8SasfAh83ca6oA8Ht4YoOEJILhCC81gRFhj
>     HGBLuVtAyfIKYza8Vn3QIoGDzqM/YqCdeOSrZKPkfnhma/lYy7JeuNfzXs8av3Eg
>     q0R8+4K1Bdl8I1J3rDZv/fuQMpWcYcuXpbdHJJ8Iwr7yeSVESrKT/HLtEZJIqBwI
>     F4FucgZUtkzgxodFqKrZBNgHNt0Bqnph04xVivqidhZvdE6SKap3/U5iSHXBNWcP
>     AGlWdWt2pqiWzCA0sHdQaw9AWlOB5RAGGebotnidu2V8PNiNwsjO5Llg0feagr9a
>     rikDkOpwChF3+u5z9yztCBgcNHBo1Nf4UW2eijqtsci+0OJ4cA75A4xjpd5AvrAj
>     Bz0SrueuRUKvwSEvJus7
>     =pJXZ
>     -----END PGP SIGNATURE-----
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>     <ma...@tomcat.apache.org>
>     For additional commands, e-mail: users-help@tomcat.apache.org
>     <ma...@tomcat.apache.org>
>
>
>
>
> -- 
> Sandip Gaikwad
> 9987626799


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Sandip Gaikwad <sa...@gmail.com>.
Any updates on this?
 On 3 Jan 2015 11:07, "Sandip Gaikwad" <sa...@gmail.com> wrote:

> Hi Chris,
>
>
> * Are you sure there are no other JkMounts?*
> Yes. There are no other JKMounts.
>
>
> * What is your DocumentRoot set to? Do you have any Alias directives that
> are pointing into CATALINA_BASE/webapps?*
> In which file should i look these. I haven't set them.
>
>
>
>
> *You don't want this: the ApacheConfig listener should probably be removed
> forever. This probably shouldn't be here: you already have ApacheConfig
> above, and you probably shouldn't have it here again.*
> Removed <Listener className="org.apache.jk.config.ApacheConfig"
> modJk="C:/Apache24/modules/mod_jk.so"/>
>
>
>
> *I don't see any actual problems so far, but there's still room for
> "alternative" configuration. What's in your "webapps" directory?*
>
> *tomcat installation default folders (like  docs, host-manager, manager,
> ROOT) and jenkins, example2*
> I am able to access apache using url http://localhost
> I am not able to access any tomcat apps using urls like
> http://localhost/jenkins or http://localhost/example2
> But when i put port number in url i can access urls like
> http://localhost:8080/jenkins or http://localhost:8080/example2
> I short, I am expecting access http://localhost/jenkins
>
> Following server.xml after making your suggested changes:
> <?xml version='1.0' encoding='utf-8'?>
> <Server port="8005" shutdown="SHUTDOWN">
>   <Listener className="org.apache.catalina.startup.VersionLoggerListener"
> />
>   <Listener className="org.apache.catalina.core.AprLifecycleListener"
> SSLEngine="on" />
>   <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">
>
>     <Connector port="8080" protocol="HTTP/1.1"
>                connectionTimeout="20000"
>                redirectPort="8443" />
>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
>     <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>
>
> Thanks,
>
>
>
> On Sat, Jan 3, 2015 at 1:02 AM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> Sandip,
>>
>> On 1/1/15 10:20 AM, Sandip Gaikwad wrote:
>> > Following are entries in files. Please let me know what is going
>> > wrong.
>> >
>> > *workers.properties* worker.list=worker1 # Set properties for
>> > worker1 (ajp13) worker.worker1.type=ajp13
>> > worker.worker1.host=localhost worker.worker1.port=8009
>> > worker.worker1.connection_pool_size=10
>> > worker.worker1.connection_pool_timeout=600
>> > worker.worker1.socket_keepalive=true
>> > worker.worker1.socket_timeout=300
>> >
>> >
>> > *httpd.conf* LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
>> > JkWorkersFile
>> > "C:/tomcat-connectors-1.2.40-src/conf/workers.properties" JkLogFile
>> > "C:/Apache24/logs/mod_jk.log" JkLogLevel info JkLogStampFormat "[%a
>> > %b %d %H:%M:%S %Y] " JkOptions +ForwardKeySize +ForwardURICompat
>> > -ForwardDirectories JkRequestLogFormat "%w %V %T" JkMount
>> > /jenkins/* worker1
>>
>> Okay, so /jenkins is /example1 from your original post. What is /example2?
>>
>> Are you sure there are no other JkMounts?
>>
>> What is your DocumentRoot set to? Do you have any Alias directives
>> that are pointing into CATALINA_BASE/webapps?
>>
>> > *server.xml* <?xml version='1.0' encoding='utf-8'?> <Server
>> > port="8005" shutdown="SHUTDOWN"> <Listener
>> > className="org.apache.jk.config.ApacheConfig"
>> > modJk="C:/Apache24/modules/mod_jk.so"/>
>>
>> You don't want this: the ApacheConfig listener should probably be
>> removed forever.
>>
>> > <Listener
>> > className="org.apache.catalina.startup.VersionLoggerListener" />
>> > <Listener
>> > className="org.apache.catalina.core.AprLifecycleListener"
>> > SSLEngine="on" /> <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">
>> >
>> > <Connector port="8080" protocol="HTTP/1.1"
>> > connectionTimeout="20000" redirectPort="8443" /> <Connector
>> > port="8009" protocol="AJP/1.3" redirectPort="8443" /> <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"> <Listener
>> > className="org.apache.jk.config.ApacheConfig"
>> > modJk="C:/Apache24/modules/mod_jk.so"/>
>>
>> This probably shouldn't be here: you already have ApacheConfig above,
>> and you probably shouldn't have it here again.
>>
>> > <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 don't see any actual problems so far, but there's still room for
>> "alternative" configuration. What's in your "webapps" directory?
>>
>> - -chris
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1
>> Comment: GPGTools - http://gpgtools.org
>>
>> iQIcBAEBCAAGBQJUpvJrAAoJEBzwKT+lPKRYBmsQAKegRJvcvXmdQcQ1OcMekzpM
>> 2e23NapNhxwuCpkRgK567Uzfyaqw9U+K43gvRitiWx9BO0vNq87UGEipa2k9mp/s
>> YEW7TClRqO9C25gKfEj9MTvhPBztg0f0fMFEwtfKlsIB1sCnWFSkfpYuzq9IfN5I
>> DTRCDCLNLVmxCp5oFfuyOeFgamEuGu6vz9Z4+P/IsTO2iXMDlJbdTcUcn+HoU0lV
>> e2EVCW4mHhQw/Nvmf3/Ib7w5YR8VmdFCBfsY1yXFZ3pi5fZYS4waYheBZmYN/aH1
>> AvtA7JX2nnquFStOTNM1x+KsZcBkH+tGtFgMlrn9k0HFNBPzD6/CGJUGywlRekLR
>> gA0re6sh3KoZJs0ubu3oiAhUy0icqYda2NhalNYmtctvBGQ7QgvqXgiNvEn1LnBM
>> 07Wf6i1c27IxM0yGEAPXWLcbRO71QjNl3yGctKma0UKyZK9bjX+tGP+mt/1NLSYK
>> WV+QzEQDGa09t2x37RjrNtFOMOMWK8uWmLabguwHnK2YCqf+9CViBOkukBpKXf9C
>> zW5/P2E6ZoDiVNL/0bi6HIr7ewICMXiaG51PoNSIfPp6szs0QhOwrJVr07flCvba
>> b0hmq4duugZkCx/7nuWpa4MtAxIun4S/ZGufWJnTHJaZJS/aJisgJVXkPQ+v8PP8
>> 7PnUU232mmp/2DuPQNBy
>> =vyvf
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> --
> Sandip Gaikwad
> 9987626799
>

Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Sandip,

On 1/3/15 12:37 AM, Sandip Gaikwad wrote:
> * Are you sure there are no other JkMounts?* Yes. There are no
> other JKMounts.
> 
> 
> * What is your DocumentRoot set to? Do you have any Alias
> directives that are pointing into CATALINA_BASE/webapps?* In which
> file should i look these. I haven't set them.

httpd.conf, or anything that has been included by httpd.conf.

> *I don't see any actual problems so far, but there's still room
> for "alternative" configuration. What's in your "webapps"
> directory?*
> 
> *tomcat installation default folders (like  docs, host-manager,
> manager, ROOT) and jenkins, example2* I am able to access apache
> using url http://localhost I am not able to access any tomcat apps
> using urls like http://localhost/jenkins or
> http://localhost/example2 But when i put port number in url i can
> access urls like http://localhost:8080/jenkins or
> http://localhost:8080/example2 I short, I am expecting access
> http://localhost/jenkins

Oh, of course. If you use http://localhost/example2 then you will get
404 (or whatever). If you add a port number, you're accessing CHADIS
directly and therefore the JkMounts you've put into httpd.conf have no
effect whatsoever.

If you want to use Apache httpd as a reverse-proxy, then you should
use it and not circumvent it by using the port number to hit Tomcat
directly.

If you don't want those other webapps to be available even when using
port 8080, then remove them from your webapps directory.

Another option would be to remove the HTTP <Connector> from server.xml
so you can only access web applications via AJP. But remember that the
user is still under no obligation to go through your reverse-proxy
unless you configure your network appropriately.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUqwPnAAoJEBzwKT+lPKRYPt4QAKNCI7OAKCe9TaAVjrkJRDI1
a0sQzqPj92Z1Jvp53j3P4+DaEFeFZMAVEg3v29Ym6/ZpCL+ICqB3NWpGH8+gZUuR
xRENV8J2qhhBNJ643Myei3FMmHc7YAdS7+hCQTcoDdBXU3HC1JaSDkST1PDn9hEA
90lZ0a1UCiqYe9dWpJpWV+xs43IykalgOf7weN7rJBY1hoE1WxVXdgpc8R+HQWO4
645lYq795GyBRsg3ZdvWF9KKF5BZiu4i4nKmtcZcz9tespZrUkv0x2f+o3Ysw9N0
hS2RZG8wEZBR1qAW3GieVUh8B1CpeNPAvcsNeZov3tEn+FxIM9QKLJq2dSvjq+9Y
BlpyhbiasGtYcmxEBN7fUFDxBXMKC8KkQGwIXdKCXKderAWtqz0ocl8gEG8GpQoJ
1capCQsVwFDJlJ2L69tn7wWrFhI7kVV/Vebxx+P2whmKbtNOPk8QFnVdtGd7yINs
GXHb48RlCK5RyuKXsSAOGNBfa6yQ8Tpp4SHzH5WBPOXsNnBcKTgTjmcA7xiBiAbE
3BD6xuPNUe99EUAHb9yAPe4EvXkvMkOhzzdL5PuSvYI9sF17BSl0HoHaMo2VX4LH
yyTV11NAV1HzfO/lIAYTampTfc1ivwg15Qib8ghBNRbHjEk2kJ3fn3naBksRXX97
x56a4TCrVsJOwsRp7nVj
=RNQN
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Sandip Gaikwad <sa...@gmail.com>.
Hi Chris,


* Are you sure there are no other JkMounts?*
Yes. There are no other JKMounts.


* What is your DocumentRoot set to? Do you have any Alias directives that
are pointing into CATALINA_BASE/webapps?*
In which file should i look these. I haven't set them.




*You don't want this: the ApacheConfig listener should probably be removed
forever. This probably shouldn't be here: you already have ApacheConfig
above, and you probably shouldn't have it here again.*
Removed <Listener className="org.apache.jk.config.ApacheConfig"
modJk="C:/Apache24/modules/mod_jk.so"/>



*I don't see any actual problems so far, but there's still room for
"alternative" configuration. What's in your "webapps" directory?*

*tomcat installation default folders (like  docs, host-manager, manager,
ROOT) and jenkins, example2*
I am able to access apache using url http://localhost
I am not able to access any tomcat apps using urls like
http://localhost/jenkins or http://localhost/example2
But when i put port number in url i can access urls like
http://localhost:8080/jenkins or http://localhost:8080/example2
I short, I am expecting access http://localhost/jenkins

Following server.xml after making your suggested changes:
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  <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">

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
    <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>

Thanks,



On Sat, Jan 3, 2015 at 1:02 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Sandip,
>
> On 1/1/15 10:20 AM, Sandip Gaikwad wrote:
> > Following are entries in files. Please let me know what is going
> > wrong.
> >
> > *workers.properties* worker.list=worker1 # Set properties for
> > worker1 (ajp13) worker.worker1.type=ajp13
> > worker.worker1.host=localhost worker.worker1.port=8009
> > worker.worker1.connection_pool_size=10
> > worker.worker1.connection_pool_timeout=600
> > worker.worker1.socket_keepalive=true
> > worker.worker1.socket_timeout=300
> >
> >
> > *httpd.conf* LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
> > JkWorkersFile
> > "C:/tomcat-connectors-1.2.40-src/conf/workers.properties" JkLogFile
> > "C:/Apache24/logs/mod_jk.log" JkLogLevel info JkLogStampFormat "[%a
> > %b %d %H:%M:%S %Y] " JkOptions +ForwardKeySize +ForwardURICompat
> > -ForwardDirectories JkRequestLogFormat "%w %V %T" JkMount
> > /jenkins/* worker1
>
> Okay, so /jenkins is /example1 from your original post. What is /example2?
>
> Are you sure there are no other JkMounts?
>
> What is your DocumentRoot set to? Do you have any Alias directives
> that are pointing into CATALINA_BASE/webapps?
>
> > *server.xml* <?xml version='1.0' encoding='utf-8'?> <Server
> > port="8005" shutdown="SHUTDOWN"> <Listener
> > className="org.apache.jk.config.ApacheConfig"
> > modJk="C:/Apache24/modules/mod_jk.so"/>
>
> You don't want this: the ApacheConfig listener should probably be
> removed forever.
>
> > <Listener
> > className="org.apache.catalina.startup.VersionLoggerListener" />
> > <Listener
> > className="org.apache.catalina.core.AprLifecycleListener"
> > SSLEngine="on" /> <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">
> >
> > <Connector port="8080" protocol="HTTP/1.1"
> > connectionTimeout="20000" redirectPort="8443" /> <Connector
> > port="8009" protocol="AJP/1.3" redirectPort="8443" /> <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"> <Listener
> > className="org.apache.jk.config.ApacheConfig"
> > modJk="C:/Apache24/modules/mod_jk.so"/>
>
> This probably shouldn't be here: you already have ApacheConfig above,
> and you probably shouldn't have it here again.
>
> > <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 don't see any actual problems so far, but there's still room for
> "alternative" configuration. What's in your "webapps" directory?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJUpvJrAAoJEBzwKT+lPKRYBmsQAKegRJvcvXmdQcQ1OcMekzpM
> 2e23NapNhxwuCpkRgK567Uzfyaqw9U+K43gvRitiWx9BO0vNq87UGEipa2k9mp/s
> YEW7TClRqO9C25gKfEj9MTvhPBztg0f0fMFEwtfKlsIB1sCnWFSkfpYuzq9IfN5I
> DTRCDCLNLVmxCp5oFfuyOeFgamEuGu6vz9Z4+P/IsTO2iXMDlJbdTcUcn+HoU0lV
> e2EVCW4mHhQw/Nvmf3/Ib7w5YR8VmdFCBfsY1yXFZ3pi5fZYS4waYheBZmYN/aH1
> AvtA7JX2nnquFStOTNM1x+KsZcBkH+tGtFgMlrn9k0HFNBPzD6/CGJUGywlRekLR
> gA0re6sh3KoZJs0ubu3oiAhUy0icqYda2NhalNYmtctvBGQ7QgvqXgiNvEn1LnBM
> 07Wf6i1c27IxM0yGEAPXWLcbRO71QjNl3yGctKma0UKyZK9bjX+tGP+mt/1NLSYK
> WV+QzEQDGa09t2x37RjrNtFOMOMWK8uWmLabguwHnK2YCqf+9CViBOkukBpKXf9C
> zW5/P2E6ZoDiVNL/0bi6HIr7ewICMXiaG51PoNSIfPp6szs0QhOwrJVr07flCvba
> b0hmq4duugZkCx/7nuWpa4MtAxIun4S/ZGufWJnTHJaZJS/aJisgJVXkPQ+v8PP8
> 7PnUU232mmp/2DuPQNBy
> =vyvf
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Sandip Gaikwad
9987626799

Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Sandip,

On 1/1/15 10:20 AM, Sandip Gaikwad wrote:
> Following are entries in files. Please let me know what is going
> wrong.
> 
> *workers.properties* worker.list=worker1 # Set properties for
> worker1 (ajp13) worker.worker1.type=ajp13 
> worker.worker1.host=localhost worker.worker1.port=8009 
> worker.worker1.connection_pool_size=10 
> worker.worker1.connection_pool_timeout=600 
> worker.worker1.socket_keepalive=true 
> worker.worker1.socket_timeout=300
> 
> 
> *httpd.conf* LoadModule jk_module "C:/Apache24/modules/mod_jk.so" 
> JkWorkersFile
> "C:/tomcat-connectors-1.2.40-src/conf/workers.properties" JkLogFile
> "C:/Apache24/logs/mod_jk.log" JkLogLevel info JkLogStampFormat "[%a
> %b %d %H:%M:%S %Y] " JkOptions +ForwardKeySize +ForwardURICompat
> -ForwardDirectories JkRequestLogFormat "%w %V %T" JkMount
> /jenkins/* worker1

Okay, so /jenkins is /example1 from your original post. What is /example2?

Are you sure there are no other JkMounts?

What is your DocumentRoot set to? Do you have any Alias directives
that are pointing into CATALINA_BASE/webapps?

> *server.xml* <?xml version='1.0' encoding='utf-8'?> <Server
> port="8005" shutdown="SHUTDOWN"> <Listener
> className="org.apache.jk.config.ApacheConfig" 
> modJk="C:/Apache24/modules/mod_jk.so"/>

You don't want this: the ApacheConfig listener should probably be
removed forever.

> <Listener
> className="org.apache.catalina.startup.VersionLoggerListener" /> 
> <Listener
> className="org.apache.catalina.core.AprLifecycleListener" 
> SSLEngine="on" /> <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">
> 
> <Connector port="8080" protocol="HTTP/1.1" 
> connectionTimeout="20000" redirectPort="8443" /> <Connector
> port="8009" protocol="AJP/1.3" redirectPort="8443" /> <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"> <Listener
> className="org.apache.jk.config.ApacheConfig" 
> modJk="C:/Apache24/modules/mod_jk.so"/>

This probably shouldn't be here: you already have ApacheConfig above,
and you probably shouldn't have it here again.

> <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 don't see any actual problems so far, but there's still room for
"alternative" configuration. What's in your "webapps" directory?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUpvJrAAoJEBzwKT+lPKRYBmsQAKegRJvcvXmdQcQ1OcMekzpM
2e23NapNhxwuCpkRgK567Uzfyaqw9U+K43gvRitiWx9BO0vNq87UGEipa2k9mp/s
YEW7TClRqO9C25gKfEj9MTvhPBztg0f0fMFEwtfKlsIB1sCnWFSkfpYuzq9IfN5I
DTRCDCLNLVmxCp5oFfuyOeFgamEuGu6vz9Z4+P/IsTO2iXMDlJbdTcUcn+HoU0lV
e2EVCW4mHhQw/Nvmf3/Ib7w5YR8VmdFCBfsY1yXFZ3pi5fZYS4waYheBZmYN/aH1
AvtA7JX2nnquFStOTNM1x+KsZcBkH+tGtFgMlrn9k0HFNBPzD6/CGJUGywlRekLR
gA0re6sh3KoZJs0ubu3oiAhUy0icqYda2NhalNYmtctvBGQ7QgvqXgiNvEn1LnBM
07Wf6i1c27IxM0yGEAPXWLcbRO71QjNl3yGctKma0UKyZK9bjX+tGP+mt/1NLSYK
WV+QzEQDGa09t2x37RjrNtFOMOMWK8uWmLabguwHnK2YCqf+9CViBOkukBpKXf9C
zW5/P2E6ZoDiVNL/0bi6HIr7ewICMXiaG51PoNSIfPp6szs0QhOwrJVr07flCvba
b0hmq4duugZkCx/7nuWpa4MtAxIun4S/ZGufWJnTHJaZJS/aJisgJVXkPQ+v8PP8
7PnUU232mmp/2DuPQNBy
=vyvf
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Sandip Gaikwad <sa...@gmail.com>.
Hi,

Following are entries in files. Please let me know what is going wrong.

*workers.properties*
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.connection_pool_size=10
worker.worker1.connection_pool_timeout=600
worker.worker1.socket_keepalive=true
worker.worker1.socket_timeout=300


*httpd.conf*
LoadModule jk_module "C:/Apache24/modules/mod_jk.so"
JkWorkersFile "C:/tomcat-connectors-1.2.40-src/conf/workers.properties"
JkLogFile "C:/Apache24/logs/mod_jk.log"
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /jenkins/* worker1

*server.xml*
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.jk.config.ApacheConfig"
modJk="C:/Apache24/modules/mod_jk.so"/>
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  <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">

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
    <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">
        <Listener className="org.apache.jk.config.ApacheConfig"
modJk="C:/Apache24/modules/mod_jk.so"/>
        <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>

Thanks,
Sandip


On Thu, Jan 1, 2015 at 7:45 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Sandip,
>
> On 1/1/15 12:19 AM, Sandip Gaikwad wrote:
> > Could you please let me know how to block direct access to tomcat
> > and allow access through apache http server only?
> >
> > I used http://
> >
> http://www.slideshare.net/mohanraj_nagasamy/integrating-tomcat-and-apache-on-windows-presentation
> >
> >
> for reference.
>
> tl;dr
>
> > What indicates that each request is coming from apache httpd only?
>
> Nothing, really. There are ways to determine this, but you are better
> off solving the root problem.
>
> > Example: i have added following code in httpd.conf # Send
> > everything for context /example1 to worker named worker1 (ajp13)
> > JkMount /example1/* worker1
> >
> > in tomcat i have two apps example1 and example2
> >
> > I am expecting to access only http://localhost/example1 . But i can
> > access http://localhost/example2 as well.
> >
> > How can i stop http://localhost/example2 from being accessed?
>
> Only one process can bind to a single interface+port, so you need to
> figure out whether Tomcat or httpd is using port 80.
>
> If httpd is bound to port 80, then the only reasons why a request to
> /example2 would hit your application are:
>
>    a) You have a JkMount somewhere for that
>    b) You have made your DocumentRoot = appbase
>
> The first is easy to fix: just remove that JkMount.
> The second is a horrible security problem that you'll need to fix
> immediately.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJUpVaXAAoJEBzwKT+lPKRYY5AQAJ6+2NAhVtCWl1KMSQj2FGr8
> TMh/cpFAUiFY8NYbxLhPLZnELf/PhoCZlBAHnUJN7j+ozr5YbjbBW7sVJ9kI3yu8
> W1lB5zlxZKuVGBp3+GZsMdQcMDr/tg4Jkr8/TFKqUZOo5RPeTVoXxy+azdCNyMuy
> BdogSIpqpxc1k6r1lQOGljiKzXiZJDdpkJwDau1mnzY8eO54pxZWHIJI63c4gu5y
> akinaEncJDzI5dFwAQWiL/C+CtO8ujiUePH+FfpwfzoQozqIa+hpCaipwtOdc+0Z
> V1qCSzLQDMAIKcuPWGnFrn9D8s24f8SasfAh83ca6oA8Ht4YoOEJILhCC81gRFhj
> HGBLuVtAyfIKYza8Vn3QIoGDzqM/YqCdeOSrZKPkfnhma/lYy7JeuNfzXs8av3Eg
> q0R8+4K1Bdl8I1J3rDZv/fuQMpWcYcuXpbdHJJ8Iwr7yeSVESrKT/HLtEZJIqBwI
> F4FucgZUtkzgxodFqKrZBNgHNt0Bqnph04xVivqidhZvdE6SKap3/U5iSHXBNWcP
> AGlWdWt2pqiWzCA0sHdQaw9AWlOB5RAGGebotnidu2V8PNiNwsjO5Llg0feagr9a
> rikDkOpwChF3+u5z9yztCBgcNHBo1Nf4UW2eijqtsci+0OJ4cA75A4xjpd5AvrAj
> Bz0SrueuRUKvwSEvJus7
> =pJXZ
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Sandip Gaikwad
9987626799

Re: Tomcat 8, Apache 2.4, Tomcat Connector 1.2.40, Windows 7 home basic issue

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Sandip,

On 1/1/15 12:19 AM, Sandip Gaikwad wrote:
> Could you please let me know how to block direct access to tomcat
> and allow access through apache http server only?
> 
> I used http:// 
> http://www.slideshare.net/mohanraj_nagasamy/integrating-tomcat-and-apache-on-windows-presentation
>
> 
for reference.

tl;dr

> What indicates that each request is coming from apache httpd only?

Nothing, really. There are ways to determine this, but you are better
off solving the root problem.

> Example: i have added following code in httpd.conf # Send
> everything for context /example1 to worker named worker1 (ajp13) 
> JkMount /example1/* worker1
> 
> in tomcat i have two apps example1 and example2
> 
> I am expecting to access only http://localhost/example1 . But i can
> access http://localhost/example2 as well.
> 
> How can i stop http://localhost/example2 from being accessed?

Only one process can bind to a single interface+port, so you need to
figure out whether Tomcat or httpd is using port 80.

If httpd is bound to port 80, then the only reasons why a request to
/example2 would hit your application are:

   a) You have a JkMount somewhere for that
   b) You have made your DocumentRoot = appbase

The first is easy to fix: just remove that JkMount.
The second is a horrible security problem that you'll need to fix
immediately.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUpVaXAAoJEBzwKT+lPKRYY5AQAJ6+2NAhVtCWl1KMSQj2FGr8
TMh/cpFAUiFY8NYbxLhPLZnELf/PhoCZlBAHnUJN7j+ozr5YbjbBW7sVJ9kI3yu8
W1lB5zlxZKuVGBp3+GZsMdQcMDr/tg4Jkr8/TFKqUZOo5RPeTVoXxy+azdCNyMuy
BdogSIpqpxc1k6r1lQOGljiKzXiZJDdpkJwDau1mnzY8eO54pxZWHIJI63c4gu5y
akinaEncJDzI5dFwAQWiL/C+CtO8ujiUePH+FfpwfzoQozqIa+hpCaipwtOdc+0Z
V1qCSzLQDMAIKcuPWGnFrn9D8s24f8SasfAh83ca6oA8Ht4YoOEJILhCC81gRFhj
HGBLuVtAyfIKYza8Vn3QIoGDzqM/YqCdeOSrZKPkfnhma/lYy7JeuNfzXs8av3Eg
q0R8+4K1Bdl8I1J3rDZv/fuQMpWcYcuXpbdHJJ8Iwr7yeSVESrKT/HLtEZJIqBwI
F4FucgZUtkzgxodFqKrZBNgHNt0Bqnph04xVivqidhZvdE6SKap3/U5iSHXBNWcP
AGlWdWt2pqiWzCA0sHdQaw9AWlOB5RAGGebotnidu2V8PNiNwsjO5Llg0feagr9a
rikDkOpwChF3+u5z9yztCBgcNHBo1Nf4UW2eijqtsci+0OJ4cA75A4xjpd5AvrAj
Bz0SrueuRUKvwSEvJus7
=pJXZ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org