FollowSymLinks error "Not allowed here" - apache

I've been searching for 4 hours already but I can't seem to find a solution to our problem.
The problem we've encountered
We have a CentOS Linux 6.4 server, running Virtualmin 3.99.gpl. We have a Drupal website which we would like to move to this server, and as it's a multidomain site, we will have to use FollowSymLinks. This has (as I was told) been disabled as some security flaws were discovered addressing this directive. Since then you would have to use SymLinksIfOwnerMatch. Now, Drupal has a lot of .htaccess files hidden deep in the roots of this system, and as I'm not sure how this new method will be supported, I wanted to ask some experts their opinion to the solution my colleague proposed.
The Proposed solution
My colleague told me that it would probably work if I'd wrote a simple shell script to edit all the .htaccess files in the root folder of the domain, which would replace all the FollowSymlinks with the SymLinksIfOwnerMatch. As I'm not sure if this would fix this problem, I would like to ask your opinion on this.
What we've tried
We've tried to fix the configuration file from Apache to allow FollowSymLinks, but this did not work. Also we tried changing the global configuration in Webmin, but webmin ignored these edits (a fix for this would be great!). Deleting the line of the .htaccess in the root folder, fixes the problem, but this is not the solution we want to use.
Any other solutions, fixes or workarounds?

Just to come back at this, the proposed solution 'just works' in my case.

Related

What am I missing? [apache config]

A month ago I purchased a domain & hosting. Besides dabbling in some HTML for fun a few years ago, I didn't have any experience in all this "technical stuff". After a month of "doing my homework", I'm still trying to figure out a few things and I haven't had much luck searching SO or Google...
I've really only been using Filezilla & Notepad up til this point - I've been trying to keep it simple. Browsing my server, I couldn't seem to find the file "httpd.conf" or "php.ini" (among other files & dirs). I've been dabbling in .htaccess as an alternative but I've hit a roadblock since not all configs go in .htaccess files.
I made a phpinfo() script. Within that info, it shows "/etc/php5/cgi/php.ini" - yet this directory isn't shown in filezilla.
I know I must be missing something - how do I back up, access this directory & edit those configuration files?
Thank you so much for your help & deepest apologies if I've made you facepalm :P
-adraedin
If you just purchase hosting (as opposed to a virtual server), you will not usually have access to system-wide configuration files like php.ini or the global httpd configuration directories.
Instead, you can perform a limited subset of configuration through .htaccess files in your directories.
The reason you don't see the configuration directories is that your FTP access only shows you your own directory, neither those of other users on your server, nor the system-wide configuration or other software that might be running there.
Your php.ini file is extremely important. It is highly unrecommended to edit this file unless you know what you're doing. The most likely reason you can't see it is because it is outside of your "privilege zone" (meaning its hidden by your hosting company). This is typically done so that you don't mess with other accounts and domains using the same server.
If you need a change something within the httpd.config or php.ini file, and you can't make the change in your .htaccess, usually you can contact your hosting company and they'll modify the file for you. It really just depends on what you're looking to change/modify/edit.
Most of the time, in regards to your hosting, you can only see your account/domain files. This keeps you restricted to a particular section of the hard drive so you don't start messing with other peoples files/configurations.

HTTP sources with h5ai appear empty in XBMC

I'm having some trouble adding a custom source to my XBMC set up. I've got an Apache2 server up and running that I use to stream movies to my computer and would like to include it as a source in XBMC. I'm no web server expert, but I managed to get h5ai style indexing on my server, which I'd like to keep. The problem is that when h5ai is enabled, XBMC can't locate any of the files. With h5ai disabled I have no issue browsing through my files.
The obvious solution is to keep h5ai off, but since I use my server outside of XBMC, I'd like to find a way to keep it on. I'm very new when it comes to web servers, so it's very possible I'm just doing something wrong. I merely followed the instructions of placing the _h5ai folder in my path and editing .htaccess. If anyone could shed some light on the issue (solution or simply an explanation) I would greatly appreciate it.
Additional info: I'm running XBMC 12.0. My server is a rented seedbox, so I have no root privileges.
Easiest solution is making a subdirectory specifically for XBMC and adding a .htaccess file that keeps h5ai indexing out of it:
DirectoryIndex index.html
Then have the HTTP source include the full path to said subdirectory.
I had the same issue and fixed it by removing "IndexOptions IconsAreLinks" from .htaccess

