Solved

How can I configure TOMCAT web server

Posted on 2011-02-23
39
613 Views
Last Modified: 2012-05-11
Hello,

I need to know the configuration for TOMCAT webserver. We have installed SAP BOBJ KA and now we have to give the access to KA users. I have a SAP procedure to configure IIS and Apache web server. Those processes are processes are given below at point C and D. I would like to have similar process for TOMCAT webserver.

Thank you,
Shivaji

A. Access installed KA: Navigate to the folder where you installed the SAP Knowledge Acceleration, website package, and click on the index.htm file.
B. Create Access Point Create a link to the index.htm file from an existing website. or Create a standalone index.htm page. or Create a virtual directory on the web server.
C. Configure IIS
    1. Add a new virtual directory to the website and name it as required.
    2. Enter the path to the location where you installed SAP Knowledge Acceleration (**.msi).
    3. Set access permissions to the virtual directory (read and run required)
    4. Set the default start page of the directory to be index.htm
        For Example: SAP Knowledge Acceleration should now be accessible via the address      
        http://machinename/KA
D. Configure Apache Web Server
    1. Stop the Apache server
    2. Add the following into the httpd.conf file within the Apache/Conf directory:
        Alias /ka/ "C:/KA/"
       <Directory "C:/KA">
        Options Indexes FollowSymLinks
        </Directory>
    Note: The path in this example is C:/KA. Modify this path to point to the location where you  
    have installed SAP Knowledge Acceleration.
    3. Find the following line in the httpd.conf file: “DirectoryIndex index.htmldefault.html and
        change this to read “DirectoryIndex index.html”.
     4. Save changes and restart Apache.

0
Comment
Question by:shivaji_nimase
  • 20
  • 19
39 Comments
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
Have not used SAP BOBJ KA .

However -- those instructions look like 2 alternative Web servers.  You use either IIS or Apache as a Web server (and neither of them is Tomcat).

If you do mean you want Tomcat config info, is it connecting to IIS or Apache?  Or standalone?  You said "Tomcat webserver" and Tomcat can be a Web server, but the instructions above imply that you're doing something else.
0
 

Author Comment

by:shivaji_nimase
Comment Utility
Its standalone
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
What do you mean by "Its standalone"?
0
 

Author Comment

by:shivaji_nimase
Comment Utility
In my case Tomcat is the webserver. I am not connecting it to IIS or Apache. My instructions in original question were a example for IIS and Apache web server. I do not have instructions for Tomcat webserver. I am looking for similar instructions for Tomcat web server
0
 
LVL 26

Accepted Solution

by:
mrcoffee365 earned 400 total points
Comment Utility
Okay.  I don't have SAP BOBJ KA  so there might be problems with this.

But going by the IIS and Apache directions, you have a set of pages in a KA location on your file system.  You just need to point Tomcat there.

You could simply put the KA directory under Tomcat's home webapps directory, e.g.,
[tomcat home dir]/webapps/ROOT/[top level of KA]

If you have to leave the KA files in whatever location they're in, then you have to configure Tomcat to look in that directory rather than under [tomcat home dir].

Assuming Tomcat 6, you can do a simple addition of a location with the following lines added to the [tomcat home]/conf/server.xml within the <Engine> tag.

<!-- =====   Virtual Host SAPKA.com  ========================-->
<Host name="www.mysitesapka.com" appBase="C:/KA"
      unpackWARs="true" autoDeploy="true"
      xmlValidation="false" xmlNamespaceAware="false">

<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
      directory="logs"  prefix="SAPKA_access_log." suffix=".log"
      pattern="common" resolveHosts="false"/>

<Context path="/" docBase="C:/KA" debug="0" privileged="true" />

</Host>

Then start tomcat.  You'll have to put in the right domain name -- I have www.mysitesapka.com as a placeholder -- and the right directory.

0
 

Author Comment

by:shivaji_nimase
Comment Utility
Hello,

We have tomcat 5.5. Are these instructions still applicable to 5.5? Thank you for your time and help.

Thanks,
Shivaji
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
Did you try it?
0
 

