On many occasions, it is necessary to have a classified platform. Ideal if we have an SME and need the publication of some commercial requirements that essence is classified. in the light of this, Linux each time has many applications oriented to commercial productivity. In other words, there is an application that does this to you without much effort on our server. In this post, I will show you how to install Open Classifieds on Ubuntu 18.04.
Open Classifieds is the form name of Yclas. It is an application written using PHP language and requires a database manager that allows you to deploy a classified website for our company. One of the great advantages of Open Classifieds is that it is quite light and fast but this does not take away its power. Today the application is a reference in its area. On the other hand, it is open source which makes it possible for us to examine your source code for potential vulnerabilities.
So, let us install Open Classifieds on Ubuntu.
Install Open Classifieds on Ubuntu 18.04
We will now begin the installation process. For this, we require Apache web server, MariaDB and PHP. Then, we will download the Open Classifieds installer.
1.- Install Apache2 and PHP 7.2
Open Classifieds requires a web server to run. It is logical if we take into account that it is a web application. At the same time, we will have to install PHP for its running. We can do this with the following command:
:~$ sudo apt install apache2 php7.2 libapache2-mod-php7.2 php7.2-common php7.2-mysql php7.2-gmp php7.2-curl php7.2-intl php7.2-mbstring php7.2-xmlrpc php7.2-gd php7.2-soap php7.2-xml php7.2-cli php7.2-zip
At the end of the installation, it is necessary to modify some PHP configuration parameters. This to ensure that the application runs correctly.
:~$ sudo nano /etc/php/7.2/apache2/php.ini
In this file, you change the following parameters.
file_uploads = On allow_url_fopen = On short_open_tag = On memory_limit = 256M upload_max_filesize = 100M max_execution_time = 360
Note: You can use CTRL + W to find the lines quickly.
Next, press CTRL + O to save the changes and CTRL + X to close it.
Then, it is time to test PHP. To do it, create a new file on /var/www/html/
called test.php
and add the following.
:~$ sudo nano /var/www/html/test.php <?php phpinfo(); ?>
Finally, open the file using the web browser. http://your-server/test.php
So, PHP is working.
2.- Install MariaDB
MariaDB is a MySQL fork. Practically 100% compatible but with better community support and by Linux distributions today.
:~$ sudo apt install mariadb-server
Next, set the root password for MariaDB.
:~$ sudo mysql_secure_installation
However, not only the root password can be defined, but also other settings as you can see in the image.
Now you have to create the user and the database dedicated to Open Classifieds. To do this we must enter the MariaDB console.
:~$ sudo mysql -u root -p > CREATE DATABASE openclassifieds; > GRANT ALL PRIVILEGES ON openclassifieds.* TO 'openuser'@'localhost' IDENTIFIED BY 'openpss'; > FLUSH PRIVILEGES; exit;
Now, we can install Open Classifieds.
3.- Install Open Classifieds (I)
Now, we can install the free version of the application. These features are enough for most users.
:~$ cd /tmp/ :~$ wget https://github.com/yclas/yclas/archive/master.zip
Then, decompress it. And move it to the Apache folder.
:~$ sudo apt install unzip -y :~$ unzip master.zip :~$ sudo mv yclas-master /var/www/html/yclas
After that, you have to set the right permissions to the application.
:~$ sudo chown -R www-data:www-data /var/www/html/yclas/ :~$ sudo chmod -R 755 /var/www/html/yclas/
Now, we need to create a new virtual host for Open Classifieds.
:~$ sudo nano /etc/apache2/sites-available/yclas.conf
And add the following:
<VirtualHost> ServerAdmin [email protected] DocumentRoot /var/www/html/yclas ServerName your-domain.com ServerAlias www.your-domain.com <Directory /var/www/html/yclas/> Options FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Do not forget to replace “your-domain” with yours. Then, save the changes and close the file.
After that, enable the new virtualhost, the Apache rewrite module and restart the Apache service.
:~$ sudo a2ensite yclas :~$ sudo a2enmod rewrite :~$ sudo systemctl restart apache2
Now, complete the installation using the web interface.
4.- Install Open Classified using the web interface (II)
Open your web browser and go to your server to complete the installation. First, the installer will check for the requirements.
Then, type the MariaDB credentials.
Now, configure the site.
At the end of the installation, you will be able to visit the site and log in.
So, you can check your new site.
So, enjoy it.
Conclusion
Open Classifieds is a great tool aimed at providing solutions to companies of many sizes. However, the installation is not complicated at all and we can take advantage of the application to deploy our classified page quickly and easily.
Please share this post with your friends.