Zend Controller Name Case Sensitivity

I'm using the Zend Framework to develop an application on a linux host, and for some reason when I try to go to localhost/index it gives me what looks like a standard Apache 404 error. But when I go to localhost/Index it works. I can also go to localhost/admin and it will work with no problem. For some reason it seems that my index controller doesn't want to work. How can I make it to where localhost/index works?
My .htaccess file seems fine and has the correct rewrite rules in it.
I had a similar problem and tracked it back to Options MultiViews on Apache. If you're using a vhost, check there. If I recall, MultiViews will try to find other files with a similar name if the requested file is not found. If it's on, try disabling it and see what happens.

Requests to /favicon.ico consistently returns the Subversion favicon.ico but I can't find the configuration resulting in this

On one of my servers which is being used for some internal development spaces and the likes, are configured with Apache, Git, Subversion among other things. The VirtualHost configuration is nothing out of the ordinary and I thought I had full control and understanding of this server's configuration and how it runs. I guess I was wrong. I recently discovered that all requests, no matter what VirtualHost I try, return the Subversion favicon when accessing <vhost>.<domain>/favicon.ico. This puzzled me - and annoyed me a bit since I was convinced that I knew all about this server's configuration.
It doesn't seem to pose any problems but I'm annoyed that there is a configuration somewhere which does something I explicitly didn't ask for. So I've been trying to track down this configuration but so far with no luck.
The server is running Gentoo Linux, so I figured I was looking for a <Location> block somewhere in my Apache configuration. I've been going through all my VirtualHost definitions, all my module configurations and my Apache configuration. I've even gone so far as to grep for all <Location> and favicon entries in all of my /etc/ files. Still no luck.
I've run out of ideas as to how I'm going to hunt down this thing so I'm hoping for some help from you guys and girls.
Thank you for your time :)
Okay, I'm a bit wiser. It's a slow day at the office so I have some time to spend on this little detail :)
I now know where the favicon.ico is coming from - I think.
In my server's /var/www/localhost/htdocs/ is a favicon.ico which for some reason unknown to me is the Subversion logo. If I rename this file, all suddenly works and it correctly grabs the favicon I have placed for each VirtualHost.
That's nice but I'm still quite puzzled as to why that hosts favicon took precedence over the individual VirtualHosts favicon. I still can't seem to find any <Location> definitions in any of the VirtualHosts which could lead to this behaviour.

Updating Files on Apache

I'm having trouble with my Apache Web Server. I have a folder (htdocs\images) where I have a number of images already in place. I can browse them and see them on my web server (and access them via HTML). I added a new image in there today, and went to browse to it, and it can't be found. I double and triple checked the path and everything. I even restarted Apache and that didn't seem to help.
I'm really confused as to what's going on here. Anybody have any suggestions?
Thank you.
Edit I just turned on the ability for the images directory to be listed, browsed to it (http://127.0.0.1/images/) and I was able to see all the previous images that were in the folder, but not the new one.
Turn directory indexes on for htdocs\images, remove (or move out of the way) any index.* files, and point your browser at http://yoursite/images/
That should give you a full listing of files in that directory. If the file you're looking for isn't there, then Apache is looking at a different directory than you think it is. You'll have to search your httpd.conf for clues -- DocumentRoot, Alias, AliasMatch, Redirect, RedirectMatch, RewriteRule -- there are probably dozens of apache directives that could be causing the web server to get its documents from somewhere other than where you think it's looking.
make sure the caSE and spelling are 100% correct.
There is not magic in programming (some may disagree:), so look for silly errors. Wrong server? Case of your letters? Wrong extension?
There's a chance it could be due to the cookies stored on your device. I would delete all cookies to the website you're working on before you refresh again