<\/span><\/h2>\r\n\r\n\r\n\r\nYclas needs a web server to serve its content, and we will use Apache webserver which is one of the most popular web servers in the World.<\/p>\r\n\r\n\r\n\r\n
Apache webserver can be installed with the following command:<\/p>\r\n\r\n\r\n\r\n
apt-get install apache2<\/pre>\r\n\r\n\r\n\r\nOnce, the installation is complete you can check the status of the Apache service:<\/p>\r\n\r\n\r\n\r\n
systemctl status apache2<\/pre>\r\n\r\n\r\n\r\nYou should get the following output:<\/p>\r\n\r\n\r\n\r\n
\u25cf apache2.service - The Apache HTTP Server\r\nLoaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)\r\nActive: active (running)\r\nDocs: https:\/\/httpd.apache.org\/docs\/2.4\/\r\nMain PID: 1144 (apache2)\r\nTasks: 55 (limit: 2301)\r\nMemory: 8.9M\r\nCPU: 131ms\r\nCGroup: \/system.slice\/apache2.service\r\n\u251c\u25001144 \/usr\/sbin\/apache2 -k start\r\n\u251c\u25001146 \/usr\/sbin\/apache2 -k start\r\n\u2514\u25001147 \/usr\/sbin\/apache2 -k start<\/pre>\r\n\r\n\r\n\r\n<\/span>Step 3: Install PHP<\/span><\/h2>\r\n\r\n\r\n\r\nTo install PHP and the required PHP extensions required by Yclas, run the following command:<\/p>\r\n\r\n\r\n\r\n
apt-get install php php-gd php-cli php-mysql php-imagick php-zip php-soap php-curl php-mbstring php-common php-json php-opcache<\/pre>\r\n\r\n\r\n\r\nYclas uses the short tag \u2018short cut\u2019 syntax, so in order to enable the short_open_tag<\/code> directive in PHP, edit the php.ini configuration file and modify the following line:<\/p>\r\n\r\n\r\n\r\nnano \/etc\/php\/7.4\/apache2\/php.ini\r\n\r\nshort_open_tag = On<\/pre>\r\n\r\n\r\n\r\nRestart Apache for the changes to take effect.<\/p>\r\n\r\n\r\n\r\n
systemctl restart apache2<\/pre>\r\n\r\n\r\n\r\n<\/span>Step 4: Install MariaDB<\/span><\/h2>\r\n\r\n\r\n\r\nWe will use MariaDB as a database engine. Run the following command to install the latest MariaDB server from the official Debian 11 base repository :<\/p>\r\n\r\n\r\n\r\n
apt-get install mariadb-server<\/pre>\r\n\r\n\r\n\r\nTo verify if the MariaDB service is up and running, run the following command:<\/p>\r\n\r\n\r\n\r\n
systemctl status mariadb<\/pre>\r\n\r\n\r\n\r\nYou should receive the following output<\/p>\r\n\r\n\r\n\r\n
\u25cf mariadb.service - MariaDB 10.5.12 database server\r\nLoaded: loaded (\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: enabled)\r\nActive: active (running) since Wed 2022-02-16 15:24:54 EST; 2min 13s ago\r\nDocs: man:mariadbd(8)\r\nhttps:\/\/mariadb.com\/kb\/en\/library\/systemd\/\r\nProcess: 1860 ExecStartPre=\/usr\/bin\/install -m 755 -o mysql -g root -d \/var\/run\/mysqld (code=exited, status=0\/SUCCESS)\r\nProcess: 1861 ExecStartPre=\/bin\/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0\/SUCCESS)\r\nProcess: 1863 ExecStartPre=\/bin\/sh -c [ ! -e \/usr\/bin\/galera_recovery ] && VAR= || VAR=`cd \/usr\/bin\/..; \/usr\/bin\/galera_recovery`; [ $? -eq 0 ] && s>\r\nProcess: 1922 ExecStartPost=\/bin\/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0\/SUCCESS)\r\nProcess: 1924 ExecStartPost=\/etc\/mysql\/debian-start (code=exited, status=0\/SUCCESS)\r\nMain PID: 1910 (mariadbd)\r\nStatus: \"Taking your SQL requests now...\"\r\nTasks: 10 (limit: 2301)\r\nMemory: 80.9M\r\nCPU: 634ms\r\nCGroup: \/system.slice\/mariadb.service\r\n\u2514\u25001910 \/usr\/sbin\/mariadbd<\/pre>\r\n\r\n\r\n\r\nTo enable the MariaDB service to start on system reboot execute the following command:<\/p>\r\n\r\n\r\n\r\n
systemctl enable mariadb.service<\/pre>\r\n\r\n\r\n\r\nIf desired, you can further improve the security of your MariaDB server by running a command that will go through a few questions.<\/p>\r\n\r\n\r\n\r\n
$ mysql_secure_installation<\/pre>\r\n\r\n\r\n\r\nWe suggest answering every question with the character \u2018Y<\/strong>\u2019 for yes.<\/p>\r\n\r\n\r\n\r\n<\/span>Step 5: Create a Database for Open Classifieds<\/span><\/h2>\r\n\r\n\r\n\r\nCreate a MySQL database for the Yclas website:<\/p>\r\n\r\n\r\n\r\n
mysql -u root -p<\/pre>\r\n\r\n\r\n\r\nMariaDB [(none)]> CREATE DATABASE openclassifieds;\r\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON openclassifieds.* TO 'openclassifieds'@'localhost' IDENTIFIED BY 'Password';\r\nMariaDB [(none)]> FLUSH PRIVILEGES;\r\nMariaDB [(none)]> EXIT;<\/pre>\r\n\r\n\r\n\r\nDon\u2019t forget to replace \u2018Password\u2019 with an actual strong password.<\/p>\r\n\r\n\r\n\r\n
<\/span>Step 6: Download Open Classifieds<\/span><\/h2>\r\n\r\n\r\n\r\nDownload the latest stable release of the software to your server. At the time of writing this tutorial, the latest stable version of Yclas is 4.4.0.<\/p>\r\n\r\n\r\n\r\n
cd \/tmp\r\nwget https:\/\/github.com\/yclas\/yclas\/archive\/master.zip\r\n<\/pre>\r\n\r\n\r\n\r\nOnce it is downloaded, unpack the downloaded ZIP archive to the document root directory of your server:<\/p>\r\n\r\n\r\n\r\n
unzip master.zip -d \/var\/www\/html<\/pre>\r\n\r\n\r\n\r\nRename the directory to something simpler (this is optional, however, it makes it easier to type and memorize where your files are):<\/p>\r\n\r\n\r\n\r\n
cd \/var\/www\/html && mv yclas-master yclas<\/pre>\r\n\r\n\r\n\r\nSet the Apache user to be the owner of all Yclas files:<\/p>\r\n\r\n\r\n\r\n
chown -R www-data:www-data yclas<\/pre>\r\n\r\n\r\n\r\n