Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
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.
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.
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.
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
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>
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.
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)
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.