Server Configuration - Mixpost

If you installed using the "As a standalone app" or "As a package in an existing Laravel app" method, it is necessary to install and configure other software on the server. These configurations are very important, please do not skip this step.

Requirements

Default public web root

If you installed Mixpost using the Standalone method you may instruct your web server(Nginx/Apache/Anything else) the default public web root.

You should set the default public web root to the "/public" folder of the Mixpost Standalone project.

An example of Nginx:

server {
    listen 80;
    root /var/www/your-mixpost-project/public;
    index index.php index.html;

	// your nginx configs
}

 

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.

You need to follow FFmpeg installation instructions on their official website.

After installation, depending on the operating system, you need to set the ffmpeg_path and ffprobe_path in the Mixpost config file. Default folder path: /usr/bin/. If FFmpeg is there, there is no need to change it.

If it is somewhere else, navigate to your Mixpost application and put this in your .env file

FFMPEG_PATH=/usr/bin/ffmpeg
FFPROBE_PATH=/usr/bin/ffprobe

Installing Redis

So that the posts can be scheduled, Mixpost puts them in the queue.

To be able to do this, you need to install Redis. Then, you will need to modify the values of the REDIS_* entries in the .env file to make sure they are aligned with your redis instance.

Installing & Configuring Supervisor

Installing Supervisor

You need to configure a process monitor. To install Supervisor on Ubuntu, you may use the following command:

sudo apt-get install supervisor

Configuring Supervisor

Supervisor configuration files are typically stored in the /etc/supervisor/conf.d.

Create the file mixpost-horizon.conf inside of conf.d folder and put this configuration content:

[program:mixpost_horizon]
process_name=%(program_name)s
command=php /path-to-your-project/artisan horizon
autostart=true
autorestart=true
user=your_user_name
stopwaitsecs=3600

Once the configuration file has been created, you may update the Supervisor configuration and start the processes using the following commands:

sudo supervisorctl reread
 
sudo supervisorctl update
 
sudo supervisorctl start mixpost_horizon:*

Cron

Add a cron that running the scheduler:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

Other things to consider

Some files that are uploaded, video for example, can be up to 200 mb, by default most web servers have configured a much smaller limit. You will need to check this.

In php.ini:

post_max_size = 200M
upload_max_filesize = 200M

Then, restart your PHP process. For php fpm, you can restart with:

sudo systemctl restart php8.1-fpm.service
sudo systemctl reload php8.1-fpm.service 

In nginx.conf:

http {
    client_max_body_size 200M;
}

Then, sudo systemctl restart nginx

For Apache, /etc/httpd/conf/httpd.conf.

LimitRequestBody 209715200

Then: sudo systemctl restart httpd