LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Need help with Apache rewrite (http://www.linuxquestions.org/questions/linux-general-1/need-help-with-apache-rewrite-443913/)

kinetik 05-11-2006 04:33 PM

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! :cry:


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?

cs-cam 05-11-2006 08:09 PM

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?

kinetik 05-12-2006 08:43 AM

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. :confused:

I'm starting to think the problem is somewhere else...

cs-cam 05-12-2006 05:40 PM

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 :)

haertig 05-12-2006 06:58 PM

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.

kinetik 05-13-2006 01:21 AM

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! :)

kinetik 05-19-2006 06:02 AM

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.


All times are GMT -5. The time now is 11:03 PM.