.htaccess for cakephp

The answer is that there are 3 different .htaccess files: /var/www/app/webroot/.htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] </IfModule> /var/www/app/.htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule> /var/www/.htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule> It’s … Read more

ini_set(“memory_limit”) in PHP 5.3.3 is not working at all

Most likely your sushosin updated, which changed the default of suhosin.memory_limit from disabled to 0 (which won’t allow any updates to memory_limit). On Debian, change /etc/php5/conf.d/suhosin.ini ;suhosin.memory_limit = 0 to suhosin.memory_limit = 2G Or whichever value you are comfortable with. You can find the changelog of Sushosin at http://www.hardened-php.net/hphp/changelog.html, which says: Changed the way the … Read more

Need to allow encoded slashes on Apache

I kept coming across this post for another issue. Let me just explain real quick. I had the same style URL and was also trying to proxy it. Example: Proxy requests from /example/ to another server. /example/http:%2F%2Fwww.someurl.com/ Issue 1: Apache believes that’s an invalid url Solution: AllowEncodedSlashes On in httpd.conf Issue 2: Apache decodes the … Read more

413 Request Entity Too Large – File Upload Issue

Source: http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/ Edit the conf file of nginx: nano /etc/nginx/nginx.conf Add a line in the http, server or location section: client_max_body_size 100M; Doen’t use MB it will not work, only the M! Also do not forget to restart nginx systemctl restart nginx

Only variable references should be returned by reference – Codeigniter

Edit filename: core/Common.php, line number: 257 Before return $_config[0] =& $config; After $_config[0] =& $config; return $_config[0]; Update Added by NikiC In PHP assignment expressions always return the assigned value. So $_config[0] =& $config returns $config – but not the variable itself, but a copy of its value. And returning a reference to a temporary … Read more

multiple django sites with apache & mod_wsgi

Your ServerName/ServerAlias directives are wrong. ServerName should be hostname. You probably should just delete ServerAlias. Then just do the obvious and duplicate VirtualHost/Listen directives, just changing the port number and locations of scripts in the file system. Finally, do not set DocumentRoot to be where your Django code is as it makes it easier to … Read more

Authorization header missing in django rest_framework, is apache to blame?

If you are using Apache and mod_wsgi, then I found the easy solution to this in the official Django REST framework website Apache mod_wsgi specific configuration Note that if deploying to Apache using mod_wsgi, the authorization header is not passed through to a WSGI application by default, as it is assumed that authentication will be … Read more

Apache2 ProxyPass for Rails App Gitlab

I came across this gist that worked for me. In case it ever goes dead, I’ll repost it. unicorn config file Edit file /home/gitlab/gitlab/config/unicorn.rb Find line listen “#{app_dir}/tmp/sockets/gitlab.socket” and comment it. Uncomment line listen “” required modules for apache sudo a2enmod proxy sudo a2enmod proxy_balancer sudo a2enmod proxy_http sudo a2enmod rewrite /home/gitlab/gitlab/config/gitlab.conf <VirtualHost *:80> ServerName … Read more