<\/span><\/h2>\nOpen Classifieds needs a web server to serve its content, so for this purpose we will install and use Apache web server which is the one of the most popular web servers in the World. To install Apache on your server, run the following command:<\/p>\n
apt -y install apache2<\/pre>\nOnce the installation is completed, start the web server and enable it to automatically start after a server reboot:<\/p>\n
apt start apache2\r\napt enable apache2<\/pre>\nTo verify that the web server is properly installed and running on your server, you can check its status with this:<\/p>\n
systemctl status apache2<\/pre>\nThe output will look like this:<\/p>\n
apache2.service - The Apache HTTP Server\r\n Loaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)\r\n Drop-In: \/lib\/systemd\/system\/apache2.service.d\r\n \u00e2\u00e2apache2-systemd.conf\r\n Active: active (running) since Sat 2019-06-08 09:50:55 CDT; 46min ago\r\n Process: 735 ExecStart=\/usr\/sbin\/apachectl start (code=exited, status=0\/SUCCESS)\r\n Main PID: 867 (apache2)\r\n Tasks: 6 (limit: 2321)\r\n CGroup: \/system.slice\/apache2.service\r\n \u00e2\u00e2867 \/usr\/sbin\/apache2 -k start\r\n \u00e2\u00e2882 \/usr\/sbin\/apache2 -k start\r\n \u00e2\u00e2883 \/usr\/sbin\/apache2 -k start\r\n<\/pre>\n<\/span>Step 2: Install PHP<\/strong><\/span><\/h2>\nNow that Apache is set up, we need to install PHP 7.2 (the default PHP version that comes with Ubuntu 18.04’s default repositories) as well as some PHP extensions required by Open Classifieds:<\/p>\n
apt install php7.2 php7.2-gd libapache2-mod-php7.2 php7.2-cli php7.2-common php7.2-gd php7.2-json php7.2-opcache<\/pre>\nWe also have to install the ‘Mcrypt’ PHP extension, but it cannot be installed with the apt package manager, so we will have to install it with ‘pecl’:<\/p>\n
apt-get install libmcrypt-dev php-dev gcc autoconf make pkg-config libc-dev\r\npecl install mcrypt-1.0.1\r\necho \"extension=mcrypt.so\" | sudo tee -a \/etc\/php\/7.2\/apache2\/conf.d\/mcrypt.ini<\/pre>\nOpen Classifieds uses the short tag \u2018short cut\u2019 syntax, so in order to enable short_open_tag directive in PHP, edit the php.ini configuration file and add\/modify the following line:<\/p>\n
nano \/etc\/php\/7.2\/apache2\/php.ini\r\n\r\nshort_open_tag = On<\/pre>\nRestart Apache for the changes to take effect.<\/p>\n
systemctl restart apache2<\/pre>\n<\/span>Step 3: Install and Configure MySQL Server<\/strong><\/span><\/h2>\nOpen Classifieds uses an empty database to store its information, so we will install and use the MySQL database server.<\/p>\n
apt -y install mysql-server<\/pre>\nOnce it is installed, start the database server and enable it to automatically start upon a reboot<\/p>\n
apt start mysql\r\napt enable mysql<\/pre>\nTo strengthen the security of the MySQL database server and set a password for the MySQL root user, you can run the \u2018mysql_secure_installation\u2019 post installation script. Run the script anduse the following options:<\/p>\n
mysql_secure_installation\r\nRemove anonymous users? (Press y|Y for Yes, any other key for No) : Y\r\nDisallow root login remotely? (Press y|Y for Yes, any other key for No) : Y\r\nRemove test database and access to it? (Press y|Y for Yes, any other key for No) : Y\r\nReload privilege tables now? (Press y|Y for Yes, any other key for No) : Y<\/pre>\n<\/span>Step 4: Create MySQL Database and User<\/strong><\/span><\/h2>\nLogin to the MySQL server command line interface as the root user and create a new MySQL database for Open Classifieds. From there, you will also need to assign a MySQL user to it with full permissions:<\/p>\n
mysql -u root -p\r\n\r\nmysql> CREATE DATABASE classifiedsdb;\r\nmysql> GRANT ALL PRIVILEGES ON classifiedsdb.* TO 'classifieds'@'localhost' IDENTIFIED BY 'PASSWORD<\/span>' WITH GRANT OPTION;\r\nmysql> FLUSH PRIVILEGES;\r\nmysql> quit<\/pre>\nDon’t forget to replace ‘PASSWORD<\/span>‘ with an actual, strong password.<\/p>\n<\/span>Step 5: Download Open Classifieds<\/strong><\/span><\/h2>\nGo to Open Classifieds’s official website and download the latest stable release of the software to your server. Once it is downloaded, unpack the downloaded ZIP archive to the document root directory of your server<\/p>\n
unzip openclassifieds2.x.x.x.zip -d \/var\/www\/html<\/pre>\nRename the directory to something simpler (this is optional, however it makes it easier to type and memorize where your files are):<\/p>\n
cd \/var\/www\/html && mv openclassifieds2.x.x.x openclassifieds<\/pre>\nSet the Apache user to be the owner of all Open Classifieds files:<\/p>\n
chown -R www-data:www-data openclassifieds<\/pre>\n<\/span>Step 6: Create an Apache Virtual Host<\/strong><\/span><\/h2>\nIn order to be able to access Open Classifieds with your domain name, we have to create Apache virtual host directive for the specific domain. We will use ‘domain.com<\/span>‘ as an example domain for the purposes of this tutorial, so make sure to change it to your unique domain name. Create a configuration file with the following content:<\/p>\nnano \/etc\/apache2\/sites-available\/openclassifieds.conf\r\n\r\n<VirtualHost *:80>\r\nServerAdmin admin@domain.com<\/span>\r\nDocumentRoot \/var\/www\/html\/openclassifieds\/\r\nServerName domain.com<\/span>\r\nServerAlias www.domain.com<\/span>\r\n\r\nOptions FollowSymLinks\r\nAllowOverride All\r\n\r\nErrorLog \/var\/log\/apache2\/domain.com<\/span>-error_log\r\nCustomLog \/var\/log\/apache2\/domain.com<\/span>-access_log common\r\n<\/VirtualHost><\/pre>\nSave the file and run the following command to enable to enable the newly created Apache virtual host:<\/p>\n
a2ensite openclassifieds.conf<\/pre>\nRestart the web server for the changes to take effect.<\/p>\n
systemctl restart apache2<\/pre>\n<\/span>Step 7: Complete the Open Classifieds Installation<\/strong><\/span><\/h2>\nIf you closely followed the steps in this tutorial, all necessary components for running Open Classifieds are installed and configured on your server. Now, open your favorite web browser and navigate to http:\/\/domain.com<\/code>. From there, follow the on-screen instructions to complete the installation. First, the installation wizard will check if your server meets all the requirements. From here, click the \u2018Start installation\u2019 button and follow the steps.<\/p>\n <\/p>\n
Once the installation is completed, it is recommended to remove the ‘install’ directory for security reasons.<\/p>\n
rm -rf install\/<\/pre>\nThat’s all there is to it – Open Classifieds is now installed and fully functional on your Ubuntu 18.04 VPS. For more details on how to use this platform, please check their official documentation.<\/p>\n
\n Of course you don\u2019t have to do any of this if you use one of our Ubuntu VPS Hosting services, in which case you can simply ask our expert Linux admins to install Open Classifieds for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n
PS.<\/strong><\/span> 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.<\/p>\n","protected":false},"excerpt":{"rendered":"In this tutorial we will guide you through the steps of installing Open Classifieds on an Ubuntu 18.04 VPS with … <\/p>\n
Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":31207,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,1698],"tags":[1805,59],"yoast_head":"\nHow to Install Open Classifieds on Ubuntu 18.04 - RoseHosting<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n\t \n\t \n\t \n