Assisted Solution

by:shivaji_nimase
shivaji_nimase earned 0 total points
Comment Utility
I did not and I cannot try it now as I am done with that assignment. I am going to accept your solution. Thank you for your help.
0
 

Author Closing Comment

by:shivaji_nimase
Comment Utility
I could not try this solution as I am done with that assignment. But I may try this in future.
0
 

Author Comment

by:shivaji_nimase
Comment Utility
Hello,

I tried this solution but it does not work. Below are the lines I added to server.xml and restarted the tomcat web server. When I go to "www.suwebbidevka.com" it does not work.

Thank you,
Shivaji

<!-- =====   Virtual Host SAPKA.com  ========================-->

      <Host name="www.suwebbidevka.com" appBase="C:/BusinessObjects/website/KA_Crystal_Reports/index.html"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
      <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
            directory="logs"  prefix="SAPKA_access_log." suffix=".log"
            pattern="common" resolveHosts="false"/>

      <Context path="/" docBase="C:/BusinessObjects/website/KA_Crystal_Reports/index.html" debug="0" privileged="true" />

      </Host>


-------------------

Even I tried with removing "/index.html" from the path but still does not work.
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
We need more info than "does not work."  What is the line in your access log for the access?  That will tell us the url you actually put in, and what the server response code was.

One problem is that you did not put in the correct docBase or appBase.  You should look at the Tomcat documentation to understand what you are configuring here.
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

Your initial question said that the physical top level directory for your app was C:/KA  , which is why I used that directory in my answer.  The docBase and appBase values are the top level directories for your web app.  They are not  the files themselves.  So if the top level directory of you webapp is really
C:/BusinessObjects/website/KA_Crystal_Reports
then that is what you should put for docbase and appbase.

It seems more likely that your top level directory is
C:/BusinessObjects/website
and the url would then be
http://www.suwebbidevka.com/KA_Crystal_Reports/index.html

but you'll have to look at your own webapp to determine the right values.

0
 

Author Comment

by:shivaji_nimase
Comment Utility
There is nothing in the access log. I can see the file SAPKA_access_log.2011-03-10 in log directory but that is empty.
Also when I type the URL it says Internet Explorer cannot display the webpage.
Please let me know if there are any more details which I can provide to troubleshoot the issue.
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
Did you make the change I explained to your appbase and docbase?  That is one step you could do.

Check all the access logs for the server.  Your requests must be going somewhere.
0
 

Author Comment

by:shivaji_nimase
Comment Utility
Yes, I did make the change to appbase and docbase.
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
And what happened?
0
 

Author Comment

by:shivaji_nimase
Comment Utility
Those changes were done before my previous message. So even after those changes IE cannot display the page.
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
Okay, then try to post more information.

1) find the access log for your Web server which contains the accesses you are trying to make.  Look at all of them, since you aren't finding the access in the log file you expect.  If that fails, then post the exact string that you have in your browser's location bar.  That won't give us the response code, but it will give us the full url.

or
1a) use Firefox, and get the LiveHttpHeaders plugin.  This is to try to deal with the fact that you can't find the access logs for your server.  LiveHttpHeaders will show you what your browser is sending to the server, and what the server is responding.  That will give us the response code, and the actual urls being received by the server.

2) Post the changed section of server.xml -- perhaps there are other errors.

3) Look in the various server logs for your server for other indications of what it is receiving and responding to.  Look in catalina.log, stdout.log, stderr.log -- anything which might help track down your problem.  

And always post more information.  The experts don't see what you've responded until everything gets emailed out.  The more information you put in your posts, the fewer times we have to wait for a round of posts and emails to get more information.
0
 

Author Comment

by:shivaji_nimase
Comment Utility
Here is the added section of server.xml file


<!-- =====   Virtual Host SAPKA.com  ========================-->

      <Host name="www.suwebbidevka.com" appBase="C:/BusinessObjects/website"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
      <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
            directory="logs"  prefix="SAPKA_access_log." suffix=".log"
            pattern="common" resolveHosts="false"/>

      <Context path="/" docBase="C:/BusinessObjects/website" debug="0" privileged="true" />

      </Host>

