LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-27-2006, 11:51 AM   #61
thisObject
Member
 
Registered: Apr 2006
Posts: 170

Original Poster
Rep: Reputation: 30

Hello again,

I finally worked it all out with your help! Thanks.
I got it almost working.

At this point I can view jsp pages by accessing http://www.mydomain.net/WEB/AAA/index.jsp There are some css rendering problems but it's another question.

The main thing is that Apache got screwed up. In other words I cannot view html pages. For instance. http://www.mydomain.net/WEB/AAA/mypage.html
will not be displayed at all. I get the message "The page cannot be found". Also, if I simply hit http://www.mydomain.net it would nto display Apache start page but displays "thttpd - tiny/turbo/throttling HTTP server" and couple of icons such as "Powered by Fedora" and "thttpd". I hope you know what I am referring to.

Not sure what went wrong but I'd appreciate your suggestions.

Thanks
 
Old 04-27-2006, 12:34 PM   #62
thisObject
Member
 
Registered: Apr 2006
Posts: 170

Original Poster
Rep: Reputation: 30
actually this is what happens.
If I go to: http://www.mydomain.net it displays html page!
However, I start navigating to http://www.mydomain.net/WEB/AAA/index.html it would not display it and give me and error: "The page cannot be found..."
So, it cannot display html pages that are in tomcat folder.

?
 
Old 04-27-2006, 01:00 PM   #63
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
Quote:
Originally Posted by thisObject
actually this is what happens.
If I go to: http://www.mydomain.net it displays html page!
However, I start navigating to http://www.mydomain.net/WEB/AAA/index.html it would not display it and give me and error: "The page cannot be found..."
So, it cannot display html pages that are in tomcat folder.
Does index.html exist in the same place as index.jsp? Look in $(CATALINAHOME)/webapps/WEB/AAA. There should be index.html AND index.jsp.

Since you're using Apache as a front-end to Tomcat, you have to keep the HTML files and locations clearly identified and related to where the JSPs are located. It's not necessary to have the HTML and the JSPs in the same place.

Try this, code a "testjsp.html" page and put it in "DocumentRoot" (that location is in httpd.conf) and code the page like this:
Code:
<html><body><p>Click <a href="/WEB/AAA/index.jsp">here</a> to run a JSP script!</p></body></html>
Then point your browser at www.mydomain.net/testjsp.html and click the link and the JSP page should display.

Follow me?

Congrats on getting Apache connected to Tomcat.

Peace...
 
Old 04-27-2006, 01:30 PM   #64
thisObject
Member
 
Registered: Apr 2006
Posts: 170

Original Poster
Rep: Reputation: 30
Hello,

I actually already have an appdeveloped with folder structer. For example

/WEB/AAA/index.jsp there is a link on this page that points to
/WEB/AAA/BBB/index.jsp there is another link on this page that points to
/WEB/AAA/BBB/post.html

Navigation from /WEB/AAA/index.jsp to /WEB/AAA/BBB/index.jsp works fine but
from /WEB/AAA/BBB/index.jsp to /WEB/AAA/BBB/post.html I get an error message saying that this page does not exist but it does!

Also, I have css definition and it is broken (which is strange)
It looks to me that Tomcat serves only jsp pages and if there is an html page it uses Apache but regardless of that
in the page to post.html page I have http://www.mydomain.net/WEB/AAA/BBB/post.html. So why would not Apache serve this page?

I think there is something is wrong with apache.
 
Old 04-27-2006, 01:37 PM   #65
thisObject
Member
 
Registered: Apr 2006
Posts: 170

Original Poster
Rep: Reputation: 30
and not only css is broken but all images as well which means the path to css definition and images is wrong becuase of Tomcat and Apache configuration
 
Old 04-27-2006, 02:07 PM   #66
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
Quote:
Originally Posted by thisObject
Navigation from /WEB/AAA/index.jsp to /WEB/AAA/BBB/index.jsp works fine but
from /WEB/AAA/BBB/index.jsp to /WEB/AAA/BBB/post.html I get an error message saying that this page does not exist but it does!
It does from the perspective of Tomcat, but not from the perspective of Apache.

Quote:
Also, I have css definition and it is broken (which is strange)
It looks to me that Tomcat serves only jsp pages and if there is an html page it uses Apache but regardless of that
in the page to post.html page I have http://www.mydomain.net/WEB/AAA/BBB/post.html. So why would not Apache serve this page?

I think there is something is wrong with apache.
Nope, nothing is "wrong" but you need to get Apache configured the way you need it to be.

Now, if index.jsp is going to be the entrance to your site, you will have to "teach" Apache about your Tomcat directory structure OR simply run Tomcat standalone. By default, Tomcat listens on port 8080 but it can also listen on port 80, if instructed to do so.

Ok, so given your Tomcat directory structure above, you can create an alias in httpd.conf that will "map" "/WEB" to $(CATALINAHOME)/webapps/WEB. Read on the Apache Alias directive.

You should be able to create an alias like this:

Alias /WEB /path/to/tomcat/webapps/WEB

