How to install Pligg in Ubuntu

To install Pligg in Ubuntu

Pligg is a free CMS social publishing software in which an individual user can enter their websites and connect with other users. Installation of Pligg in Ubuntu is explained in this manual.

To install Pligg

Utilize the following command to update the system.

root@linuxhelp1:~# apt-get update 
Hit http://security.ubuntu.com wily-security InRelease
Hit http://in.archive.ubuntu.com wily InRelease
Hit http://in.archive.ubuntu.com wily-updates InRelease
Hit http://in.archive.ubuntu.com wily-backports InRelease
Hit http://security.ubuntu.com wily-security/main Sources
Hit http://in.archive.ubuntu.com wily/main Sources
Hit http://security.ubuntu.com wily-security/restricted Sources
Hit http://in.archive.ubuntu.com wily/restricted Sources
Hit http://security.ubuntu.com wily-security/universe Sources
.
.
.
Hit http://in.archive.ubuntu.com wily-backports/multiverse amd64 Packages
Hit http://in.archive.ubuntu.com wily-backports/main i386 Packages
Hit http://in.archive.ubuntu.com wily-backports/restricted i386 Packages
Hit http://in.archive.ubuntu.com wily-backports/universe i386 Packages
Hit http://in.archive.ubuntu.com wily-backports/multiverse i386 Packages
Hit http://in.archive.ubuntu.com wily-backports/main Translation-en
Hit http://in.archive.ubuntu.com wily-backports/multiverse Translation-en
Hit http://in.archive.ubuntu.com wily-backports/restricted Translation-en
Hit http://in.archive.ubuntu.com wily-backports/universe Translation-en
Reading package lists... Done


Then install the mariadb-server package by running the following command.

root@linuxhelp1:~# apt-get install mariadb-server -y 
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libreadline5 libterm-readkey-perl
mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common mariadb-server-10.0 mariadb-server-core-10.0 mysql-common
Suggested packages:
libmldbm-perl libnet-daemon-perl libsql-statement-perl libipc-sharedcache-perl mailx mariadb-test tinyca
The following NEW packages will be installed:
libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libreadline5 libterm-readkey-perl
mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common mariadb-server mariadb-server-10.0 mariadb-server-core-10.0
mysql-common
0 upgraded, 14 newly installed, 0 to remove and 255 not upgraded.
Need to get 13.5 MB of archives.
.
.
.
Setting up mariadb-server-core-10.0 (10.0.25-0ubuntu0.15.10.1) ...
Setting up mariadb-server-10.0 (10.0.25-0ubuntu0.15.10.1) ...
161007 5:57:17 [Note] /usr/sbin/mysqld (mysqld 10.0.25-MariaDB-0ubuntu0.15.10.1) starting as process 3089 ...
Setting up libdbd-mysql-perl (4.028-2) ...
Setting up libhtml-template-perl (2.95-2) ...
Setting up mariadb-server (10.0.25-0ubuntu0.15.10.1) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...


Run the following command to create a database and user for access the databases and that user should have the full access to the database.

root@linuxhelp1:~# mysql -u root -p 
Enter password:
Welcome to the MariaDB monitor. Commands end with   or g.
Your MariaDB connection id is 42
Server version: 10.0.25-MariaDB-0ubuntu0.15.10.1 (Ubuntu)

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type ' help '  or ' h'  for help. Type ' c'  to clear the current input statement.

MariaDB [(none)]>  create database pligg 
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]>  grant all privileges on pligg.* to ' user1' @' localhost'  identified by ' linuxc'  
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>  flush privileges 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>  exit
Bye


After creating the MariaDB, install the apache web server.