I have added the complete server.xml file and screenshot of error.


server.xml
shivaji-nimase-423124.flv
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
Okay, that's a different problem (in your video).  Your server is not available through DNS.  It's not the webapp or the pages, at least not yet.

Do you know for a fact that your domain name has been put in a DNS server or defined in some other way?

If you are working locally, on your own machine, then the way you test is to put the domain name in your Windows hosts file (on Unix, also the hosts file, but in a different location).  For example, in the C:\WINDOWS\system32\drivers\etc\hosts file, you would add a line like this:
127.0.0.1 www.suwebbidevka.com

Have you ever been able to reach the domain name you defined for this webapp?  Have you ever been able to display any page from the server?

0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:shivaji_nimase
Comment Utility
I am working on the server directly. I have added the domain name in the hosts file as mentioned in your comment. I have restarted the server after this change. Still my server is not available through DNS. I was never able to reach the domain name I defined for this webapp.
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
You can't just access a domain name.  

The way the Internet works is that a domain name  is associated with an IP address.  DNS servers hold the full directories of the domain names and their associated IP addresses.  When you buy an IP address, and pay someone to assoicate your domain name with it, that makes it so that other users on the Internet can find your computer's IP address when your domain name is entered in the browser.

So, just because you put a domain name into a Tomcat configuration file does not mean that your browser knows that the domain name is associated with an IP address.

When you put the domain name with an IP address in your local hosts file, you are pretending to your computer that you have registered the domain name and associated it with an IP address.

What you put in your hosts file has to be correct for your machine in order for the fake-out to work.  So if your machine is known to itself as 127.0.0.1, then that will work.   Usually that is localhost, so it should be okay.  

However, after you get the domain either really registered or faked with the hosts file, you have to get the port number right.

If you look at the Tomcat documentation, it clearly states that it is going to pot 8080.  Unless you specify a port, on the Internet the default HTTP port (the one the browser uses) is 80.  So in your case,
http://www.suwebbidevka.com
does not exist.

http://www.suwebbidevka.com:8080
does exist.
0
 

Author Comment

by:shivaji_nimase
Comment Utility
Hello,

I was also thinking about the same thing. Thank you for the detailed explaination. That helps.
My server name should be suwebbidev and not suwebbidevka. I have made these changes. Now I get different error message as below:
---------------------------------------------------------------------------------------------------------------------------
The connection was reset
The connection to the server was reset while the page was loading.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
Try Again
---------------------------------------------------------------------------------------------------------------------------
I am attaching the screeshot as well.

Please let me know if you need any more information from my side.

Thank you,
Shivaji
shivaji-nimase-425592.flv
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
Now try putting the correct port number in.  So:
http://www.suwebbidev.com:8080/[put your webabb dir here]

That is assuming many things of course.  You have a domain name called suwebbidev.com .   suwebbidev.com is a domain name that points to your machine.  Port 8080 is open on your machine -- or you are running the browser on the same machine as Tomcat.

Is it possible that your company has a domain name called suwebbidev.com, and it already has a server for it?  And you are adding a set of files?  Is the suwebbidev.com on a different machine from the one you're working on?
0
 

Author Comment

by:shivaji_nimase
Comment Utility
My machine name is suwebbidev or (suwebbidev.southernute.com). domain name is southernute.com.

Here are the new entries from server.xml
---------------------------------------------------------------------------------------------------------------------------
<Host name="www.suwebbidev.southernute.com" appBase="C:/BusinessObjects/website"
      unpackWARs="true" autoDeploy="true"
      xmlValidation="false" xmlNamespaceAware="false">

<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
      directory="logs"  prefix="SAPKA_access_log." suffix=".log"
      pattern="common" resolveHosts="false"/>

<Context path="/" docBase="C:/BusinessObjects/website" debug="0" privileged="true" />

</Host>
---------------------------------------------------------------------------------------------------------------------------

Results of webpage are attached in the file.

