Skip to main content

Server configuration

info

If you are installing Mixpost with Docker, the instructions on this page are not necessary.

If you’re installing Mixpost manually or integrating it into an existing Laravel app, make sure your server is ready to host it. Install the necessary software and configure it properly for optimal performance.

Requirements

Softwares

PHP extensions

  • php-curl
  • php-mysql
  • php-bcmath
  • php-gd
  • php-mbstring
  • php-redis
  • php-xml
  • php-zip
  • php-intl

These extensions are version-specific for PHP, so if you have PHP 8.2.x installed you would run:

sudo apt install php8.3-curl php8.3-mysql php8.3-bcmath php8.3-gd php8.3-mbstring php8.3-redis php8.3-xml php8.3-zip php8.3-intl

In Plesk, you can install or upgrade PHP via "Tools & Settings -> Plesk -> Updates"

Enabling Specific PHP Functions

In PHP, certain functions are disabled by default for security reasons. To utilize these functions, you need to modify the disable_functions directive in the php.ini file. This guide will walk you through enabling the pcntl_signal and pcntl_alarm functions, which are commonly disabled.

Example before editing:

disable_functions = pcntl_alarm, pcntl_signal, exec, shell_exec

Example after editing:

disable_functions = exec, shell_exec

Installing Redis

If you have already installed Redis, you can skip this.

The following example is for Ubuntu:

sudo apt update
sudo apt install redis-server

Installing Supervisor

If you have already installed Supervisor, you can skip this.

The following example is for Ubuntu:

sudo apt update
sudo apt install supervisor

Installing FFmpeg

Mixpost has the ability to generate images from video while uploading a video file. This would not be possible without FFmpeg installed on your server.

The following example is for Ubuntu:

sudo apt update
sudo apt install ffmpeg

HEIC/HEIF Support Installation Guide

Mixpost uses libvips to convert HEIC/HEIF photos (commonly produced by iPhones and iPads) to JPEG.

Ubuntu/Debian

sudo add-apt-repository ppa:strukturag/libheif
sudo apt update
sudo apt install libvips42t64 libheif1 libde265-0

PHP Configuration

Add the following to your php.ini to enable FFI, which is required by libvips:

[FFI]
ffi.enable = true
zend.max_allowed_stack_size = -1

After installing the dependencies and updating php.ini, restart your web server and PHP-FPM to apply the changes.

Configure Web Server Document Root

Configure the web server's document root to point directly to the public directory within your Mixpost installation folder.

Mixpost must be installed directly on a primary domain or a subdomain. Installation in a subdirectory is not supported and will result in operational issues. For clarity, here are some examples of correct and incorrect setups:

  • example.com/mixpost (Invalid)
  • localhost/mixpost (Invalid)
  • example.com (Valid)
  • mixpost.example.com (Valid)
  • mixpost.test (Valid)

Below are the configurations for Nginx and Apache web servers to set the document root correctly:

Nginx Configuration

server {
listen 80;
root /var/www/path-to-your-project/public;
index index.php index.html;
client_max_body_size 12M;

# Additional Nginx configuration goes here
}

Apache Configuration

<VirtualHost *:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/path-to-your-project/public"
ServerName yourdomain.com
ServerAlias www.yourdomain.com

<Directory "/var/www/path-to-your-project/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

# Additional Apache configuration goes here
</VirtualHost>

Plesk

Access your Plesk panel, navigate to Hosting settings and update the Document Root to point to the public folder.

Plesk Document root

Upload Maximum File Size Configuration

Large files are uploaded in chunks (default 10 MB), so your server only needs to handle the chunk size, not the full file. Upload limits are configurable via environment variables.

PHP Configuration

1. Edit php.ini

For Apache:
/etc/php/VERSION/apache2/php.ini

For PHP-FPM

/etc/php/VERSION/fpm/php.ini

Replace VERSION with your PHP version (e.g., 8.2, 8.3). Update the following settings:

post_max_size = 12M
upload_max_filesize = 10M

2. Restart PHP to apply changes

For PHP-FPM

sudo systemctl restart phpVERSION-fpm.service
sudo systemctl reload phpVERSION-fpm.service

For Apache

sudo systemctl restart apache2

Nginx Configuration

1. Edit nginx.conf Add the following inside the http block:

client_max_body_size 12M;

2. Restart Nginx

sudo systemctl restart nginx

Apache Configuration

1. Edit Apache configuration:

/etc/httpd/conf/httpd.conf

2. Add or modify the following line:

LimitRequestBody 12582912

3. Restart Apache

sudo systemctl restart httpd