root@linuxhelp1:~# apt-get install apache2 -y 
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0
Suggested packages:
apache2-doc apache2-suexec-pristine apache2-suexec-custom
The following NEW packages will be installed:
apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0
0 upgraded, 9 newly installed, 0 to remove and 255 not upgraded.
Need to get 1,540 kB of archives.
After this operation, 6,435 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu/ wily/main libapr1 amd64 1.5.2-3 [86.0 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ wily/main libaprutil1 amd64 1.5.4-1 [78.3 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu/ wily/main libaprutil1-dbd-sqlite3 amd64 1.5.4-1 [10.7 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu/ wily/main libaprutil1-ldap amd64 1.5.4-1 [8,788 B]
Get:5 http://in.archive.ubuntu.com/ubuntu/ wily/main liblua5.1-0 amd64 5.1.5-8 [102 kB]
.
.
.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...
Processing triggers for ufw (0.34-2) ...


Run the following command to install the PHP and its module packages.

root@linuxhelp1:~# apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-mysql php5-gd -y 
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libmcrypt4 php5-cli php5-common php5-json php5-readline
Suggested packages:
php-pear libmcrypt-dev mcrypt php5-user-cache
The following NEW packages will be installed:
libapache2-mod-php5 libmcrypt4 php5 php5-cli php5-common php5-gd php5-json php5-mcrypt php5-mysql php5-readline
0 upgraded, 10 newly installed, 0 to remove and 255 not upgraded.
Need to get 5,214 kB of archives.
After this operation, 21.7 MB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu/ wily-updates/main php5-common amd64 5.6.11+dfsg-1ubuntu3.4 [481 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ wily/main php5-json amd64 1.3.7-1 [18.2 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu/ wily-updates/main php5-cli amd64 5.6.11+dfsg-1ubuntu3.4 [2,250 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu/ wily-updates/main libapache2-mod-php5 amd64 5.6.11+dfsg-1ubuntu3.4 [2,276 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu/ wily/universe libmcrypt4 amd64 2.5.8-3.3 [63.0 kB]
Get:6 http://in.archive.ubuntu.com/ubuntu/ wily-updates/main php5 all 5.6.11+dfsg-1ubuntu3.4 [1,302 B]
.
.
.
Creating config file /etc/php5/mods-available/mysql.ini with new version
php5_invoke: Enable module mysql for cli SAPI
php5_invoke: Enable module mysql for apache2 SAPI

Creating config file /etc/php5/mods-available/mysqli.ini with new version
php5_invoke: Enable module mysqli for cli SAPI
php5_invoke: Enable module mysqli for apache2 SAPI

Creating config file /etc/php5/mods-available/pdo_mysql.ini with new version
php5_invoke: Enable module pdo_mysql for cli SAPI
php5_invoke: Enable module pdo_mysql for apache2 SAPI
Setting up php5-readline (5.6.11+dfsg-1ubuntu3.4) ...

Creating config file /etc/php5/mods-available/readline.ini with new version
php5_invoke: Enable module readline for cli SAPI
php5_invoke: Enable module readline for apache2 SAPI
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for libapache2-mod-php5 (5.6.11+dfsg-1ubuntu3.4) ...


Download the Pligg software by using the following command.

root@linuxhelp1:~# cd /opt/
root@linuxhelp1:/opt# wget https://github.com/Pligg/pligg-cms/releases/download/2.0.2/2.0.2.zip 
--2016-10-07 06:02:39-- https://github-cloud.s3.amazonaws.com/releases/11161198/69de24e8-2897-11e4-82bb-a7c7f91a3d52.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256& X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20161007%2Fus-east-1%2Fs3%2Faws4_request& X-Amz-Date=20161007T003239Z& X-Amz-Expires=300& X-Amz-Signature=bd7c495b25be385deac7c7e544874343e5925862e928fc92d9b7445f843f5931& X-Amz-SignedHeaders=host& actor_id=0& response-content-disposition=attachment%3B%20filename%3D2.0.2.zip& response-content-type=application%2Foctet-stream
Resolving github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)... 52.216.1.48
Connecting to github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)|52.216.1.48|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2632865 (2.5M) [application/octet-stream]
Saving to: ‘ 2.0.2.zip’ 

2.0.2.zip 100%[============================================================> ] 2.51M 658KB/s in 4.6s

2016-10-07 06:02:45 (554 KB/s) - ‘ 2.0.2.zip’  saved [2632865/2632865]


Extract the downloaded package and move the package to the document root directory.

root@linuxhelp1:/opt# unzip 2.0.2.zip 
Archive: 2.0.2.zip
creating: pligg-cms-master/
inflating: pligg-cms-master/.gitattributes
inflating: pligg-cms-master/.gitignore
creating: pligg-cms-master/admin/
inflating: pligg-cms-master/admin/admin_backup.php
inflating: pligg-cms-master/admin/admin_categories.php
inflating: pligg-cms-master/admin/admin_comments.php
inflating: pligg-cms-master/admin/admin_config.php
inflating: pligg-cms-master/admin/admin_create_user.php
.
.
.
creating: pligg-cms-master/widgets/spam_trigger/templates/
extracting: pligg-cms-master/widgets/spam_trigger/templates/index.html
inflating: pligg-cms-master/widgets/spam_trigger/templates/widget.tpl
creating: pligg-cms-master/widgets/statistics/
extracting: pligg-cms-master/widgets/statistics/index.html
inflating: pligg-cms-master/widgets/statistics/init.php
inflating: pligg-cms-master/widgets/statistics/lang.conf
inflating: pligg-cms-master/widgets/statistics/statistics_readme.htm
creating: pligg-cms-master/widgets/statistics/templates/
extracting: pligg-cms-master/widgets/statistics/templates/index.html
inflating: pligg-cms-master/widgets/statistics/templates/settings.tpl
inflating: pligg-cms-master/widgets/statistics/templates/widget.tpl
root@linuxhelp1:/opt# mv pligg-cms-master/ /var/www/html/pligg 


Set the owner permission to that directory by running the following command.

root@linuxhelp1:/opt# chown -R www-data:www-data /var/www/html/pligg 


After setting the permission, move to the pligg directory and rename the default files and directory to make it active.

root@linuxhelp1:/opt# cd /var/www/html/pligg/
root@linuxhelp1:/var/www/html/pligg# mv settings.php.default settings.php
root@linuxhelp1:/var/www/html/pligg# mv languages/lang_english.conf.default languages/lang_english.conf
root@linuxhelp1:/var/www/html/pligg# mv logs.default/ logs
root@linuxhelp1:/var/www/html/pligg# mv libs/dbconnect.php.default libs/dbconnect.php 


In order to create a virtual host for the pligg file, create a file and a soft link for that file in side-enabled.

root@linuxhelp1:/var/www/html/pligg# touch /etc/apache2/sites-available/pligg.conf
root@linuxhelp1:/var/www/html/pligg# ln -s /etc/apache2/sites-available//pligg.conf /etc/apache2/sites-enabled/pligg.conf 

Open the configuration file and paste the following code inside it.

root@linuxhelp1:/var/www/html/pligg# vim /etc/apache2/sites-available/pligg.conf 
< VirtualHost *:80> 
ServerAdmin admin@linuxhelp1.com
DocumentRoot /var/www/html/pligg/
ServerName linuxhelp1.com
ServerAlias www.linuxhelp1.com
< Directory /var/www/html/pligg/> 
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
< /Directory> 
ErrorLog /var/log/apache2/linuxhelp1.com-error_log
CustomLog /var/log/apache2/linuxhelp1.com-access_log common
< /VirtualHost> 


Restart the Apache web server for the changes to take effect.

root@linuxhelp1:/var/www/html/pligg# service apache2 restart 


Open the web browser and type the following link http://< IP_ADDR> /pligg/install/install.php

Choose the respective language.

Read the instructions and click next step.

Now fill up the database details and give check settings.

You can able to see the database connection established message, click on next step.

Fill up the admin details and click create account.


Change the permission of the dbconnect.php file and remove the install directory since the installation has been finished.

root@linuxhelp1:/var/www/html/pligg# chmod 644 libs/dbconnect.php
root@linuxhelp1:/var/www/html/pligg# rm -rf install/ 


Open the web browser and type http://< IP address> /pligg

Click on login and give the username and password to login.

To view the admin console, click on admin to view the admin console.

Tag : Pligg
FAQ
Q
How do I run PHP?
A
Make sure your PHP files are saved as such; they must have the ".php" file extension. Open up any Web browser on your desktop and enter "localhost" into the address box.
Q
What is .htaccess file in Apache?
A
.htaccess is short for Hypertext Access, and is a configuration file used by Apache-based web servers that controls the directory that it "lives" in--as well as all the subdirectories underneath that directory. Also helps to create Custom Error Pages for Better SEO.
Q
what is the apache user name and group name?
A
username= apache and group name also apache
Q
I cannot comment on the support site. Is it right ?
A
yes it was because of the server migration but the support site is working now
Q
I have installed Nginx already. Will pligg works fine with it?
A
Yes it does works on both apache and Nginx