Please let me know if you need more info.
 Screenshots-Tomcat.docx
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
Okay -- now things are getting somewhere.  If you look in your access log, you should see that there's a 404 for the url you put in.  If not, then there are still some configuration issues, so please check that.

When you get a 404, it means that the file does not exist at the path specified.  So there would have to be a file at
C:/BusinessObjects/website/KA_Crystal_Reports/index.HTML

My guess would be that you have a file named index.html .  Tomcat is case-sensitive, so even though Windows doesn't care, Tomcat does, and you have to get everything right, including case.
0
 

Author Comment

by:shivaji_nimase
Comment Utility
My file name is index.htm and I tired with that name but still no luck. When I tried this time there were no log messages. But my earlier try generated some log messages. I am attaching the log files. Please let me know if it gives any idea. jakarta-service-20110312.log
stdout.log
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
You need to post your access log.

Post the directory location of your file as well.
0
 

Author Comment

by:shivaji_nimase
Comment Utility
These logs are from logs directory under Tomcat55. Could you please let me know the location for access log?
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
When you put this line in your Host section of the server.xml file:

<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
      directory="logs"  prefix="SAPKA_access_log." suffix=".log"
      pattern="common" resolveHosts="false"/>

it defines the location of the access log.  Look there.
0
 

Author Comment

by:shivaji_nimase
Comment Utility
Earlier logs are from the same directory. Access log was not updated during last try. There are two lines in access log for earlier time. I am attaching the access log now.
There are three more access log files for earlier days. Those are empty. I am attaching one of them.
SAPKA-access-log.2011-03-12.log
SAPKA-access-log.2011-03-11.log
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
If you have entries in your SAPKA log file, then at that time your host declaration and IP address setup were successful.  You just put in the wrong path to a file -- hence the 404.

So you need to look at your server.xml and possibly your hosts file and make sure that they are working correctly.  You know that you have to bounce Tomcat every time you make a change to server.xml, right?
0
 

Author Comment

by:shivaji_nimase
Comment Utility
Yes, I am bouncing tomcat server after every change. I would take a look at server.xml file in detail. Thank you..
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
Remember:

1) the host name has to resolve either with a real DNS host name, or with the name you put in your hosts file
2) the port has to be 8080 if that is what  you have as the port in your server.xml file
3) you have to spell the path to your file and your file name correctly, including case.

I'm not sure where you are with your host name, but a legitimate url for your file should be something like:
http://www.suwebbidev.southernute.com:8080/KA_Crystal_Reports/index.htm
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
Are you aware that you can configure Tomcat to respond on port 80?  I don't know if you want the 8080 port or not.  

Why don't you post your entire server.xml again -- I think maybe the Connector is not configured correctly.
0
 

Author Comment

by:shivaji_nimase
Comment Utility
I am attaching the server.xml file.
server.xml
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
Well -- it's odd that you don't have the Connector configured, but I used your server.xml, created a test html file, and it all worked fine.

So the hosts file:
127.0.0.1 www.suwebbidev.southernute.com

and the directory structure has to match your server.xml, so the directory has to look like:
C:\BusinessObjects\website

and there has to be the following file for the urls you are posting to work:
C:\BusinessObjects\website\KA_Crystal_Reports\index.htm

The line in the SAPKA access log looks like this:
127.0.0.1 - - [14/Mar/2011:14:44:06 -0400] "GET /KA_Crystal_Reports/index.htm HTTP/1.1" 200 129

0
 

Author Comment

by:shivaji_nimase
Comment Utility
I would add the line in hosts file and check if it makes any difference. I would do that in couple of hours and let you know.
0
 

Author Comment

by:shivaji_nimase
Comment Utility
Thank you very much!!!

Finally I can see the webpage after adding that line in hosts file. I really appreciate your help. If there is a way then I would like to give you more points.
0
 
LVL 26

Expert Comment

by:mrcoffee365
Comment Utility
Congrats!  It has been a long haul.  

It's not always hard to set up a Web server, but sometimes when you want a few things done a little differently than the standard, then it takes more work.  Good luck!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now