apache2

Django with mod_wsgi returns 403 error

六眼飞鱼酱① 提交于 2019-12-18 08:54:39
问题 I am trying to use Django with Apache (and mod_wsgi). With the default Django webserver everything was going well, but now I get 403 (access forbidden) error when trying to load the page. I searched previous posts here and read official docs but the solutions there weren't helpful. Here are the lines from my httpd.conf: WSGIScriptAlias / /home/karlis/django/apache/django.wsgi <Directory /home/karlis/django/apache> Order allow,deny Allow from all </Directory> Alias /media/ /home/karlis/django

For php flush - how to disable gzip for specific file?

萝らか妹 提交于 2019-12-18 07:40:40
问题 I have a ajax call to somefile.php . i want the php script to do a simple task and than send back data to the user, and only than do very time consuming tasks. so i need to flush the output after the first simple task. it doesn't work, probably because i have gzip enables. I definitely don't want to disable gzip across all the vhost, and also not in all the folder where somefile.php is. i just want to disable it for this specific file. is that possible? EDIT: this is what i've included in my

PHP cannot find MongoDB driver

放肆的年华 提交于 2019-12-18 07:22:32
问题 On my Ubuntu 12.04 installation I install PHP5 (5.5) from the ondej package. Everything works ok with the PHP, Apache and MySQL, I also successfully install Mongo daemom and Mongo client. But then PHP cannot locate the MongoDB driver in pear. I have followed all the steps explained in the documentation I have added the extension to the php.ini file in the CLI folder restarted the server updated everything and restart the server again. I have been stuck on this issue quite long time now. Where

PHP cannot find MongoDB driver

為{幸葍}努か 提交于 2019-12-18 07:22:05
问题 On my Ubuntu 12.04 installation I install PHP5 (5.5) from the ondej package. Everything works ok with the PHP, Apache and MySQL, I also successfully install Mongo daemom and Mongo client. But then PHP cannot locate the MongoDB driver in pear. I have followed all the steps explained in the documentation I have added the extension to the php.ini file in the CLI folder restarted the server updated everything and restart the server again. I have been stuck on this issue quite long time now. Where

Giving PHP write permission in Apache

∥☆過路亽.° 提交于 2019-12-18 04:17:37
问题 I'm relatively new to configuring Apache. I have a PHP script that writes a JSON file based on values retrieved from $_GET . <?php file_put_contents('State.json', "{ do: '" . $_GET['do'] . "' }"); echo "Success"; ?> I run that code by create an XHR request. Ally.xhr('/Cream/Foam?do=someCommand'); The page it returns says failed to open stream: Permission denied on line 3. <Directory "~/Dropbox/Web"> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all <

Apache2 Reverse Proxy to an end-point that requires BasicAuth but want to hide this from user

半城伤御伤魂 提交于 2019-12-17 21:53:50
问题 Basically my scenario is that I have an internal website that requires a SINGLE hard-coded username and password to access (and this can't be turned off, only changed). I am exposing this website through a reverse proxy for various reasons (hiding the port, simplifying url, simplifying NAT, etc). However, what I would like to do is be able to use Apache to handle the authentication so that: I don't have to give out single password to everyone I can have multiple usernames and passwords using

Multiple mod_wsgi apps on one virtual host directing to wrong app

给你一囗甜甜゛ 提交于 2019-12-17 21:46:24
问题 I'm trying to get two (or more) Django applications set up at subdirectories under the same domain, e.g.: http://example.com/site1/ http://example.com/site2/ I know that normally this works fine by setting up an apache virtualhost like this: <VirtualHost *:80> ... WSGIScriptAlias /site1 /path/to/site1.wsgi WSGIScriptAlias /site2 /path/to/site2.wsgi </VirtualHost> Now, I've verified that each site works individually. But when I try to run both side-by-side, apache sends me to whichever site

Site does not exist error for a2ensite

 ̄綄美尐妖づ 提交于 2019-12-17 21:39:18
问题 I have cmsplus.dev under /etc/apache2/sites-available with the following code, <VirtualHost *:80> ServerAdmin master@server.com ServerName www.cmsplus.dev ServerAlias cmsplus.dev DocumentRoot /var/www/cmsplus.dev/public LogLevel warn ErrorLog /var/www/cmsplus.dev/log/error.log CustomLog /var/www/cmsplus.dev/log/access.log combined </VirtualHost> Now when I use sudo /usr/sbin/a2ensite cmsplus.dev , I am getting the error, ERROR: Site cmsplus.dev does not exist! My webserver Apache/2.4.6

Zend Server Windows - Authorization header is not passed to PHP script

元气小坏坏 提交于 2019-12-17 21:32:06
问题 I have a PHP application which needs to perform HTTP Basic authentication independently of the containing Apache server. On linux machines, with php installed via apt-get php , I find that the Authorization header does not appear in $_SERVER , but is available via apache_request_headers() or getallheaders() . On a Windows development machine, with Zend Server 6.1.0 / PHP 5.4, I am unable to get the Authorization header value from inside PHP by any of the above methods. How can I get its value

How do you configure Apache/PHP to accept slashes in query strings?

痞子三分冷 提交于 2019-12-17 19:47:02
问题 I have two Apache servers running PHP. One accepts forward-slashes in the query string and passes it along to PHP in the expected way, for example: http://server/index.php?url=http://foo.bar works and in PHP this expression is true: $_REQUEST['url'] == "http://foo.bar" However, in the other Apache server, the same URL results in a 403 Forbidden error! Note that if the query string is properly URL-escaped (i.e. with %2F instead of forward-slash), then everything works. Clearly there's some