Install Chevereto on a CentOS 7 Linux VPS
Chevereto is an image hosting script that allows you to create your own image hosting website like the popular Tinypic and Photobucket. In this tutorial we will instal Chevareto on a CentOS 7 VPS with Apache, PHP and MariaDB.
Chevereto requires to have a web server, PHP 5.4 or newer and MySQL or MariaDB installed on your server.
Log in to your Centos VPS as user root and make sure that all packages are up to date
yum -y update
Now, we will install MariaDB
yum install mariadb-server mariadb
Start MariaDB and add it to automatically start on system start-up
systemctl start mariadb.service systemctl enable mariadb.service
Run the following command to secure your MariaDB server and set a new root passord
Chevereto needs a database, so log in to the MariaDB server with user root and create new database and user
mysql -u root -p MariaDB [(none)]> CREATE DATABASE chevereto; MariaDB [(none)]> GRANT ALL PRIVILEGES ON chevereto.* TO 'cheveretouser'@'localhost' IDENTIFIED BY 'PASSWORD'; MariaDB [(none)]> flush privileges; MariaDB [(none)]> \q;
Don’t forget to replace ‘PASSWORD’ with an actual password.
Now, we will install Apache web server
yum install httpd
Start the web server and enable it to start at boot
systemctl start httpd systemctl enable httpd
Install PHP and a few PHP extensions and modules
yum install php php-mysql php-dom php-gd php-mbstring php-common bc php-bcmath
Download the latest release of Chevereto to your server
Extract the downloaded archive to the document root directory on your server.
yum -y install unzip unzip master.zip mv Chevereto-master/chevereto /var/www/html/
Change the ownership
chown -R apache:apache /var/www/html/chevereto/
Open the configuration file enter your database details and set the admin password.
cd /var/www/html/chevereto/ vim includes/config.php $config['db_name'] = 'chevereto'; // Database must exists $config['db_user'] = 'cheveretouser'; // Database user with access to the above database name $config['db_pass'] = 'PASSWORD'; $config['admin_password'] = 'password';
Change ‘password’ with an actual strong password.
Open the ‘includes/definitions.php’ file and change the default CHV_CRYPT_SALT
vim includes/definitions.php define("__CHV_CRYPT_SALT__", "changeme");
You need to replace ‘changeme’ with a random string.
Now, we will set up Apache virtual hosting directive for your Chevereto website.
Create a ‘/etc/httpd/conf.d/vhosts.conf’ file with the following content
and create a ‘/etc/httpd/vhosts.d’ directory where we will put all our virtual hosts.
Create a virtual host for your Chevereto domain
vim /etc/httpd/vhosts.d/yourdomain.conf <VirtualHost YOUR_SERVER_IP:80> ServerAdmin firstname.lastname@example.org DocumentRoot "/var/www/html/chevereto" ServerName yourdomain.com ServerAlias www.yourdomain.com ErrorLog "/var/log/httpd/yourdomain.com-error_log" CustomLog "/var/log/httpd/yourdomain.com-access_log" combined <Directory "/var/www/html/chevereto/"> DirectoryIndex index.php Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost>
And restart Apache for the changes to take effect
systemctl restart httpd
That’s all. Now, you can access http://yourdomain.com and start uploading pictures on your server. You can manage all uploaded pictures at ttp://yourdomain.com/admin
Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.