Forum Moderators: coopster & phranque

Message Too Old, No Replies

[Apache] When compiling I get .so instead of .dll

Problem when compiling md_rewrite

         

GrodanBoll

11:19 am on Mar 7, 2002 (gmt 0)



Hi

I'm trying to compile mod_rewrite to a dll file.
The problem is when I compile the mod_rewrite.dsp in VisualStudio 6 or use the 'nmake' command to compile mod_rewrite.mak in DOS-mode I only get a mod_rewrite.so, I don't get a mod_rewrite.dll!?

So, what have I done wrong?

I need the dll to make the mod_rewrite to work in my Apache.
My Apache resides on my Win 2000 computer.

Pls, I need help...

/Grodan :)

gethan

11:57 am on Mar 7, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Grodan,

Welcome to WmW.

I've never compiled Apache for windows - but the so (shared object) file your seeing is the equivalent to a dll for Unix.

I guess you need to search the source code for ".so" and switch to dll. (sorry not too much help here).

On a side note - when I downloaded apache for NT it had all the mod_rewrite functionality already included .... might this not be an easier option?

Gethan

Brett_Tabke

11:59 am on Mar 7, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



(this won't answer your question, but is there a problem with the mod_rewrite dll that is included in the windows apache binary download?)

GrodanBoll

12:15 pm on Mar 7, 2002 (gmt 0)



Hi gethan and thx :)

Yepp, I did know that. But the problem is that I suck on C. I don't know where to change all the lines. Does anyone know this?

Yes that would be an easier option :)
From where did you download that version?

But I still want to now what I should do to make a dll-file.

/grodan

GrodanBoll

12:18 pm on Mar 7, 2002 (gmt 0)



Hi Brett_Tabke

I've downloaded a copy of Apache yesterday. When I search for dll:s I don't find that one.

Have I dowloaded the wrong file then?

Can you maybe provide a URL?

/Grodan

gethan

12:19 pm on Mar 7, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[httpd.apache.org...] - follow the win32 downloads.

[httpd.apache.org...] - compiling apache for windows.. erm looks fun. Good luck - let us know what you had to do to get it all going.

gethan

12:28 pm on Mar 7, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Funnily enough - I rooted around in my apache dir - and under modules there is a mod_rewrite.so ... no sign of a mod_rewrite.dll ... it may be that the documentation you are using is out of date?

GrodanBoll

12:34 pm on Mar 7, 2002 (gmt 0)



I have reinstalld the Apache now and I cant find any dlls exept for:
- ApacheCore.dll
- Win9xConHook.dll
- xmlparse.dll
- xmltok.dll

No sign of any other dlls?

When I read the documentations for adding new modules runtime, in *nix you have the.so-files but in windows you need .dll, just like when you install PHP.

The only way to get the .dlls is to compile the modules that I want.
I have tried to do this but I only get an .so-file.

/Grodan

justa

12:43 am on Mar 8, 2002 (gmt 0)

10+ Year Member



Have you tried to just take the comment off the line

#LoadModule rewrite_module modules/mod_rewrite.so

in the http.conf file?

also, remember to take the comment off the next bit as well
#AddModule mod_rewrite.c

I didn't think windows needs a .dll file to run a module though, I run module_ntlm modules/ntlm_module.so and it works fine for authentication on an NT box.

GrodanBoll

7:46 am on Mar 8, 2002 (gmt 0)



Hmmm... it seems like you are right...
When I didn´t take away the '#' infront of the two lines in httpd.conf I got this message in error.log: '[Fri Mar 08 08:16:36 2002] [alert] [client 127.0.0.1] c:/program files/apache group/apache/htdocs/.htaccess: Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration'.

When i took away the '#' i didn't. :)

I have then created a '.htaccess'-file and in this written:


RewriteEngine on
RewriteRule !\.(gif¦jpg¦png¦css)$ /index.html

I have cun and paste this example. It should redirect every file except for images to 'index.html'.

When I directly access a image it works, I can see the image. But when I'm trying to access any other file, nothin seems to happen... have I cerated the deadly loop that I have read about?

Maybe the path to 'index.html' is wrong?
I have installed the apache server in the path 'C:\Program Files\Apache Group\Apache\htdocs', I have put the '.htaccess'-file in the 'htdocs' -folder. In this folder I also keep the 'index.html'. Have I written the wrong path in the '.htaccess' -file?

Sorry for the beginner questions...

Hoping for more help
/Grodan :)

gethan

9:52 am on Mar 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Have you tried to just take the comment off the line

Darn - I wish I'd thought of that ;)

==
RewriteEngine on
RewriteRule !\.(gif¦jpg¦png¦css)$ /index.html

If the .htaccess file above is in your root directory then yep - you've made a condition that can never allow index.html to be viewed. It's the loop as you mention - after mod_rewrite has established that you don't want a .gif etc, it then reruns the rules for index.html and so on and on.

Try this snippet:

RewriteEngine on
RewriteRule index.html$ - [L]
RewriteRule !\.(jpg¦gif¦css)$ /index.html [L]

Also see - for loads more mod_rewrite fun..

[engelschall.com...]

(from the guy that wrote it).

[added] Make sure you replace the ¦'s and type them from your keyboard[/added]

GrodanBoll

10:06 am on Mar 8, 2002 (gmt 0)



Yiiiiiiiiha :)
Now it works just fine :D

Thx a bunch!

I don't really know whats the different is from your code and 'my' code.
But I will look further at Engelschall's website.

Again, you have saved my day. :D

/Grodan

Brett_Tabke

11:06 am on Mar 8, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Sorry for the momentary confusion there. I'd forgot they do .so instead of .dll.

Glad you got it working.