LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-24-2017, 11:39 AM   #1
sweeny_here
LQ Newbie
 
Registered: Feb 2016
Posts: 21

Rep: Reputation: Disabled
Apache 2.4 Mod Speling


Hello - I am trying to implement mod_speling on Apache 2.4 running on RH v6.8 The idea so ignore case of the URL on the destination file system, by way of file names or directories.

There are multiple sites configured in the vhosts directory, each with it's own virtual hosts file. The spelling module has been enabled in the server config file /etc/httpd/conf/httpd.conf.

Inside one of the virtual host files the following has been added -

Code:
<Directory "${APACHE_DOCUMENT_ROOT}/publish">
        Options Indexes FollowSymLinks
        <IfModule mod_speling.c>
                CheckCaseOnly on
                CheckSpelling on
        </IfModule>
</Directory>
The server has been restared but the URL's are still case sensitive. Yes I know that all incoming URL's can be rewrote to lowercase but the problem is not all URL's in the configs are in lower case - hence the need for this module.

Any ideas would be much appreciated!

Theo

Last edited by sweeny_here; 02-27-2017 at 09:40 AM.
 
Old 02-24-2017, 12:06 PM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
What do you mean RH4? I hope that isn't Redhat 4...

Anyways it looks like you have set the CaseOnly before enabling the module, pretty sure you have your two lines the wrong way around, CheckSpelling needs to come first I believe.

also does speling appear in the output of
Code:
apachectl -M
 
Old 02-24-2017, 04:04 PM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Inside one of the virtual host files the following has been added -

<Directory "${APACHE_DOCUMENT_ROOT}/publish">
Options Indexes FollowSymLinks
<IfModule mod_speling.c>
CheckCaseOnly on
CheckSpelling on
</IfModule>
</Directory>

The server has been restared but the URL's are still case sensitive
Please note that using the above configuration mod_spelling is applied only to anything under /docroot/publish. If you want to apply it for the whole vhost, ditch the starting <Directory...> and the closing </Directory> tags

Regards
 
Old 02-27-2017, 06:47 AM   #4
sweeny_here
LQ Newbie
 
Registered: Feb 2016
Posts: 21

Original Poster
Rep: Reputation: Disabled
Hello - thanks for the replies.

I still can't get it to work.

Instead I pulled a Docker Apache and tried it there instead and it works as expected by enabling the module in the httpd.conf file and also adding the following lines to the same file.

Code:
<IfModule mod_speling.c>
                CheckCaseOnly on
                CheckSpelling on
</IfModule>
Any ideas?
 
Old 02-27-2017, 07:19 AM   #5
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
What distribution and version are you using? It could be a bug in the version of mod_speling
 
Old 02-27-2017, 08:05 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
No, I never got it to work, either. I'm not sure that it actually does work.

And in any case, it would be doomed to be very inefficient, if it did.

Eye theenk ewe halve two chick yuor spelin yourselff. (And fix your case-sensitive-name conflicts.)

Last edited by sundialsvcs; 02-27-2017 at 08:06 AM.
 
Old 02-27-2017, 09:39 AM   #7
sweeny_here
LQ Newbie
 
Registered: Feb 2016
Posts: 21

Original Poster
Rep: Reputation: Disabled
The distribution is - Red Hat Enterprise Linux Server release 6.8 (Santiago) and the server version is Apache/2.4.3 (Unix).
 
Old 02-27-2017, 11:40 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by sweeny_here View Post
Hello - thanks for the replies.

I still can't get it to work.

Instead I pulled a Docker Apache and tried it there instead and it works as expected by enabling the module in the httpd.conf file and also adding the following lines to the same file.

Code:
<IfModule mod_speling.c>
                CheckCaseOnly on
                CheckSpelling on
</IfModule>
Any ideas?
It should work!
Anyway, you can stick the above snippet into /etc/httpd/conf/httpd.conf, so it's available for the whole server including vhosts.
 
Old 02-27-2017, 01:55 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Quote:
Originally Posted by bathory View Post
It should work!
Anyway, you can stick the above snippet into /etc/httpd/conf/httpd.conf, so it's available for the whole server including vhosts.
I tried that, too. Didn't work. Put it in directories and locations ... didn't work. For me, at least, "the damned thing just didn't work."

Your Mileage May Vary.™
 
Old 02-28-2017, 12:56 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by sundialsvcs View Post
I tried that, too. Didn't work. Put it in directories and locations ... didn't work. For me, at least, "the damned thing just didn't work."

Your Mileage May Vary.™
Are you the same as OP?
Anyway it should work. To verify that apache reads the config, you could make a typo in the config and see if apache complains on restart, e.g. use:
Code:
 CheckCaseOnlyz on
 CheckSpelling on
Also note that while case sensitive works fine, spelling does not work very well.
It could fix errors with the file extension (e.g. htm instead hrml), but no errors in the filename (indx.htm instead of index.htm)
 
Old 02-28-2017, 03:45 AM   #11
sweeny_here
LQ Newbie
 
Registered: Feb 2016
Posts: 21

Original Poster
Rep: Reputation: Disabled
Yes Apache configtest picks up on

Code:
CheckCaseOnlyz on
I did some further digging around on Mod Speling and came across this forum - https://www.drupal.org/node/268561

It suggests that if Mod Rewrite is enabled alongside Mod Speling that there will be a conflict, resulting in Mod Speling not working.

Can anyone confirm if this is the case?
 
Old 02-28-2017, 03:55 AM   #12
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
They are definitely going to have issues working together, which takes presidency if they both see an action they can take with a url? What if you are redirecting something that doesn't exist to something that does, should mod_speling get involved? While technically you could get them to work together, you'd need to be very careful with the configuration else you will end out with a lot of ambiguous behavior.
 
Old 02-28-2017, 04:26 AM   #13
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
It suggests that if Mod Rewrite is enabled alongside Mod Speling that there will be a conflict, resulting in Mod Speling not working.

Can anyone confirm if this is the case?
I can verify that there is no conflict between mod_rewrite and mod_speling.
But as r3sistance pointed out above, you may get some unpredictable results, because mod_speling could change a URL that you want to handle through mod_rewrite and vice-versa.
 
Old 02-28-2017, 04:29 AM   #14
sweeny_here
LQ Newbie
 
Registered: Feb 2016
Posts: 21

Original Poster
Rep: Reputation: Disabled
Thanks for the advice r3sistance.

Is there anyway of setting a priority level to say that Mod Speling should run first - if no match found, then execute Mod Rewrite?
 
Old 02-28-2017, 05:52 AM   #15
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Is there anyway of setting a priority level to say that Mod Speling should run first - if no match found, then execute Mod Rewrite?
You cannot set a priority, that's why you may get unpredictable results.
Given a URL, both modules will examine it and see if they need to do something.
So the URL can be changed/not changed by mod_speling and after passing through mod_rewrite it can be changed/not changed again and so on. When one of the 2 modules stops changing the URL, the other one will make another pass and will stop too.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Its a README curse.. :) (speling mistaike) GTrax General 0 09-18-2010 08:39 AM
Use Of Mod Jk in Apache chnlinux Linux - Newbie 0 04-02-2008 01:53 AM
mod speling not working in apache2.2? lykwydchykyn Debian 1 08-15-2007 09:57 AM
Apache 1.3.xx mod's DaRk RuSs General 0 07-07-2004 09:49 PM
apache mod rewrite Robert0380 Linux - Software 5 07-31-2003 04:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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