Then your http://www.mydomain.net/WEB/AAA/BBB/post.html link should work.

Lemme know how that goes.

Peace...
 
Old 04-27-2006, 02:21 PM   #67
thisObject
Member
 
Registered: Apr 2006
Posts: 170

Original Poster
Rep: Reputation: 30
Cool,

I'll try it out today in the evening.

Thanks
 
Old 04-27-2006, 11:32 PM   #68
thisObject
Member
 
Registered: Apr 2006
Posts: 170

Original Poster
Rep: Reputation: 30
Hello,
I created an alias just like you suggested.
Result: images are displayed and css works!
HTML pages work as well BUT only with FireFox. I tried EI and it does not work
Really weird...
 
Old 04-28-2006, 12:03 AM   #69
thisObject
Member
 
Registered: Apr 2006
Posts: 170

Original Poster
Rep: Reputation: 30
Also, I am not exactly sure how to point www.mydomain.net to WEB/AAA/index.jsp
Now it works like this: http://www.mydomain.net/WEB/AAA/index.jsp

I took a look at httpd.conf file and changed
DocumentRoot "/home/myLogin/public_html" to
DocumentRoot "/home/myLogin/pathToTomcat/webapps/WEB/AAA" but it did not work.
 
Old 04-28-2006, 02:06 AM   #70
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
Quote:
Originally Posted by thisObject
Also, I am not exactly sure how to point www.mydomain.net to WEB/AAA/index.jsp
Now it works like this: http://www.mydomain.net/WEB/AAA/index.jsp

I took a look at httpd.conf file and changed
DocumentRoot "/home/myLogin/public_html" to
DocumentRoot "/home/myLogin/pathToTomcat/webapps/WEB/AAA" but it did not work.
Ok, let's read the Apache doc and see if you can tell me why the above isn't working. Here is the doc for DocumentRoot.

I believe that change is correct but makes me question whether or not you should be running Tomcat standalone instead.

Anywho, let's now read the doc for DirectoryIndex.

Now, tell me what you must do to correct your problem.

Also, both of these are documented in httpd.conf. I suggest you print out a copy and leave it in your bathroom so you'll have something of interest to read.

By the way, I'm going out of town for the weekend so I won't be around until Monday night or Tuesday.

Have a great weekend and take care...

Peace...
 
Old 04-28-2006, 02:07 AM   #71
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
Quote:
Originally Posted by thisObject
Hello,
I created an alias just like you suggested.
Result: images are displayed and css works!
HTML pages work as well BUT only with FireFox. I tried EI and it does not work
Really weird...
I presume you mean IE.

Does the page not render correctly in IE or something or are you getting an error message of some kind? I'll leave the HTML rendering issues to you.

Peace...
 
Old 04-28-2006, 03:09 AM   #72
thisObject
Member
 
Registered: Apr 2006
Posts: 170

Original Poster
Rep: Reputation: 30
Thanks I'll have a look at it.
Yes I meant IE and there is no error or anything like that just a blank page.
Thanks for the links I just thought that I've done everything, well, aparently not.
Make sure you take your laptop with you so I can bug you some more

Have a great weekend.
 
Old 04-28-2006, 03:16 AM   #73
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
Quote:
Originally Posted by thisObject
Thanks I'll have a look at it.
Yes I meant IE and there is no error or anything like that just a blank page.
Strange, indeed.

Quote:
Thanks for the links I just thought that I've done everything, well, aparently not.
Well, what you'll need to do depends on what your requirements are and what kinds of functionality you're looking for.

Quote:
Make sure you take your laptop with you so I can bug you some more
Good thing I don't have one.

Peace...
 
Old 04-28-2006, 11:48 AM   #74
thisObject
Member
 
Registered: Apr 2006
Posts: 170

Original Poster
Rep: Reputation: 30
By the way where are you going?
Tahoe season is over so I can't think of any other place to go except probably for Yosemity but I bet it is still cold over there
 
Old 05-02-2006, 11:21 AM   #75
thisObject
Member
 
Registered: Apr 2006
Posts: 170

Original Poster
Rep: Reputation: 30
Hello again,

DirectoryIndex as I understand only determines which files are to be loaded by default.
such as if I have index.jsp there I can say www.myDomain.net without having have to say www.myDomain.net/index.jsp

DirectoryRoot seems to be the one I need. However, if I put path to my app there:
DirectoryRoot /home/myLogin/jakarta-tomcat.../webapps/WEB/AAA it does not do the trick.

I guess I am missing somthing out.

thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running jsps in user home directory doesn't work (Apache Tomcat and mod_userdir) jimieee Linux - Networking 0 03-23-2005 11:12 AM
how to get apache and tomcat work together chinaundead Programming 7 12-06-2004 11:33 PM
Tomcat 5.5.1 and Apache 2 kpmaddenuk Linux - Software 2 10-30-2004 06:55 AM
Why use Apache with Tomcat rather than just Tomcat itself? davee Linux - Software 1 08-21-2003 10:47 PM
Apache,Tomcat prowzen Linux - Software 0 05-09-2001 07:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:38 PM.

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