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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
04-27-2006, 10:51 AM
|
#61
|
Member
Registered: Apr 2006
Posts: 170
Original Poster
Rep:
|
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
|
|
|
04-27-2006, 11:34 AM
|
#62
|
Member
Registered: Apr 2006
Posts: 170
Original Poster
Rep:
|
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.
?
|
|
|
04-27-2006, 12:00 PM
|
#63
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
Quote:
Originally Posted by thisObject
|
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...
|
|
|
04-27-2006, 12:30 PM
|
#64
|
Member
Registered: Apr 2006
Posts: 170
Original Poster
Rep:
|
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.
|
|
|
04-27-2006, 12:37 PM
|
#65
|
Member
Registered: Apr 2006
Posts: 170
Original Poster
Rep:
|
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
|
|
|
04-27-2006, 01:07 PM
|
#66
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
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...
|
|
|
04-27-2006, 01:21 PM
|
#67
|
Member
Registered: Apr 2006
Posts: 170
Original Poster
Rep:
|
Cool,
I'll try it out today in the evening.
Thanks
|
|
|
04-27-2006, 10:32 PM
|
#68
|
Member
Registered: Apr 2006
Posts: 170
Original Poster
Rep:
|
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...
|
|
|
04-27-2006, 11:03 PM
|
#69
|
Member
Registered: Apr 2006
Posts: 170
Original Poster
Rep:
|
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.
|
|
|
04-28-2006, 01:06 AM
|
#70
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
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...
|
|
|
04-28-2006, 01:07 AM
|
#71
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
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...
|
|
|
04-28-2006, 02:09 AM
|
#72
|
Member
Registered: Apr 2006
Posts: 170
Original Poster
Rep:
|
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.
|
|
|
04-28-2006, 02:16 AM
|
#73
|
Member
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595
Rep:
|
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...
|
|
|
04-28-2006, 10:48 AM
|
#74
|
Member
Registered: Apr 2006
Posts: 170
Original Poster
Rep:
|
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
|
|
|
05-02-2006, 10:21 AM
|
#75
|
Member
Registered: Apr 2006
Posts: 170
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 03:39 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|