tomcat after installation

Dear All,

finally, i was able to install the tomcat successfull. I can now restart the tomcat successfully but yet i am unable to view default page at 8080 port.
Can any one please help me out.

Could be lots of things. It may not be listening at port 8080, in which case you need to edit server.xml. You may not have a webapp installed at the home page. You should have posted the message you got.

Tomcat is not plug and play as distributed, and defintely less so than Apache, so you should be prepared to tear out your hair multiple times trying to understand the teminology of Tomcat property files, and the messages in the logs (see ~tomcat/logs).

the error at webpage is simply like this

Firefox can’t establish a connection to the server at localhost:8080.

apache configuration is:

===========================
DocumentRoot /srv/www/tomcat5/base/webapps/tomcat-docs/

Configure the DocumentRoot

<Directory “/srv/www/tomcat5/base/webapps/tomcat-docs”>
# 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
# core - Apache HTTP Server
# for more information.
Options None
# 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.
Order allow,deny
Allow from all
</Directory>

Aliases: aliases can be added as needed (with no limit). The format is

Alias fakename realname

Note that if you include a trailing / on fakename then the server will

require it to be present in the URL. So “/icons” isn’t aliased in this

example, only “/icons/”. If the fakename is slash-terminated, then the

realname must also be slash terminated, and if the fakename omits the

trailing slash, the realname must also omit it.

We include the /icons/ alias for FancyIndexed directory listings. If you

do not use FancyIndexing, you may comment this out.

Alias /icons/ “/usr/share/apache2/icons/”

<Directory “/usr/share/apache2/icons”>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias: This controls which directories contain server scripts.

ScriptAliases are essentially the same as Aliases, except that

documents in the realname 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/ “/srv/www/cgi-bin/”

“/srv/www/cgi-bin” should be changed to whatever your ScriptAliased

CGI directory exists, if you have that configured.

<Directory “/srv/www/cgi-bin”>
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>

UserDir: The name of the directory that is appended onto a user’s home

directory if a ~user request is received.

To disable it, simply remove userdir from the list of modules in APACHE_MODULES

in /etc/sysconfig/apache2.

<IfModule mod_userdir.c>
# Note that the name of the user directory (“public_html”) cannot simply be
# changed here, since it is a compile time setting. The apache package
# would have to be rebuilt. You could work around by deleting
# /usr/sbin/suexec, but then all scripts from the directories would be
# executed with the UID of the webserver.
UserDir public_html
# The actual configuration of the directory is in
# /etc/apache2/mod_userdir.conf.
Include /etc/apache2/mod_userdir.conf
# You can, however, change the ~ if you find it awkward, by mapping e.g.
# http://www.example.com/users/karl-heinz/ –> /home/karl-heinz/public_html/
#AliasMatch ^/users/([a-zA-Z0-9-_.])/?(.) /home/$1/public_html/$2
</IfModule>

Include all *.conf files from /etc/apache2/conf.d/.

This is mostly meant as a place for other RPM packages to drop in their

configuration snippet.

You can comment this out here if you want those bits include only in a

certain virtual host, but not here.

Include /etc/apache2/conf.d/*.conf

The manual… if it is installed (‘?’ means it won’t complain)

Include /etc/apache2/conf.d/apache2-manual?conf

DefaultType text/html

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/xml text/html text/css
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

<IfModule mod_jk.c>
Include /etc/apache2/virtual/dogverse.com/conf/jk.conf
</IfModule>

Help is needed!

I think you are confused. Tomcat is totally separate from Apache. It is a separate service. It is a fully functioning webserver. You have to start the tomcat service (/etc/init.d/tomcat6 start) to have something listening on port 8080. Assuming server.xml has the correct config.

Sometimes Apache and Tomcat are linked by having Apache forward requests to Tomcat. But that’s advanced configuration. You are nowhere there.

ok, let me try. i will let you know the result

Dear All,

Actually, the installation has been done and also i am getting normal output through

http://xx.xx.xx.xx:8080/

but when i try below link

http://xx.xx.xx.xx:8080/admin

or Manager link, i get the following error


HTTP Status 404 - /admin

type Status report

message /admin

description The requested resource (/admin) is not available.

Can any one further help me.

Regards,
Ghulam Yaseen

If you got up to http://x.x.x.x:8080/
then, tomcat is successfully running.
In the default installation, you should see the documentation on that page. Reade thos, you will get more info on the manager settings etc.

admin is just one of the apps that runs under tomcat. It’s in a separate RPM package I believe. One moment while I run zypper… ah there we are: tomcat6-admin-webapps is what you need to install.

yup, you are very right… i installed some of the packages and it is working fine now.
Just to have further idea, how can i run tomcat on default port 80 instead of port 8080.

Regards,
Ghulam Yaseen

You have to edit server.xml. But you also have to run the tomcat process as root and I don’t know how easy this is to arrange since the default is to run as tomcat. And obviously you have to give up running Apache on port 80 since only one of them can have it.

You can edit server.xml to run it on port and 80. But, then, you have to use init scripts to start and stop (included in the installation).

The other way, which allows you to continue running Apache is to use the JK connector to make Apache forward part of the URL space to tomcat.

Dear All,

I am talking with the point of view of Novel Certification…

iptables -t nat -I INPUT -p tcp --dport 8080 -j REDIRECT --to-port 80

This does enable me to view tomcat page @

http://localhost/

I need to know if this is acceptable by Novel if i do not use apache connector mod_jk and use iptables for this purpose.

Regards,
Ghulam Yaseen

I have absolutely no idea what the certification wants but I think that’s a perfectly acceptable solution to avoid running tomcat on port 80 and having to start it as root. However one problem with this solution is that you can’t run Apache on port 80, or rather, there is no way to reach Apache, since everything to port 80 has been redirected to tomcat.