Apache2 – mod_fcgid: HTTP request length exceeds MaxRequestLen

Few days ago I found a very good Open Source project for sharing and synchronization (Dropbox alternative) called Pydio. Heard before for this project, but I have never tried to install it before. I tried the demo and decided to install Pydio on my own server and check this little bit more. Installation procedure went smoothly and in 5 minutes I had my sharing web site ready to use.

But, when I tried to upload multiple files, all of them larger than 3Mb, browser simply returned:

Then I checked Apache2 log, and here is what I found:

It seams that MaxRequestLen directive of mod_fccgid is too low. To fix this, you need to update few options in your php.ini file. Search for upload_max_filesize which puts limit on any single file, default value should be set to this:

change this value to whatever you want, but I strongly suggest you to set >50M. Then search for post_max_size, default value is:

this is the size of the entire body of the request, which could include multiple files. Set this value at lest 2-3x as upload_max_filesize. Continue reading Apache2 – mod_fcgid: HTTP request length exceeds MaxRequestLen

Virtual hosts overlap on 443, the first has precedence

Apache2 LogoToday I got strange error on my production server when I tried to enable SSL on three domains. Since I use ISPConfig as hosting control panel I assumed it will work without problems. But I was wrong. I did little bit of research on this topic, and I found a simple solution.

If you look at /etc/apache2/ports.conf file, you will see:

This way Apache knows which virtual host to serve based on the different host names. And it works fine for *:80 port. But, for 443 port it’s disabled, so you need to update ports.conf as follows to make it work:

Make sure to restart Apache and it will work fine.

I hope this tip will save you some time.

Resources

More about Apache2 virtual hosts you can learn here. Other useful links I found while I was looking for solution:

Apache error: _default_ virtualhost overlap on port 443
Virtual hosts overlap on 443, first has precedence
VirtualHost Overlap on Port 443

 

 

Deploy your Laravel 4 application on Heroku

Heroku is a popular PaaS that allows you to deploy your application’s in no time. But, learning how to do that can be confusing, especially for PHP developers. In this tutorial I’ll cover basic steps which will help you to deploy your Laravel 4 application on Heroku. First let’s download Laravel:

After that, enter in laravel directory:

and initialize new git repository:

Now, create .gitignore file and put everything you want to ignore from git tracking. You can use Laravel’s default .gitignore file, just remove composer.lock from it:

Continue reading Deploy your Laravel 4 application on Heroku

Install Elasticsearch on Laravel Homestead

Recently I started working on a Laravel project that requires integration with Elasticsearch search engine. I didn’t want to change super cool development environment that Taylor (creator of Laravel) so kindly provided to us, so I installed Elasticsearch on Homestead instead of creating a new Vagrant box specially for this project. Here is a little snippet that will help you if you want to use Elasticsearch in you Laravel application.

 

Continue reading Install Elasticsearch on Laravel Homestead