As written in a previous article about the OpenSource image hosting scripts for your own server, Chevereto is probably the most popular of image hosting script.
It allows you to create a fancy yet simple image hosting website on your own server. Although their new release, the V3 is a commercial version, their previous 2.x series are still available on github and work like a charm.
Chevereto includes some interesting features such as:
– User accounts
– Drag N Drop upload
– Multi upload
– Custom short URLs
– Content manager to allow users to manage all the uploaded images
– Multi languages
and many more.
Definitely worth a try.!
And here is how to install Chevereto on your own server.
I assume you already have a Linux Apache MySQL PHP server. If this is not the case, please read my previous tutorial on how to install a LAMP server.
1) Clone the latest version using git, directly in your /var/www
cd /var/www git clone https://github.com/chevereto/Chevereto
If you don’t have git, simply run: (Still as root)
apt-get install git
and change the owner of the folder to the apache user:
chown -R www-data:www-data /var/www/Chevereto
2) Install the dependancies
– You will need php curl and php gd, in root, simply run:
apt-get install php5-curl php5-gd
– You will need the mod_rewrite
then restart apache service to update the configuration:
3) Configure chevereto with your MySQL database
If you don’t have a MySQL database, you can simply use PHPMyAdmin to create one.
To configure chevereto, you will need modify the includes/config.php file
Inside this master config file, you can set your language (EN, FR, etc…) but also your site name, private mode, storage folders and many more…
But most important for the first use will be the database configuration:
You will need to modify the lines:
* Database details (MySQL) */ $config['db_host'] = 'localhost'; // localhost is mostly the default on all ser$ $config['db_port'] = ''; // Some servers needs to indicate the port of the data$ $config['db_name'] = 'chevereto'; // Database must exists $config['db_user'] = 'root'; // Database user with access to the above database$ $config['db_pass'] = '';
with the information of your MySQL.
When done, simply save (CTRL +X).
4) Change the default string changeme to anything you want in includes/definitions.php
and change the string changeme in:
5) Go to http://YourIP/Chevereto/chevereto
If no problem, you should be able to upload your files right-away.
Next steps will be to create a virtualhost to:
1) Use SSL to connect to the service,
2) Make the URL more userfriendly, like pic.domain.tld
3) Increase the Max upload value (Default from PHP is 2mb)
What you will need:
1) Create a A redirection in your DNS server/registrar with pic.domain.tld to your IP
2) Have SSL certificate ready. If not you can read this tutorial. (Optional)
3) Create your virtualhost as following:
In /etc/apache2/sites-enabled/, create a file called chevereto (In root):
and paste the following content:
<VirtualHost *:80> ServerAdmin email@example.com ServerName pic.domain.tld Redirect / https://pic.domain.tld </VirtualHost> <IfModule mod_ssl.c> <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/ssl/certs/myblog.pem SSLCertificateKeyFile /etc/ssl/private/myblog.key ServerAdmin firstname.lastname@example.org ServerName pic.domain.tld DocumentRoot /var/www/Chevereto/chevereto <Directory /> Options FollowSymLinks AllowOverride All php_value memory_limit 20M php_value post_max_size 20M php_value upload_max_filesize 20M php_flag output_buffering off </Directory> <Directory /var/www/Chevereto/chevereto> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost> </IfModule>
Adapt the content (Servername, webmaster, SSL certificate and directory, and PHPvalue set at 20mb).
When done, save the file (CTRL+X then Yes) and reload apache: (In root)
You should now be all set and ready to use chevereto!
If you want to recommend some good image hosting script, please send me a mail or simply post a comment!