I am get issue with set WSGIPassAuthorization On directive in .htaccess.
any one can suggest how to add this variable to .htaccess ?
thank all so much.
You don't actually state what the specific error you get is when you try.
Has your Apache even been configured to allow use of .htaccess files?
Has your Apache even been configured to allow FileInfo overrides in .htaccess files?
AllowOverride FileInfo
Both would be required for WSGIPassAuthorization to work in a .htaccess file.
So please tell us what the error is you get in the browser and in the Apache error logs.
Indicate whether you have taken the steps above.
Related
Can some please clarify which of the following should be used for disabling directory browsing via htaccess?
Options -Indexes or Options All -Indexes
What is the difference between the two and in what instance should either be used?
Thank you.
Create a .htaccess file with the following:
Options -Indexes
Enabling directory browsing in Apache can be security issue - especially if used in production.
You can disable directory browsing by specifying Options -Indexes.
Note that it is better to do this in Apache configuration file / vhost files than in .htaccess.
I have difficulties making my .htacces work on my Ubuntu 14.04 LTS. I know it is a hidden file and all; I've searched everywhere and people seem to have the same problem. I've made a virtual host on my machine and all. Can someone please help me ?
ErrorDocument 404 /pages/error.php?code=404
ErrorDocument 403 /pages/error.php?code=403
You need to make sure the following things are true:
You need to check what DocumentRoot is set to. When an url beginning with a slash is detected, it will try to load that file relative to the document root. (docs) The file <documentroot>/pages/error.php must thus exist.
You need to make sure that .htaccess files are allowed by the main Apache configuration. The easiest way to test this is by entering garbage into your .htaccess file, saving it and reloading a page. You'll get an internal server error if Apache reads the .htaccess file. Otherwise the page loads as expected. To enable .htaccess files, the AllowOverride directive must allow something (see next bullet point). Additionally, check in httpd.conf if AccessFileName is set to something different than .htaccess. Change it as necessary, then RESTART APACHE. (docs)
For ErrorDocument, AllowOverride must be at least set to FileInfo. See the docs. Go to your main config file (httpd.conf), probably apache/Apachex.y.z/conf/httpd.conf. Search for the <Directory ...> block that corresponds to your http root, and look around if it contains an AllowOverride directive. Add FileInfo as one of the arguments, save the file and RESTART APACHE.
I have just created a new (test) symfony project and set my apache webroot to /home/user/project/ (not sure if it should be /home/user/project/web/?)
However, from what I understand based on the lightbulb section here: http://symfony.com/doc/current/book/page_creation.html#the-web-directory - there isn't any internal rerouting occurring. Therefore, this does not work:
http://localhost/random/10
but these do work:
http://localhost/app_dev.php/random/10
http://localhost/app.php/random/10
To double check, if I start the internal PHP server (php app/console server:start) then everything gets rerouted correctly - this does work:
http://localhost:8000/random/10
Am I right in thinking that I need to make changes to .htaccess? If so, is there a 'standard' section of code for using apache with symfony?
EDIT:
I have updated my apache2.conf (which for others would be httpd.conf if not on ubuntu as I understand it) as below:
<Directory /home/user/Project/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
If I remember correctly, .htaccess alredy defines DirectoryIndex as app.php. However, your Apache config file httpd.conf might be blocking the override.
Make sure that you have that line in your .htaccess and also check the value of AllowOverride (docs) within your httpd.conf. Try setting AllowOverride to All and see if that works.
I'm running the latest Apache Server on Linux Mint 14 and trying to take my first babysteps with vhosts, where I encountered a general problem with my setup:
every option I declare in the <Directory> section doesn't seem to have any effect on any subdirectories - but as far as I know and according to the documentation it should.
For example: I'm trying to give permissions for .htaccess file by
<Directory /var/www/>
AllowOverride All
</Directory>
a .htaccess in /var/www would work properly, but e.g. a .htaccess in /var/www/test with contents "Deny from all" would take no effect.
Are there any options I have to set that I don't know of? This isn't my first apache setup so I'm kind of confused right now, but I can't find a solution.
Thank you in advance!
Got it, apache2.conf includes external vhost settings, so the default settings in sites-available/default kept overwriting mine.
I run a hosting service for student at my our faculty. We run PHP with suPHP and for security we need symlinks to be set to "SymLinksIfOwnerMatch".
This has the very unfortunate error that if people have htaccess "Options FollowSymLinks" or "Options None" they will receive an internal server error.
This is a huge problem since most dristributions of OSS-software for PHP has this included in their htaccess by default (Wordpress, Drupal, Joomla and many others), and most guides in htaccess-rules always recommend "FollowSymLinks" since it's needed for mod_rewrite - it does work just as well with SymLinksIfOwnerMatch.
Does anyone have this same issue, and do anyone know how to conquer it? I was hoping to make Apache ignore Options completely. Our default ones are completely sufficient.
You want to set AllowOverride in your main config file.
If you want to turn off all use of .htaccess set
AllowOverride None
If you just want to prevent students from using Options then this should do it:
AllowOVerride AuthConfig FileInfo Indexes Limit