Get Social

Error: mod_fcgid: HTTP request length 137536 (so far) exceeds MaxRequestLen (131072)

mod_fcgid: HTTP request length 137536 (so far) exceeds MaxRequestLen (131072)

After installing the panel ISPmanager Lite 5.126.2 with a trial license for 2 weeks (this is convenient, since during this time you can safely buy and activate the license), I ran into this error. In this case, php is configured in FastCGI mode .

When I try to start a web application, I get (in logs or in debug):

mod_fcgid: HTTP request length 132992 (so far) exceeds MaxRequestLen (131072), referer: http...

In the browser you can get a little informative message:

Error 500, Internal server error

Let’s return to the logs:

The 1st figure is always different and depends on the request from your application

The 2nd figure is 131072 – this is the default MaxRequestLen .

HTTP request request length 132992 (so far) exceeds MaxRequestLen (131072) indicates that your request has exceeded the default value

Hence decision will – increase this parameter.

Of course, you can insert it almost anywhere in the apache config file. It is possible in the settings of your host.

But best edit the configuration of the FastCGI module itself:

/etc/apache2/mods-available/fcgid.conf (if you have Debian, Ubuntu and their other derivatives)
/etc/httpd/conf.d/fcgid.conf (if you have CentOS, Fedora and the like)

To select the appropriate value for the MaxRequestLen parameter, look at your php.ini

upload_max_filesize = 2M

For this value, it is suitable: 2M = 2097152 bytes. Add it to your fcgid.conf file:

FcgidMaxRequestLen 2097152

After that restart apache:

apachectl restart

 

Templates for Yii2 on Vesta CP for backend and frontend versions.

So, I had problems with manual editing of configs in the Vesta CP (which it constantly rewrites, when something changes or is updated), I set out to make a more or less automated solution.

It did not work very nicely, because it is necessary that the backend and the frontend look in the same folder as the subfolders. This can not be achieved only by editing templates. This can be understood by looking at their syntax, which is handled by scripts, like v-add-web-domain.

There is code on github.

The templates and the script work, based on the fact that: the frontend is here -> /home/$USER/web/$DOMAIN/public_html/frontend/web backend is here -> /home/$USER/web/$DOMAIN/public_html/backend/web

Instruction

(1)
Add the “apache2” and “nginx” directories from the githab repository (mentioned above) to /usr/local/vesta/data/templates/web/ (in CentOS / RHEL, you may need to rename “apache2” to “httpd”). Add Yii2-cconf.sh script in any, you need a place on the server.

(2)
In the Vesta control panel, you can create both domains:
example.com
backend.example.com

After that, in Vesta CP you can edit the domain settings and set the templates:
Yii2-frontend for example.com and yii2-backend for backend.example.com

(3)
In the end, you can run the yii2-cconf.sh script with the command:
( cd your-some-directory/ )
bash ./yii2-cconf.sh vestacpuser example.com

How to change the address of the Vesta CP web interface to a subdomain

It is not always convenient for mail to be located at /webmail. But this configuration is in Vesta CP by default. While the developers of the panel have not done the same thing that we are going to do, this will have to be repeated with each new server installation.

So, let’s start:

1. Create a web domain in Vesta CP: mail.your-domain.com (it can be immediately configured on https using the new, built-in ability to generate ssl certificates – letsencrypt).

2. Delete the links to the roundcube and / or roundcube.inc in /etc/apache2 (in the sub-folders conf.d, sites-available, sites-enabled) and /etc/nginx (in the subfolder conf.d).

3. Edit Nginx configuration file (for simplicity, we use /home/admin – the standard user folder in vesta):

/home/admin/conf/web/nginx.conf
/home/admin/conf/web/snginx.conf

replace
root /home/admin/web/your-domain/public_html;
to
root /var/lib/roundcube;

4. Edit Apache configuration file:

/home/admin/conf/web/apache.conf
/home/admin/conf/web/sapache.conf

replace
DocumentRoot /home/admin/web/mail.nebulonis.com/public_html
to
DocumentRoot /var/lib/roundcube/

and add:

# Access to tinymce files
<Directory "/usr/share/tinymce/www/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

<Directory /var/lib/roundcube/>
    Options +FollowSymLinks
    # This is needed to parse /var/lib/roundcube/.htaccess. See its
    # content before setting AllowOverride to None.
    AllowOverride All
    order allow,deny
    allow from all
</Directory>

# Protecting basic directories:
<Directory /var/lib/roundcube/config>
    Options -FollowSymLinks
    AllowOverride None
</Directory>

<Directory /var/lib/roundcube/temp>
    Options -FollowSymLinks
    AllowOverride None
    Order allow,deny
    Deny from all
</Directory>

<Directory /var/lib/roundcube/logs>
    Options -FollowSymLinks
    AllowOverride None
    Order allow,deny
    Deny from all
</Directory>

5. Let’s check the syntax:
apachectl configtest
nginx -t

6. Restart:
apachectl graceful
service nginx restart

7. And, finally, in the panel settings (https://your-ip-or-address:8083/edit/server/) SERVER -> CONFIGURE In the tab MAIL -> Webmail URL change to new (https://mail.your-domain.com)

Pages:12