PictShare is a free and open-source image hosting web application that allows you to upload, share, view, and resize images. It is built in PHP and uses MySQL as a backend database. In this tutorial, we will learn how to install PictShare on Ubuntu Server Latest.
Before you start with the installation of PictShare, make sure you have the following prerequisites:
$ sudo mkdir /var/www/pictshare
$ cd /var/www/pictshare
wget
:$ sudo wget https://github.com/chrisiaut/pictshare/archive/v2.4.0.tar.gz
$ sudo tar -zxvf v2.4.0.tar.gz --strip 1
/var/www/pictshare
directory./var/www/pictshare
directory to the www-data
user and group:$ sudo chown -R www-data:www-data /var/www/pictshare
/var/www/pictshare
directory:$ sudo chmod -R 775 /var/www/pictshare
$ mysql -u root -p
mysql> CREATE DATABASE pictshare;
mysql> CREATE USER 'pictshare'@'localhost' IDENTIFIED BY 'password';
pictshare
database to the pictshare
user:mysql> GRANT ALL PRIVILEGES ON pictshare.* TO 'pictshare'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
config.php.example
file to config.php
:$ sudo cp config.php.example config.php
config.php
file sudo nano config.php
:// Enter the database details
define('DB_TYPE', 'mysql');
define('DB_HOST', 'localhost');
define('DB_NAME', 'pictshare');
define('DB_USER', 'pictshare');
define('DB_PASS', 'password');
//Enter your site url here
define('URL', 'http://example.com/pictshare');
// Set the email address for admin notifications
define('ADMIN_EMAIL', 'youremail@example.com');
// Uncomment and fill out the SMTP details if you want to use SMTP for sending emails
/*
define('SMTP_HOST', '');
define('SMTP_PORT', '');
define('SMTP_AUTH', true);
define('SMTP_SECURE', 'tls');
define('SMTP_USERNAME', '');
define('SMTP_PASSWORD', '');
*/
// Set the maximum upload file size in bytes
define('MAX_UPLOAD_SIZE', 50 * 1024 * 1024);
// Set the allowed file types
define('ALLOWED_EXTENSIONS', 'jpg,jpeg,gif,png,bmp');
Edit the necessary values to match your environment. Make sure to update the database details that you have set up in Step 3.
Save and exit the file.
$ sudo nano /etc/apache2/sites-available/pictshare.conf
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/pictshare
<Directory /var/www/pictshare>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache2/pictshare_error.log
CustomLog /var/log/apache2/pictshare_access.log combined
</VirtualHost>
$ sudo a2ensite pictshare.conf
$ sudo systemctl restart apache2
URL
constant in config.php
.Congratulations! You have successfully installed PictShare on Ubuntu Server Latest. You can now start uploading, sharing, and resizing your images.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!