Skip to content

Installation

Chewbaka edited this page May 31, 2022 · 15 revisions

Installation Docker

Using Docker

cd /home/chewbaka
git clone https://github.com/Chewbaka69/PlexShare.git plexshare
cd plexshare
docker-compose up -d plexshare

In the file docker-compose.yml you can update or comment the line to open the port.

Installation Manual

Get sources

su www-data -s /bin/bash
cd /var/www/
git clone https://github.com/Chewbaka69/PlexShare.git plexshare
cd plexshare
php composer.phar update

Conf Apache

Conf NginX

Source: https://fuelphp.com/docs/installation/instructions.html#/nginx

server {
    server_name plexshare.com; # replace by your domain name here

    # make sure Nginx can write to these files
    access_log /var/log/nginx/plexshare_access.log;
    error_log /var/log/nginx/plexshare_error.log;
    root /var/www/plexshare/public;
    # This is the default configuration that you can adapt it to your installation

    location / {
        index index.php;
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param FUEL_ENV "production";
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

Define environment variable to Production

Define the environment variable to Production can help you to hide some bugs or some errors.

Apache - Server Configuration

  1. Make sure your apache server configuration loads the extension mod_env
  2. Edit the httpd.conf file (or if you include virtual host configurations the desired virtual host config file) and add the following code.
// run this application in production mode
SetEnv FUEL_ENV production

Apache - User Configuration

  1. Make sure your apache server configuration loads the extension mod_env
  2. Create an .htaccess file in the /public directory of your application
  3. Edit the .htaccess file and add the following code.
// run this application in production mode
SetEnv FUEL_ENV production

Note that enabling .htaccess will slow Apache down considerably. If possible, use a server configuration and disable the use of .htaccess!

Nginx

Edit the desired file in /etc/nginx/sites-available and add the following code.

# run this application in production mode
location ~ \.php$ {
    fastcgi_param FUEL_ENV production;
}

DataBase

You need to create a database, its user and its password.

Ex: Database: plexshare
User: plexshare
password: erahsxelp

Crontab

You need to add some cron to the app work correctly:

crontab -u www-data -e

add this:

*/2  *  *  *  * php /var/www/plex/oil refine server:ping
*/5  *  *  *  * php /var/www/plex/oil refine server:browseServers
0    *  *  *  * php /var/www/plex/oil refine server:checkNotFound

Configuration of the application

You need to go to this URL: http://yourdomain/install

And now you have just to follow the step.