Apache .htaccess - DATA_PATH causes error - apache

I have a .htaccess with the following code:
SetEnv BASE_URL http://localhost:86/extranet/
SetEnv LOG_PATH C:\wamp\www\extranet\logs\
SetEnv SERVER_ROOT C:\wamp\www\
SetEnv SITE_ROOT C:\wamp\www\extranet\
SetEnv DATA_PATH C:\wamp\www\extranet\data\
The DATA_PATH causes this error in Apache
SetEnv takes 1-2 arguments, an environment variable name and optional value to pass to CGI., referer: http://localhost:86/
Please help. Thanks

The problem turned out to be more complex than previously thought. First because it was on Windows I used backslashes but this was wrong. Also I had <IfModule mod_#Rewrite.c> in the file as well. This was causing some conflicts so I removed those tags. The Rewrite still works without those tags.

Related

Why is my ProxyPass and uWSGI not connecting?

I am trying to get a python environment live for a Django project and it's fighting me. I have installed mod_proxy_uwsgi through EasyApache4 (mod_proxy was already on). I have added the following include in the Apache include editor under pre-virtual host (Versioned):
include /etc/apache2/conf.d/userdata/std/2_4/user/domain/proxy.conf
with the following content:
ProxyPreserveHost On
ProxyPass "/" "unix://localhost/var/run/swerth_django.sock"
ProxyPassReverse "/" "unix://localhost/var/run/swerth_django.sock"
I have used YUM installer to install uWSGI and run using a .ini file (command:uwsgi --ini php.ini) with the following content which is executing fine so far (no error messages):
[uwsgi]
chdir=/home/swerth/public_html/mysite
module=mysite.wsgi:application
env=DJANGO_SETTINGS_MODULE=mysite.settings
master=True
pidfile=/tmp/project-master.pid
socket=127.0.0.1:49152
processes=5
harakiri=20
post-buffering=1
max-requests=5000
vacuum=True
home=/home/swerth/public_html/Swerth.VirtualEnv
Despite all this, it's still not working. My Django project still isn't serving. I have a sneaky suspicion that there's something I don't understand about these systems and reverse proxying. Is there something I'm missing or messing up?
Ok, so turns out I was adding my Include function under the versioned part of the includes editor and it needed to be added under the global one because of how the includes editor adds the files to the main httpd.conf file (versioned wasn't being included into the main httpd.conf for some reason)

Error While trying to setup mod wsgi in windows apache

I installed mod_wsgi module in apache by copying it into the modules directory and then changing the httpd.conf file accordingly by adding LoadModule wsgi_module modules/mod_wsgi.so.
The directory block that I included is as follows:
WSGIScriptAlias /wsgi “C:/Django-1.5.1/wsgi/wsgi_handler.py”
<Directory “C:/Django-1.5.1/wsgi”>
AllowOverride None
Options None
Order deny,allow
Allow from all
</Directory>
However on starting apache I get the following error:
Syntax error on line 243 of C:/xampp/apache/conf/httpd.conf:
<Directory "\xe2\x80\x9cC:/Django-1.5.1/wsgi\xe2\x80\x9d"> path is invalid.
I do not understand why that garbage is being appended to the path.
What am I doing wrong here?
You likely are mixing 32 bit and 64 bit versions of Apache. Python and mod_wsgi. You must use all 32 bit or all 64 bit. Use binaries from:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi
Using the distribution of Apache they used to build mod_wsgi.

apache ssi include with file abc.inc fails (abc.html, abc.txt, abc.xxx, abc.INC works fine)

apache 2.2.15, +Includes in directory container and XBitHack Full
somefile.html has line <!-- #include file="abc.inc" -->
This include fails with "unable to include "abc.inc" in log
If I change the extension of the file (and the include statement) to virtually anything (e.g. abc.xxx, abc.txt, abc.html, even abc.Inc or abc.INC) everything works fine. ONLY abc.inc fails
I've looked for definitions of inc in mime.types, grep'ed everything in the httpd conf files/directories.
Not a huge problem but it's got me curious.
thanks

open_basedir restriction when parsing LESS files

I got a warning when parsing my "Twitter BootStrap" files and saving them on disk in my less-cache folder.
Warning: is_file(): open_basedir restriction in effect. File(/../../lib/bootstrap/less/reset.less.less) is not within the allowed path(s): (/var/www/vhosts/example.com/:/tmp/) in /var/www/vhosts/example.com/httpdocs/wp-content/modules/wp-less/lessc/lessc.inc.php on line 80
I'm using (for example) #import "../../lib/bootstrap/less/reset.less"; in the main file that I'm parsing.
The funky thing is, that the first stylesheet gets the extension two times: reset.less.less - the other ones not. Another thing that keeps me wondering, is why the heck there's a leading / in front of the files.
Some data about the environment and server:
PHP 5.3.3
Wordpress 3.4.2
The WP-LESS Plugin (yes, I commit to this repo), which uses the LESSc library - which throws the error from here.
php.ini
include_path = ".:..:"
upload_temp_dir _no value/not set_
open_basedir = "/var/www/vhosts/example.com/:/tmp/"
Thanks for any help in advance!

Configure EasyPHP to use CGI

I'm trying to modify my EasyPHP to run in CGI mode.
According to this link: http://www.easyvitools.com/phpserial/php_ser_reference.html
I have to add in this line:
LoadModule php5_module "C:/Program Files/EasyPHP 2.0b1/php5/php5apache2.dll" to httpd.conf
However, everytime I do that, EasyPHP gives me this error:
Error in Apache configuration file:
""apache.exe: syntax error on line 126
of ..../apache/conf/httpd.conf. API
module structure 'php5_module' in the
file C:..../php5/php5apache2.dll is
garbled - perhaps this is not an
APache module DSO?""
I've checked that the file php5apache2.dll exists and that it is correct in the config file. Does anybody know what could cause this problem or am I doing something wrong to change it to CGI mode instead of using the default APache handler?
I believe that you may need to re-read the instructions:
Comment this line:
#LoadModule php5_module "c:/Php/php5apache2.dll"
And add 2 new lines:
ScriptAlias /php/ "c:/php/"
Action application/x-httpd-php "/php/php-cgi.exe"
So it appears that the line you are adding actually needs to be commented out / removed. And you need to use these alternative directives in httpd.conf.