Skip to content
Alexis Tan edited this page Jul 1, 2021 · 1 revision

Frequently Asked Questions

Going to the login page returns a 404 not found

If you're using a clean installation of Apache the rewrite module is most likely not enabled, to allow Apache to rewrite URLs you should first enable the module.

a2enmod rewrite

Next, open the /etc/apache2/apache2.conf file and scroll down until you see the default security model settings, they should be somewhere around line 150 - 170, then make sure the security model for the /var/www/ directory is set to allow overrides, you can see an example of what it should look like below.

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

After everything has been set up you'll need to restart Apache before the changes take effect, but first, make sure your config isn't broken, you can test to see if the config is setup correctly by running:

sudo apachectl configtest

If everything looks good you can then restart Apache.

sudo systemctl restart apache2

Can't upload files larger than 2 MB

By default, PHP allows a maximum file upload of 2 MB. The limit exists for security and efficiency purposes as it prevents users from flooding your site with unnecessarily large media files, however, that doesn't make a lot of sense when hosting a media server, to change the maximum PHP upload size you should edit the php.ini file, you can find that file in your PHP installation directory matching your current version, to see your current PHP version you can run php -v, open:

/etc/php/<your-php-version>/apache2/php.ini

Once the file is opened you'll need to edit three different values.

upload_max_filesize
By default this is set to 2M, you can change this to support any file size you want.

post_max_size
By default this is set to 8M, you should change this to a value that's higher than your set upload_max_filesize value.

memory_limit
By default this is set to 128M, this should be fine in most cases, but if your post_max_size is set to a value higher than 128M you should change this to be above your post_max_size value, just keep in mind that you should keep the memory limit below the amount of total RAM the machine hosting the media server has to prevent PHP crashing when attempting to upload files larger than the amount of RAM the server has.

Discord doesn't embed file preview

If you're uploading video files to the media server and want them to be embedded into services like Discord you'll need to serve the files directly, luckily this is made easy by telling the media server that it should serve file previews directly instead of through the framework, this can be done by running the command below at the root of the project.

php artisan storage:link