LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-11-2006, 04:33 PM   #1
kinetik
Member
 
Registered: Dec 2005
Location: The most beautiful city in the world.
Distribution: Mostly RedHat. Also Suse, Ubuntu, PHLAK etc.
Posts: 149

Rep: Reputation: 15
Need help with Apache rewrite


Hi all


It's me again, the guy that needs help constantly and consistently...


I have a URL:
http://server/abc/def/ghij/kinetik_w..._ENX_HTML.htm/

that must be accessible as:
http://server/abc/def/ghij/kinetik_w..._ENX_HTML.htm/


I've tried adding this into my httpd.conf:
RewriteEngine On
RewriteRule ^/abc/def/ghij/kinetik_web_test/(.*)$ /abc/def/ghij/kinetik_web_test/hs.xsl/$1 [L]

The result? It does not work!


I got this in my httpd.conf as well right at the bottom:

Alias /static/ "/kinetik/ftppub/upl/"

<Directory "/kinetik/ftppub/upl/">
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
FileETag MTime Size
</Directory>


The redirect-bit was added after the above.


I have no .htaccess files anywhere.


Please can someone help me with this?
 
Old 05-11-2006, 08:09 PM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Quote:
It's me again, the guy that needs help constantly and consistently...
We don't mind as long as you come back and pass the answers along to others when you can

mod_rewrite... geez it's been a while since I've played with this :/ How is it not working? The rewrite just not seeming to happen at all, a 500 server error or the rewrite is working but the regex isn't quite right?
 
Old 05-12-2006, 08:43 AM   #3
kinetik
Member
 
Registered: Dec 2005
Location: The most beautiful city in the world.
Distribution: Mostly RedHat. Also Suse, Ubuntu, PHLAK etc.
Posts: 149

Original Poster
Rep: Reputation: 15
That's what I am struggling with.

When I try to access the page from another PC, I get a page that says "ACCESS RESTRICTED BY IP". I think this is like a standard errorpage though, since even if I type in a URL that doesn't exist on my Apache Server it still just brings up this message.

One of the other guys told me he tried to access the page from the server itself and there it seems to work just fine.

I'm starting to think the problem is somewhere else...
 
Old 05-12-2006, 05:40 PM   #4
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Quite possibly, keep checking your logs over and over, they always contain helpful information. One of my favourite debugging tools is 'tail -f /var/log/<some_log>' open in a window while I experiment
 
Old 05-12-2006, 06:58 PM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by kinetik
I have a URL:
http:_//server/abc/def/ghij/kinetik_web_test/hs.xsl/123_ENX_HTML.htm/

that must be accessible as:

http:_//server/abc/def/ghij/kinetik_web_test/123_ENX_HTML.htm/
I put in some bogus underscores in the URL's above so the forum software doesn't url-ize them to where you can't easily see them in their entirety.

Did you try doing this OUTSIDE of Apache? Something like this:
Code:
cd (whatever_directory)/kinetik_web_test
ln -s ./hs.xsl/123_ENX_HTML.htm 123_ENX_HTML.htm
I haven't messed with mod_rewrite for a while, and I can't remember the syntax off the top of my head.

Also, look at your error_log file and see what the specific problem is. This will probably give you more detailed info than that browser "RESTRICTED BY IP ADDRESS" error message. I never really checked, but I didn't think Apache gave details in its return codes about why you were restricted. The fact that you were restricted, yes, but why?, no. I could be wrong about this, so don't quote me. Could it be that your browser is embellishing the message sent by Apache and mangling it in the process? error_log would point this out.
 
Old 05-13-2006, 01:21 AM   #6
kinetik
Member
 
Registered: Dec 2005
Location: The most beautiful city in the world.
Distribution: Mostly RedHat. Also Suse, Ubuntu, PHLAK etc.
Posts: 149

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by cs-cam
Quite possibly, keep checking your logs over and over, they always contain helpful information. One of my favourite debugging tools is 'tail -f /var/log/<some_log>' open in a window while I experiment

Thanks cs-cam, the tail-thing is really good advice.



heartig, the thing is the server has Websphere running as well. It gets really confusing since it seems even if the Apache-side is working 100%, Websphere might still have a big say in the whole delivery. I don't know much about Apache, but I know absolutely nothing about Websphere.

I'm guessing, but I think the Apache side of things is working just fine. My money is on Websphere not playing ball, but then again I could be wrong. I'm going to work through the logs of Apache just to be sure and get someone with Java savvy to check out the Websphere side of things.

Stay tuned as I'll post what the eventual solution was as soon as it's been figured out, and thanks for the help so far!
 
Old 05-19-2006, 06:02 AM   #7
kinetik
Member
 
Registered: Dec 2005
Location: The most beautiful city in the world.
Distribution: Mostly RedHat. Also Suse, Ubuntu, PHLAK etc.
Posts: 149

Original Poster
Rep: Reputation: 15
IT's SOLVED!!!

Finally, we got it to work! The problem was indeed with Websphere. It seems it plugs into Apache (httpd.conf references it).

The Websphere has a conf file of it's own (startup.conf) where you can set the IPs of clients. I just added a *.*.*.* and she worked lovely!


But now I have another problem: I can get through to http://server/abc/def/ghij/kinetik_w..._ENX_HTML.htm/
but now I get an error saying that there was no stylesheet to transform the XML file to HTML (or something like that).

How can I get the XML file to still reference the HS.xsl stylesheet without having to add "hs.xsl" in the URL?

UPDATE

Nevermind, it seems the person that wanted this just needed to see the xml data across the web, which is exactly what's happening now!

So, a big thanks to haertig and cs-cam.

Last edited by kinetik; 05-25-2006 at 10:23 AM.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2 Rewrite One Domain To Another thunder04 Linux - Software 10 04-19-2006 01:38 AM
Need help with Apache rewrite rules?? latino Programming 0 12-24-2004 02:09 AM
apache mod rewrite Robert0380 Linux - Software 5 07-31-2003 04:42 PM
Apache rewrite question CrazyToon Linux - Software 3 06-17-2003 02:00 PM
Apache Rewrite Not Working mikeyt_333 Linux - General 1 05-20-2003 05:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:44 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