Quantcast
Channel: LINUX HOWTO – LinOxide
Viewing all 382 articles
Browse latest View live

How to Install Drupal 7 with SSL on FreeBSD 10.2

$
0
0

Drupal is free and open source content management framework used by 2.1% of the web on the world web, written in PHP under GPL(GNU General Public License). It is used by a people around the world from a personal blog to corporate, government site or forum, political site and news site. It used too for business corporate and knowledge management. Drupal has been released on january 2001 by Dries Buytaert under GPL, and until this years 2015 drupal developer has provided more than 31.000 module.

Drupal Core is the core of of drupal itself, contains a basic of content management system and frameworks, including user management, page layout configuration and system administration etc. It is also contains a modules that can be activated/enable by administrator to extend the functionally of the website.

In this tutorial we will discuss about the drupal installation. We will install drupal 7 on FreeBSD 10.2 with Apache as the web server, MySQL as the database system and the last we will configure the SSL for it.

Step 1 - Install Apache and PHP

Apache is one of popular web server in the world. use by a million website to serve the site, provide a variety of modules, easy to install and configure and so powerful. You can install Apache and PHP from FreeBSD repository with pkg command.

pkg install apache24 mod_php56 php56-mysql php56-mysqli php56-curl

Now copy the php.ini-production file to php.ini.

cd /usr/local/etc/
cp php.ini-production php.ini

Edit php.ini file with nano editor, uncomment the value of  "date.timezone"  with your timezone.

nano -c php.ini

On the line 926.

date.timezone: Asia/Jakarta

Save and Exit. Go to the apache configuration directory, and edit the file "httpd.conf" with nano editor :

cd /usr/local/etc/apache24/
nano -c httpd.conf

Uncomment the line 220 and change the value to the localhost IP.

ServerName 127.0.0.1:80

add "index.php" to the line 278.

DirectoryIndex index.php index.html

Next, under the line 288, paste configuration below :

<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>

<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>

PHP Configuration

Save and Exit.

Next, add apache to the start up with sysrc command, and start it :

sysrc apache24_enable=yes
service apache24 start

Verify that apache is running by visiting FreeBSD server IP.

Step 2 - Install and Configure MySQL

Drupal 7 support for mysql - I've try on my box to use mariadb, but there is an error. In this tutorial we will use mysql as the database system. Install mysql with pkg command :

pkg install mysql56-server mysql56-client

Once installation is done, copy configuration file for mysql to directory "/usr/local/etc/".

cp /usr/local/share/mysql/my-default.cnf /usr/local/etc/my.cnf

And add the mysql service to the boot time with sysrc :

sysrc mysql_enable=yes

Now start mysql :

service mysql-server start

Next, configure mysql root password by typing command below :

mysql_secure_installation

Set root password? [Y/n] Y
New password: ENTER YOUR PASSWORD
Re-enter new password: REPEAT

Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

mysql is configured with username root and your pasword.

Step 3 - Create Database for Drupal

In this step we will log in to the mysql shell with a username and password that has been set up. Log in to the mysql shell with command below :

mysql -u roop -p TYPE YOUR PASSWORD

Now we will create new database for drupal named "drupaldb", then add new mysql user called "drupaluser" with password "drupaluser@". Next grant the user to the database was created. You can do it by typing mysql command below :

create database drupaldb;
create user drupaluser@localhost identified by 'drupaluser@';
grant all privileges on drupaldb.* to drupaluser@localhost identified by 'drupaluser@';
flush privileges; \q

Create Database for Drupal

Database "drupaldb" for drupal is created.

Step 4 - Install Drupal 7

Drupal 7 is available on freebsd repository, you can install it manually or from the freebsd ports. In this tutorial we will install Drupal 7 from the freebsd repository with pkg command. Instaling Drupal 7 with pkg command :

pkg install drupal7

Now drupal is installed on directory "/usr/local/www/drupal7/". Next, change the owner of the directory to the user called "www".

cd /usr/local/www/
chown -R www:www drupal7/

Next, copy the drupal configuration file, and change the owner of that file :

cd /usr/local/www/drupal7/sites/default/
cp default.settings.php settings.php
chown www:www settings.php

Step 5 - SSL Configuration for Drupal

We will gernerate new SSL certificate for Drupal site. make sure the openssl is installed inside the server. Generate new certificate with command openssl and stored the certificate file in to "/usr/local/etc/apache24/ssl/" directory.

cd /usr/local/etc/apache24/
mkdir ssl; cd ssl

And generate the certificate file :

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /usr/local/etc/apache24/ssl/apache.key -out /usr/local/etc/apache24/ssl/apache.crt

Fill all with your personal information :

Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:

Change permission of the cerificate file :

cd /usr/local/etc/apache24/ssl/
chmod 600 *

Next, load apache ssl module by editing apache configuration "httpd.conf".

cd /usr/local/etc/apache24/
nano -c httpd.conf

Uncomment this line :

#Line 70
LoadModule authn_socache_module libexec/apache24/mod_authn_socache.so

#Line 89
LoadModule socache_shmcb_module libexec/apache24/mod_socache_shmcb.so

#Line 141
LoadModule ssl_module libexec/apache24/mod_ssl.so

Save and Exit.

Step 6 - VirtualHost Configuration for Drupal

In this section we will create new virtualhost configuration file on the apache directory. Now go to the apache directory and create new directory "virtualhost".

cd /usr/local/etc/apache24/
mkdir virtualhost/

Then create create new file for virtualhost with nano editor :

cd virtualhost/
nano -c drupal.conf

And paste virtualhost configuration below :

Listen 443
<VirtualHost _default_:443>
ServerAdmin im@saitama.me
# Directory for the file stored
DocumentRoot "/usr/local/www/drupal7"
#Domain
ServerName saitama.me:443
ServerAlias www.saitama.me:443
ErrorLog "/var/log/saitama.me-error_log"
CustomLog "/var/log/saitama.me-access_log" common

SSLEngine on
SSLCertificateFile /usr/local/etc/apache24/ssl/server.crt
SSLCertificateKeyFile /usr/local/etc/apache24/ssl/server.key

<Directory "/usr/local/www/drupal7">
Options Indexes FollowSymLinks MultiViews
Options All
AllowOverride All
# The syntax is case sensitive!
Require all granted
</Directory>
</VirtualHost>

Save and exit. Now back to the apache directory and edit "httpd.conf" file.

cd /usr/local/etc/apache24/ nano -c httpd.conf

Add to the end of the line new configuration below :

Include etc/apache24/virtualhost/*

Save and exit. Next, test the apache configuration with command :

apachectl configtest

If there is no error, restart the apache :

service apache24 restart

Step 7 - Configure Drupal 7

Now virtualhost for drupal is configured, so you visit the drupal domain with https option "https://saitama.me/". Next, you see the drupal site is up, now select the installation type "Standart" and click "Save and Continue".

Installation Type

Choose the language "English" and "Save and continue".

Select language

Then fill the database configuration with our database configuration. Save and continue.

Configure the Database

Next, just wait for installation, and if it is done, fill with your configuration.

Configure admin

and Finished, drupal configuration is done.

Drupal installation is done

If you want to check the site, click on "Visit your new site". You can see your drupal site :

Drupal

Conclusion

Drupal is open source content management framework based on PHP developed by Dries Buytaert on 2001 under GPL(Genral Public License). Until the day drupal has been provide up to 31.000 modules. Core of drupal named "Drupal Core",  contains a basic of content management system and frameworks, including user management, page layout configuration and system administration etc. Drupal is user firendly, easy to use and configure. You can configure drupal with nginx, apache web server. On freebsd, you can install drupal from freebsd repository with pkg command, or you can too install from the freebsd ports, it is easy to install.

The post How to Install Drupal 7 with SSL on FreeBSD 10.2 appeared first on LinOxide.


How to Install GitLab on Ubuntu / Fedora / Debian

$
0
0

Distributed version control was never easy before git. Git is a free and open source software that is designed to handle everything from small to very large projects with ease and speed. Git was first developed by Linus Torvalds who was also the founder of well-known Linux Kernel. GitLab is an awesome development in the field of git and distributed version control system. It is a web based Git repository managing application which includes features like code reviews,wikis, issue tracking and much more. Creating, reviewing and deploying codes is very easy, managed and fast with GitLab. It can be hosted in our own server though it also provides free repository hosting in its official server which is similar to Github. GitLab has two different editions, Community Edition and Enterprise Edition. Community Edition is a complete free and open source software licensed under MIT License whereas Enterprise Edition is under a proprietary license, and contains features that are not present in the CE version. Here are some easy steps on how we can install GitLab Community Edition on our machine running Ubuntu, Fedora and Debian as operating system.

1. Installing Pre-requisties

First of all, we'll install the required dependencies by GitLab Community Edition. We'll install curl in order to download our required files, openssh-server in order to ssh into our machine, ca-certificates to add CA Certifications and postfix as an MTA (Mail Transfer Agent).

Note: To install GitLab CE, we need to have a linux machine with at least 2 GB RAM and 2 Cores CPU.

On Ubuntu 14 .04/Debian 8.x

As these packages are available on the official repository of box Ubuntu 14.04 and Debian 8.x, we'll simply install it using apt-get package manager. To do so, we'll need to execute the following command in a terminal or console.

# apt-get install curl openssh-server ca-certificates postfix

install dependencies gitlab ubuntu debian

On Fedora 22

In Fedora 22, the default package manager is dnf as yum has been depreciated. So, we'll simply run the following dnf command in order to install those required packages.

# dnf install curl openssh-server postfix

install dependencies gitlab fedora

2. Starting and Enabling Services

Now, we'll start the services of sshd and postfix using our default init system. And we'll also enable them to start automatically in every system boot.

On Ubuntu 14.04

As SysVinit is installed as init system in Ubuntu 14.04, we'll use services command to start sshd and postfix daemon.

# service sshd start
# service postfix start

Now, in order to make them start automatically in every boot, we'll need to run the following update-rc.d command.

# update-rc.d sshd enable
# update-rc.d postfix enable

On Fedora 22/Debian 8.x

As Fedora 22 and Debian 8.x is shipped with Systemd instead of SysVinit as default init system, we'll simply run the following command to start the sshd and postfix services.

# systemctl start sshd postfix

Now, in order to make them start automatically in every boot, we'll need to run the following systemctl command.

# systemctl enable sshd postfix

Created symlink from /etc/systemd/system/multi-user.target.wants/sshd.service to /usr/lib/systemd/system/sshd.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/postfix.service to /usr/lib/systemd/system/postfix.service.

3. Downloading GitLab

We'll now download the binary installation files from the official GitLab CE Repository using curl. First, we'll need to navigate to the repository in order to get the download link of the required file.  To do so, we'll need to run the following command in our linux machine running the respective operating system.

On Ubuntu 14.04

As Ubuntu and Debian uses the same debian format file, we'll gonna search the required version of GitLab under https://packages.gitlab.com/gitlab/gitlab-ce?filter=debs and click on the link of the required release with ubuntu/trusty tag as we are running Ubuntu 14.04. A new page will appear in which we can see the Download button, we'll gonna right click it, get the link of the file and then download it using curl as shown bellow.

# curl https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/trusty/gitlab-ce_8.1.2-ce.0_amd64.deb

Downloading Gitlab Ubuntu

On Debian 8.x

Like Ubuntu, we'll gonna search the required version of it under https://packages.gitlab.com/gitlab/gitlab-ce?filter=debs and click on the link of the requried release with debian/jessie tag as we are running Debian 8.x. Then, a new page will appear in which we'll right click on the Download button and get the file's download link. We'll next download it using curl as shown below.

# curl https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/jessie/gitlab-ce_8.1.2-ce.0_amd64.deb/download

Downloading Gitlab Debian

On Fedora 22

As Fedora uses the rpm file for packages, we'll gonna search the required version of GitLab under https://packages.gitlab.com/gitlab/gitlab-ce?filter=rpms and click on the link of the required release, here as we are running Fedora 22, we'll select the release with el/7 tag. A new page will appear in which we can see the Download button, we'll gonna right click it, get the link of the file and then download it using curl as shown bellow.

# curl https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-8.1.2-ce.0.el7.x86_64.rpm/download

Downloading Gitlab Fedora

4. Installing GitLab

After our repository source is added in our linux machine, we'll now go for the installation of GitLab Community Edition using the default package manger of the respective distribution of linux.

On Ubuntu 14.04/Debian 8.x

To install GitLab CE in machine running Ubuntu 14.04 or Debian 8.x linux distribution which has apt-get package manager, we'll simply run the following command.

# dpkg -i gitlab-ce_8.1.2-ce.0_amd64.deb

Installing Gitlab Ubuntu Debian

On Fedora 22

We can execute the following dnf command to install it in our Fedora 22 box.

# dnf install gitlab-ce-8.1.2-ce.0.el7.x86_64.rpm

Installing Gitlab Fedora

5. Configuring and Starting GitLab

Next, as GitLab CE has been successfully installed in our linux system. We'll now go ahead for configuring and starting it. To do so, we'll need to run the following command which is same in Ubuntu, Debian and Fedora distributions.

# gitlab-ctl reconfigure

Reconfiguring Gitlab

6. Allowing Firewall

If we have firewall program enabled for security in our linux box, we'll need to allow port 80 which is the default port of GitLab CE in order to make the web interface accessible across the network. Firewalld and iptables are most widely used firewall programs in linux distributions. In order to do so, we'll need to run the following commands.

On Iptables

Iptables are installed and used in Ubuntu 14.04 by default. So, we'll need to run the following iptables commands to open port 80 in it.

# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT

# /etc/init.d/iptables save

On Firewalld

As Fedora 22 and Debian 8.x has systemd installed by default, it contains firewalld running as firewall problem. In order to open the port 80 (http service) on firewalld, we'll need to execute the below commands.

# firewall-cmd --permanent --add-service=http

success

# firewall-cmd --reload

success

7. Accessing GitLab Web Interface

Finally, we'll now go for accessing the web interface of GitLab CE. To do so, we'll need to point our web browser to the GitLab server with http://ip-address/ or http://domain.com/ according to our configuration. After we have pointed successfully, we'll see the following screen.

Gitlab Login Screen

Now, in order to login to the panel, we'll need to click on Login button which will ask us an username and a password. We'll now enter the default username and password ie root and 5iveL!fe respectively. After logging into the dashboard, we'll be asked to compulsorily enter the new password for our GitLab root user.

Setting New Password Gitlab

8. Creating Repository

After we have successfully changed the password and logged in to our dashboard, we'll now create a new repository for our new project. To do so, we'll need to go under Projects and click on NEW PROJECT green button.

Creating New Projects

Then, we'll be asked to enter the required information and settings for our repository as shown below. We can even import our project from many git repository providers and repositories.

Creating New Project

After thats done, we'll be able to access our Git repository using any Git client including the basic git command line. We can see every activities done in the repository with other functions like creating a milestone, managing issues, merge requests, managing members, labels and Wiki for our projects.

Gitlab Menu

Conclusion

GitLab is an awesome open source web application for managing our git repository. It has a beautiful, responsive interface with plenty of cool features. It is packed with many cool features like managing groups, deploying keys, Continuous Integration, viewing logs, broadcast messages, hooks, system OAuth applications, templates and more. It has the ability to integrate tons of tools such as Slack, Hipchat, LDAP, JIRA, Jenkins, many types of hooks and a complete API. It has the minimum requirement of 2 GB RAM and 2 Cores CPU to run smoothly up to 500 users but also can be scaled to multiple active servers. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you !

The post How to Install GitLab on Ubuntu / Fedora / Debian appeared first on LinOxide.

How to Setup Redmine - Project Management Web Application on Fedora 22

$
0
0

Redmine is a free and open source web based flexible project management and issue tracking tool written in Ruby on Rails framework which is released under the terms of the GNU General Public License v2 (GPL). Redmine integrates with various version control systems like SVN, CVS, Git, Bazaar, etc and includes a repository browser and diff viewer. It has been localized in more than 34 languages and can be run in any platform as it is cross-platform and cross-database from the core. It makes users easy to manage multiple projects with its associated sub-projects. Here are some remarkable features of Redmine which has made it such a popular open source project management product.

  • Redmine supports multiple projects with sub-projects.
  • It has a flexible role based access control.
  • It consists of issue tracking as well as time tracking system with email creation.
  • It supports SCM integration (SVN, CVS, Git, Mercurial, Bazaar and Darcs).
  • It has integrated Gantt chart and calendar, news, documents & files management.
  • It allows web Feeds & email notifications with per project wiki and forums.
  • Custom fields for issues, time-entries, projects and users
  • It supports multiple LDAP authentication, multilanguage and multiple database making it highly flexible.
  • It supports various plugins and provides a REST API

Here are some easy steps on how we can setup the latest release of Redmine version 3.1.1 in our machine running Fedora 22.

System Requirements

Before we get into the installation of Redmine, we'll need to ensure that we have a machine with at least 10GB storage and 1GB ram with 1GB swap file for better performance. As this tutorial is specifically on Fedora 22 so we'll also need to ensure that our machine is running Fedora 22 in it. All these installation work requires the user to have access to root or sudo commands so, here in this tutorial we'll run all the commands under root user. After everything is checked, we'll now go further towards the installation of the latest release of Redmine version 3.1.1.

1. Installing Dependencies

First of all, we'll need to ensure that we have got all the required dependencies installed in our Fedora 22 linux machine. Some of the required dependencies are Apache Web Server, MariaDB server, Ruby and Postfix (MTA) with other dependencies.  In order to install them, we'll need to run the following commands in a terminal or console under root or sudo access.

# dnf install apr-devel apr-util-devel curl-devel gcc gcc-c++ git httpd httpd-devel ImageMagick-devel mariadb-devel mariadb-server postfix ruby-devel tar libxslt-dev libxml2-dev

Installing Dependencies Redmine

2. Starting and Enabling Services

Now, as we have got our required dependencies installed and ready to get configured, we'll first need to start the required applications and make them start automatically in every boot. As we know, fedora 22 has systemd preinstalled as init system so, we'll need to run the following systemd command in order to start the daemon services.

# systemctl start httpd mariadb postfix

After its started, we'll now make it able to start automatically in every system boot.

# systemctl enable httpd mariadb postfix

Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/postfix.service to /usr/lib/systemd/system/postfix.service.

3. Configuring MariaDB Database

After we have started MariaDB for the first time in our machine, we'll need to configure our mariadb and set a new password for its root user. To do so, we'll need to run the following command as shown below.

# mysql_secure_installation

This will ask us to enter the password for root but as we haven’t set any password before and its our first time we’ve installed mariadb, we’ll simply press enter and go further. Then, we’ll be asked to set root password, here we’ll hit Y and enter our password for root of MariaDB. Then, we’ll simply hit enter to set the default values for the further configurations.

….
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

installation should now be secure.
Thanks for using MariaDB!

Configuring MariaDB

4. Creating a new Redmine DB

After we have successfully configure our MariaDB server, we'll now go for creating a new Redmine Database so that redmine will be able to use MariaDB to store its required data and information. So, we'll need to login to the MariaDB command prompt as root by executing the following command in a terminal or console.

# mysql -u root -p

Here, we’ll need to enter the password of the MariaDB root account that we had set above. After we’re logged in into the mariadb command prompt, we’ll gonna create the database for our redmine application.

> CREATE DATABASE redminedb CHARACTER SET utf8;
> CREATE USER 'redmineuser'@'localhost' IDENTIFIED BY 'Pa$$worD123';
> GRANT ALL PRIVILEGES ON redminedb.* TO 'redmineuser'@'localhost';
> FLUSH PRIVILEGES;
> EXIT;

Creating redminedb Dtabase

Note: We’ve successfully created a new database for our redmine application named redminedb with username redmineuser and password as Pa$$worD123 . It is strongly recommended to replace the above variables as your desire for the security issue.

5. Installing Redmine

Now, as our servers are up and running, we'll now go to grab our latest stable release of redmine from its official website https://www.redmine.org/releases/ . As the latest stable release while writing this article is 3.1.1  so, we'll gonna download the tarball of this release from the above site using wget command as shown below.

# cd /tmp/
# wget https://www.redmine.org/releases/redmine-3.1.1.tar.gz

--2015-11-04 06:44:08-- https://www.redmine.org/releases/redmine-3.1.1.tar.gz
Resolving www.redmine.org (www.redmine.org)... 46.4.36.71
Connecting to www.redmine.org (www.redmine.org)|46.4.36.71|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2246322 (2.1M) [application/x-gzip]
Saving to: ‘redmine-3.1.1.tar.gz’
redmine-3.1.1.tar.gz 100%[========================>] 2.14M 61.2KB/s in 21s
2015-11-04 06:44:32 (102 KB/s) - ‘redmine-3.1.1.tar.gz’ saved [2246322/2246322]

After we have successfully downloaded it, we'll now extract that tarball using tar command.

# tar xfzv redmine-3.1.1.tar.gz

Next, we'll gonna move our extracted redmine directory to the location of our Apache Web Server as follows.

# mv redmine-3.1.1 /var/www/redmine

Then, we'll need to change the ownership of our redmine installation directory to apache so that apache process owner will have full access over the directory and files.

# chown apache:apache -R /var/www/redmine

6. Configuring Redmine

We'll now configure our redmine so that it will be able to connect the MariaDB database that we had just created above. For that, we'll need the database name, database user and password which was noted above. We'll first need to copy the example of configuration file provided by the Redmine Team which is under config folder. To do so, we'll need to run the following command in a terminal or console.

# cd /var/www/redmine/config
# cp database.yml.example database.yml

Next, we'll gonna edit the database.yml and configure it to connect with the MariaDB database.

# nano database.yml

Now, we'll need to append the file database.yml under the production definition as shown below and make it connect with the database.

production:
 adapter: mysql2
 database: redminedb
 host: localhost
 username: redmineuser
 password: "Pa$$worD123" 
 encoding: utf8

After done, we'll need to save and exit the file.

7. Configuring Email Service

Next, we'll need to configure our SMTP settings of our Redmine, so that redmine will be able to send notifications via emails. To do so, we'll need to configure production definition under configuration.yml . The example of configuration file is already prepacked with our redmine package so, we'll simply use that example configuration file. To do so, we'll simply copy that example configuration file to configuration.yml using copying command.

# cd /var/www/redmine/config
# cp configuration.yml.example configuration.yml

Next, we'll gonna edit the configuration.yml using a text editor.

# nano configuration.yml

We'll now search for production definition and append it as shown below.

production:
    email_delivery:
        delivery_method: :smtp
        smtp_settings:
            address: "localhost"
            port: 25
            domain: 'redmine.linoxide.com'
    rmagick_font_path: /usr/share/fonts/ipa-pgothic/ipagp.ttf

8. Installing Ruby Gem

We'll now install the required ruby dependencies for running our Redmine. Those dependencies are managed by bundle. So, to install it, first we'll need to install bundler by running the following command.

# gem install bundler

Successfully installed bundler-1.10.6
Parsing documentation for bundler-1.10.6
Installing ri documentation for bundler-1.10.6
Done installing documentation for bundler after 5 seconds
1 gem installed

Next, we'll gonna install all those required ruby dependencies by excluding postgresql, sqlite, test and development dependencies using --without flag.

# bundle install --without postgresql sqlite test development

Installing Ruby Dependencies

9. Initializing Redmine Database

Now, we'll go further for the initialization of Redmine database. To do so, we'll first generate a secret key for session management by running the following command.

# cd /var/www/redmine
# /usr/local/bin/rake generate_secret_token

Next, we'll setup the database with exporting RAILS_ENV variable as "production" with below command.

# /usr/local/bin/rake db:migrate RAILS_ENV="production"

Then, finally the database needs to be populated with default data by executing the following command. This command will prompt us to choose a language for it, we'll simply go with the default language ie English (en).

# /usr/bin/rake redmine:load_default_data RAILS_ENV="production"

Select language: ar, az, bg, bs, ca, cs, da, de, el, en, en-GB, es, es-PA, et, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en] en
====================================
Default configuration data loaded.

10. Installing and Configuring Passenger

As we are going to setup for production, we'll gonna go for installing Passenger so that we can host our Redmine through apache2 via Passenger. To setup the Passenger bootstrap, we'll need to run the following command.

# gem install passenger

Fetching: passenger-5.0.21.gem (100%)
Building native extensions. This could take a while...
Successfully installed passenger-5.0.21
Parsing documentation for passenger-5.0.21
unable to convert "\x88" from ASCII-8BIT to UTF-8 for src/cxx_supportlib/vendor-modified/boost/thread/future.hpp, skipping
unable to convert "\x97" from ASCII-8BIT to UTF-8 for src/cxx_supportlib/vendor-modified/boost/utility/declval.hpp, skipping
Installing ri documentation for passenger-5.0.21
Done installing documentation for passenger after 69 seconds
1 gem installed

Next, after we have installed passenger, we'll need to install a passenger-apache2 module. To do so, we'll need to run the below command.

# /usr/local/bin/passenger-install-apache2-module

It will help us to diagnose any issues as well as provide some default settings for our specific installation.

Note: To compile Passenger, our machine requires at least 1GB of RAM or 1GB of RAM + Swap space combined.

After its installed, we'll now go further towards the configuration of Passenger.

Now, as we have got our required packages installed in our fedora 22 machine, we'll now need to configure our apache server for proper use of passenger. To do so, we'll need to create a new file passenger.conf in which we'll define configuration for our passenger.

# nano /etc/httpd/conf.d/passenger.conf

After its opened via our text editor, we'll need to append this file with the configuration as shown below.

LoadModule passenger_module /usr/local/share/gems/gems/passenger-5.0.21/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
 PassengerRoot /usr/local/share/gems/gems/passenger-5.0.21
 PassengerDefaultRuby /usr/bin/ruby
</IfModule>

Once done, we'll need to save and exit the editor.

11. Configuring Apache Web Server

Now, as our passenger is configured completely, we'll now configure our apache configuration in order to run our Redmine via Apache Web Server. To do so, we'll need to create a new conf file under /etc/httpd/conf.d/redmine.conf using a text editor.

# nano /etc/httpd/conf.d/redmine.conf

Then, we'll need to copy the following lines of configuration into the file.

<VirtualHost *:80>
   ServerName redmine.linoxide.com
   DocumentRoot /var/www/redmine/public
   <Directory /var/www/redmine/public>
      AllowOverride all
      Options -MultiViews
   </Directory>
</VirtualHost>

Once done, we'll simply save and exit the editor.

12. Restarting Web Server

Once everything above is configured and installed properly as done above, we'll now need to restart our Apache Web Server in order to run our Redmine for the first time. As Fedora 22 is shipped with systemd as init system by default, we'll simply run a systemd command in order to restart it.

# systemctl restart httpd

13. Allowing Firewall

Next, we'll need to configure our firewall program running in our linux machine to allow port 80 or http service so that our apache web server will be accessible within our network. As Fedora 22 has systemd preinstalled, firewalld is popular firewall program in it. So, we'll need to execute the following commands to allow port 80 or http service to expose from our linux machine.

# firewall-cmd --zone=public --add-service=http
# firewall-cmd --permanent --zone=public --add-service=http

14. Accessing Redmine

Now, as we have our apache web server running and http port forwarded, we should be able to access our Redmine web interface using a web browser. We'll simply need to point our web browser to http://ip-address/ or http://redmine.domain.com/ according to our configuration. Here, in this tutorial, we pointed our browser to http://redmine.linoxide.com/ as we had configured it in the apache web server in the above step. If everything went as expected, we should see our Redmine application running as follows.

Redmine Application

Next, we'll gonna login into our Redmine Dashboard. To do so, we'll need to click on the Login button present just above in the navigation bar. Then, a login screen will appear which will ask for username and password. The default username and password of Redmine application is admin and admin respectively.

Redmine Login Screen

After we have successfully logged in, we'll go for creating our Projects. We can do that by navigating to Administration page from the above menu.

Administration Redmine

Then, we'll need to click on Projects and click on a button (+) New Project.

Adding New Project

A form will appear in which we'll need to enter the required information and configuration for our Project as shown below. After we have completed the required information and settings, we'll need to Click on Create and Continue.

Creating New Project

Conclusion

In this article, we learned how to setup a popular project management web application Redmine on a machine running Fedora 22 as operating system. It is an awesome cross platform application which makes project management, bug tracking and time tracking pretty easy with a bunch of different essential features. It is completely built and maintained by active community volunteers who are pretty helpful and loves to support its users. If you would like to take a demo of Redmine before going for installation, you can always visit http://demo.redmine.org/ . If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you !

The post How to Setup Redmine - Project Management Web Application on Fedora 22 appeared first on LinOxide.

How to Setup Drone - a Continuous Integration Service in Linux

$
0
0

Are you tired of cloning, building, testing, and deploying codes time and again? If yes, switch to continuous integration. Continuous Integration aka CI is practice in software engineering of making frequent commits to the code base, building, testing and deploying as we go. CI helps to quickly integrate new codes into the existing code base. If this process is made automated, then this will speed up the development process as it reduces the time taken for the developer to build and test things manually. Drone is a free and open source project which provides an awesome environment of continuous integration service and is released under Apache License Version 2.0. It integrates with many repository providers like Github, Bitbucket and Google Code and has the ability to pull codes from the repositories enabling us to build the source code written in number of languages including PHP, Node, Ruby, Go, Dart, Python, C/C++, JAVA and more. It is made such a powerful platform cause it uses containers and docker technology for every build making users a complete control over their build environment with guaranteed isolation.

1. Installing Docker

First of all, we'll gonna install Docker as its the most vital element for the complete workflow of Drone. Drone does a proper utilization of docker for the purpose of building and testing application. This container technology speeds up the development of the applications. To install docker, we'll need to run the following commands with respective the distribution of linux. In this tutorial, we'll cover the steps with Ubuntu 14.04 and CentOS 7 linux distributions.

On Ubuntu

To install Docker in Ubuntu, we can simply run the following commands in a terminal or console.

# apt-get update
# apt-get install docker.io

After the installation is done, we'll restart our docker engine using service command.

# service docker restart

Then, we'll make docker start automatically in every system boot.

# update-rc.d docker defaults

Adding system startup for /etc/init.d/docker ...
/etc/rc0.d/K20docker -> ../init.d/docker
/etc/rc1.d/K20docker -> ../init.d/docker
/etc/rc6.d/K20docker -> ../init.d/docker
/etc/rc2.d/S20docker -> ../init.d/docker
/etc/rc3.d/S20docker -> ../init.d/docker
/etc/rc4.d/S20docker -> ../init.d/docker
/etc/rc5.d/S20docker -> ../init.d/docker

On CentOS

First, we'll gonna update every packages installed in our centos machine. We can do that by running the following command.

#  sudo yum update

To install docker in centos, we can simply run the following commands.

#  curl -sSL https://get.docker.com/ | sh

After our docker engine is installed in our centos machine, we'll simply start it by running the following systemd command as systemd is the default init system in centos 7.

# systemctl start docker

Then, we'll enable docker to start automatically in every system startup.

# systemctl enable docker

ln -s '/usr/lib/systemd/system/docker.service' '/etc/systemd/system/multi-user.target.wants/docker.service'

2. Installing SQlite Driver

It uses SQlite3 database server for storing its data and information by default. It will automatically create a database file named drone.sqlite under /var/lib/drone/ which will handle database schema setup and migration. To setup SQlite3 drivers, we'll need to follow the below steps.

On Ubuntu 14.04

As SQlite3 is available on the default respository of Ubuntu 14.04, we'll simply install it by running the following apt command.

# apt-get install libsqlite3-dev

On CentOS 7

To install it on CentOS 7 machine, we'll need to run the following yum command.

# yum install sqlite-devel

3. Installing Drone

Finally, after we have installed those dependencies successfully, we'll now go further towards the installation of drone in our machine. In this step, we'll simply download the binary package of it from the official download link of the respective binary formats and then install them using the default package manager.

On Ubuntu

We'll use wget to download the debian package of drone for ubuntu from the official Debian file download link ie http://downloads.drone.io/master/drone.deb . Here is the command to download the required debian package of drone.

# wget downloads.drone.io/master/drone.deb

Resolving downloads.drone.io (downloads.drone.io)... 54.231.48.98
Connecting to downloads.drone.io (downloads.drone.io)|54.231.48.98|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7722384 (7.4M) [application/x-debian-package]
Saving to: 'drone.deb'
100%[======================================>] 7,722,384 1.38MB/s in 17s
2015-11-06 14:09:28 (456 KB/s) - 'drone.deb' saved [7722384/7722384]

After its downloaded, we'll gonna install it with dpkg package manager.

# dpkg -i drone.deb

Selecting previously unselected package drone.
(Reading database ... 28077 files and directories currently installed.)
Preparing to unpack drone.deb ...
Unpacking drone (0.3.0-alpha-1442513246) ...
Setting up drone (0.3.0-alpha-1442513246) ...
Your system ubuntu 14: using upstart to control Drone
drone start/running, process 9512

On CentOS

In the machine running CentOS, we'll download the RPM package from the official download link for RPM ie http://downloads.drone.io/master/drone.rpm using wget command as shown below.

# wget downloads.drone.io/master/drone.rpm

--2015-11-06 11:06:45-- http://downloads.drone.io/master/drone.rpm
Resolving downloads.drone.io (downloads.drone.io)... 54.231.114.18
Connecting to downloads.drone.io (downloads.drone.io)|54.231.114.18|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7763311 (7.4M) [application/x-redhat-package-manager]
Saving to: ‘drone.rpm’
100%[======================================>] 7,763,311 1.18MB/s in 20s
2015-11-06 11:07:06 (374 KB/s) - ‘drone.rpm’ saved [7763311/7763311]

Then, we'll install the download rpm package using yum package manager.

# yum localinstall drone.rpm

4. Configuring Port

After the installation is completed, we'll gonna configure drone to make it workable. The configuration of drone is inside /etc/drone/drone.toml file. By default, drone web interface is exposed under port 80 which is the default port of http, if we wanna change it, we can change it by replacing the value under server block as shown below.

[server]
port=":80"

5. Integrating Github

In order to run Drone we must setup at least one integration points between GitHub, GitHub Enterprise, Gitlab, Gogs, Bitbucket. In this tutorial, we'll only integrate github but if we wanna integrate other we can do that from the configuration file. In order to integrate github, we'll need to create a new application in our github settings ie https://github.com/settings/developers .

Registering App Github

To create, we'll need to click on Register a New Application then fill out the form as shown in the following image.

Registering OAuth app github

We should make sure that  looks like http://drone.linoxide.com/api/auth/github.com under the configuration of the application. Then, we'll click on Register application. After done, we'll note the Client ID and Client Secret key as we'll need to configure it in our drone configuration.

Client ID and Secret Token

After thats done, we'll need to edit our drone configuration using a text editor by running the following command.

# nano /etc/drone/drone.toml

Then, we'll find the [github] section and append the section with the above noted configuration as shown below.

 [github]
client="3dd44b969709c518603c"
secret="4ee261abdb431bdc5e96b19cc3c498403853632a"
# orgs=[]
# open=false

Configuring Github Drone

6. Configuring SMTP server

If we wanna enable drone to send notifications via emails, then we'll need to specify the SMTP configuration of our SMTP server. If we already have an SMTP server, we can use its configuration but as we don't have an SMTP server, we'll need to install an MTA ie Postfix and then specify the SMTP configuration in the drone configuration.

On Ubuntu

We can install postfix in ubuntu by running the following apt command.

# apt-get install postfix

On CentOS

We can install postfix in CentOS by running the following yum command.

# yum install postfix

After installing, we'll need to edit the configuration of our postfix configuration using a text editor.

# nano /etc/postfix/main.cf

Then, we'll need to replace the value of myhostname parameter to our FQDN ie drone.linoxide.com .

myhostname = drone.linoxide.com

Now, we'll gonna finally configure the SMTP section of our drone configuration file.

# nano /etc/drone/drone.toml

Then, we'll find the [stmp] section and then we'll need to append the setting as follows.

[smtp]
host = "drone.linoxide.com"
port = "587"
from = "root@drone.linoxide.com"
user = "root"
pass = "password"

Configuring SMTP Drone

Note: Here, user and pass parameters are strongly recommended to be changed according to one's user configuration.

7. Configuring Worker

As we know that drone utilizes docker for its building and testing task, we'll need to configure docker as the worker for our drone. To do so, we'll need to edit the [worker] section in the drone configuration file.

# nano /etc/drone/drone.toml

Then, we'll uncomment the following lines and append as shown below.

[worker]
nodes=[
"unix:///var/run/docker.sock",
"unix:///var/run/docker.sock"
]

Here, we have set only 2 node which means the above configuration is capable of executing only 2 build at a time. In order to increase concurrency, we can increase the number of nodes.

[worker]
nodes=[
"unix:///var/run/docker.sock",
"unix:///var/run/docker.sock",
"unix:///var/run/docker.sock",
"unix:///var/run/docker.sock"
]

Here, in the above configuration, drone is configured to process four builds at a time, using the local docker daemon.

8. Restarting Drone

Finally, after everything is done regarding the installation and configuration, we'll now start our drone server in our linux machine.

On Ubuntu

To start drone in our Ubuntu 14.04 machine, we'll simply run service command as the default init system of Ubuntu 14.04 is SysVinit.

# service drone restart

To make drone start automatically in every boot of the system, we'll run the following command.

# update-rc.d drone defaults

On CentOS

To start drone in CentOS machine, we'll simply run systemd command as CentOS 7 is shipped with systemd as init system.

# systemctl restart drone

Then, we'll enable drone to start automatically in every system boot.

# systemctl enable drone

9. Allowing Firewalls

As we know drone utilizes port 80 by default and we haven't changed the port, we'll gonna configure our firewall programs to allow port 80 (http) and be accessible from other machines in the network.

On Ubuntu 14.04

Iptables is a popular firewall program which is installed in the ubuntu distributions by default. We'll make iptables to expose port 80 so that we can make our Drone web interface accessible in the network.

# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# /etc/init.d/iptables save

On CentOS 7

As CentOS 7 has systemd installed by default, it contains firewalld running as firewall problem. In order to open the port 80 (http service) on firewalld, we'll need to execute the following commands.

# firewall-cmd --permanent --add-service=http

success

# firewall-cmd --reload

success

10. Accessing Web Interface

Now, we'll gonna open the web interface of drone using our favourite web browser. To do so, we'll need to point our web browser to our machine running drone in it. As the default port of drone is 80 and we have also set 80 in this tutorial, we'll simply point our browser to http://ip-address/ or http://drone.linoxide.com according to our configuration. After we have done that correctly, we'll see the first page of it having options to login into our dashboard.

Login Github Drone

As we have configured Github in the above step, we'll simply select github and we'll go through the app authentication process and after its done, we'll be forwarded to our Dashboard.

Drone Dashboard

Here, it will synchronize all our github repository and will ask us to activate the repo which we want to build with drone.

Activate Repository

After its activated, it will ask us to add a new file named .drone.yml in our repository and define the build process and configuration in that file like which image to fetch and which command/script to run while compiling, etc.

We'll need to configure our .drone.yml as shown below.

image: python
script:
 - python helloworld.py
 - echo "Build has been completed."

After its done, we'll be able to build our application using the configuration YAML file .drone.yml in our drone appliation. All the commits made into the repository is synced in realtime. It automatically syncs the commit and changes made to the repository. Once the commit is made in the repository, build is automatically started in our drone application.

Building Application Drone

After the build is completed, we'll be able to see the output of the build with the output console.

Build Success Drone

Conclusion

In this article, we learned to completely setup a workable Continuous Intergration platform with Drone. If we want, we can even get started with the services provided by the official Drone.io project. We can start with free service or paid service according to our requirements. It has changed the world of Continuous integration with its beautiful web interface and powerful bunches of features. It has the ability to integrate with many third party applications and deployment platforms. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you !

The post How to Setup Drone - a Continuous Integration Service in Linux appeared first on LinOxide.

How to Install Revive Adserver on Ubuntu 15.04 / CentOS 7

$
0
0

Revive AdserverHow to Install Revive Adserver on Ubuntu 15.04 / CentOS 7 is a free and open source advertisement management system that enables publishers, ad networks and advertisers to serve ads on websites, apps, videos and manage campaigns for multiple advertiser with many features. Revive Adserver is licensed under GNU Public License which is also known as OpenX Source. It features an integrated banner management interface, URL targeting, geo-targeting and tracking system for gathering statistics. This application enables website owners to manage banners from both in-house advertisement campaigns as well as from paid or third-party sources, such as Google's AdSense. Here, in this tutorial, we'll gonna install Revive Adserver in our machine running Ubuntu 15.04 or CentOS 7.

Installing LAMP Stack

First of all, as Revive Adserver requires a complete LAMP Stack to work, we'll gonna install it. LAMP Stack is the combination of Apache Web Server, MySQL/MariaDB Database Server and PHP modules. To run Revive properly, we'll need to install some PHP modules like apc, zlib, xml, pcre, mysql and mbstring. To setup LAMP Stack, we'll need to run the following command with respect to the distribution of linux we are currently running.

On Ubuntu 15.04

# apt-get install apache2 mariadb-server php5 php5-gd php5-mysql php5-curl php-apc zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev libapache2-mod-php5 zip

On CentOS 7

# yum install httpd mariadb php php-gd php-mysql php-curl php-mbstring php-xml php-apc zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev zip

Starting Apache and MariaDB server

We’ll now start our newly installed Apache web server and MariaDB database server in our linux machine. To do so, we'll need to execute the following commands.

On Ubuntu 15.04

Ubuntu 15.04 is shipped with Systemd as its default init system, so we'll need to execute the following commands to start apache and mariadb daemons.

# systemctl start apache2 mysql

After its started, we'll now make it able to start automatically in every system boot by running the following command.

# systemctl enable apache2 mysql

Synchronizing state for apache2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d apache2 defaults
Executing /usr/sbin/update-rc.d apache2 enable
Synchronizing state for mysql.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d mysql defaults
Executing /usr/sbin/update-rc.d mysql enable

On CentOS 7

Also in CentOS 7, systemd is the default init system so, we'll run the following command to start them.

# systemctl start httpd mariadb

Next, we'll enable them to start automatically in every startup of init system using the following command.

# systemctl enable httpd mariadb

ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'

Configuring MariaDB

On CentOS 7/Ubuntu 15.04

Now, as we are starting MariaDB for the first time and no password has been assigned for MariaDB so, we’ll first need to configure a root password for it. Then, we’ll gonna create a new database so that it can store data for our Revive Adserver installation.

To configure MariaDB and assign a root password, we’ll need to run the following command.

# mysql_secure_installation

This will ask us to enter the password for root but as we haven’t set any password before and its our first time we’ve installed mariadb, we’ll simply press enter and go further. Then, we’ll be asked to set root password, here we’ll hit Y and enter our password for root of MariaDB. Then, we’ll simply hit enter to set the default values for the further configurations.

….
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

installation should now be secure.
Thanks for using MariaDB!

Configuring MariaDB

Creating new Database

After we have assigned the password to our root user of mariadb server, we'll now create a new database for Revive Adserver application so that it can store its data into the database server. To do so, first we'll need to login to our MariaDB console by running the following command.

# mysql -u root -p

Then, it will ask us to enter the password of root user which we had just set in the above step. Then, we'll be welcomed into the MariaDB console in which we'll create our new database, database user and assign its password and grant all privileges to create, remove and edit the tables and data stored in it.

> CREATE DATABASE revivedb;
> CREATE USER 'reviveuser'@'localhost' IDENTIFIED BY 'Pa$$worD123';
> GRANT ALL PRIVILEGES ON revivedb.* TO 'reviveuser'@'localhost';
> FLUSH PRIVILEGES;
> EXIT;

Creating Mariadb Revive Database

Downloading Revive Adserver Package

Next, we'll download the latest release of Revive Adserver ie version 3.2.2 in the time of writing this article. So, we'll first get the download link from the official Download Page of Revive Adserver ie http://www.revive-adserver.com/download/ then we'll download the compressed zip file using wget command under /tmp/ directory as shown bellow.

# cd /tmp/
# wget http://download.revive-adserver.com/revive-adserver-3.2.2.zip

--2015-11-09 17:03:48-- http://download.revive-adserver.com/revive-adserver-3.2.2.zip
Resolving download.revive-adserver.com (download.revive-adserver.com)... 54.230.119.219, 54.239.132.177, 54.230.116.214, ...
Connecting to download.revive-adserver.com (download.revive-adserver.com)|54.230.119.219|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11663620 (11M) [application/zip]
Saving to: 'revive-adserver-3.2.2.zip'
revive-adserver-3.2 100%[=====================>] 11.12M 1.80MB/s in 13s
2015-11-09 17:04:02 (906 KB/s) - 'revive-adserver-3.2.2.zip' saved [11663620/11663620]

After the file is downloaded, we'll simply extract its files and directories using unzip command.

# unzip revive-adserver-3.2.2.zip

Then, we'll gonna move the entire Revive directories including every files from /tmp to the default webroot of Apache Web Server ie /var/www/html/ directory.

# mv revive-adserver-3.2.2 /var/www/html/reviveads

Configuring Apache Web Server

We'll now configure our Apache Server so that revive will run with proper configuration. To do so, we'll create a new virtualhost by creating a new configuration file named reviveads.conf . The directory here may differ from one distribution to another, here is how we create in the following distributions of linux.

On Ubuntu 15.04

# touch /etc/apache2/sites-available/reviveads.conf
# ln -s /etc/apache2/sites-available/reviveads.conf /etc/apache2/sites-enabled/reviveads.conf
# nano /etc/apache2/sites-available/reviveads.conf

Now, we'll gonna add the following lines of configuration into this file using our favorite text editor.

<VirtualHost *:80>
ServerAdmin info@reviveads.linoxide.com
DocumentRoot /var/www/html/reviveads/
ServerName reviveads.linoxide.com
ServerAlias www.reviveads.linoxide.com
<Directory /var/www/html/reviveads/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/apache2/reviveads.linoxide.com-error_log
CustomLog /var/log/apache2/reviveads.linoxide.com-access_log common
</VirtualHost>

Configuring Apache2 Ubuntu

After done, we'll gonna save the file and exit our text editor. Then, we'll restart our Apache Web server.

# systemctl restart apache2

On CentOS 7

In CentOS, we'll directly create the file reviveads.conf under /etc/httpd/conf.d/ directory using our favorite text editor.

# nano /etc/httpd/conf.d/reviveads.conf

Then, we'll gonna add the following lines of configuration into the file.

<VirtualHost *:80>
ServerAdmin info@reviveads.linoxide.com
DocumentRoot /var/www/html/reviveads/
ServerName reviveads.linoxide.com
ServerAlias www.reviveads.linoxide.com
<Directory /var/www/html/reviveads/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/httpd/reviveads.linoxide.com-error_log
CustomLog /var/log/httpd/reviveads.linoxide.com-access_log common
</VirtualHost>

Configuring httpd Centos

Once done, we'll simply save the file and exit the editor. And then, we'll gonna restart our apache web server.

# systemctl restart httpd

Fixing Permissions and Ownership

Now, we'll gonna fix some file permissions and ownership of the installation path. First, we'll gonna set the ownership of the installation directory to Apache process owner so that apache web server will have full access of the files and directories to edit, create and delete.

On Ubuntu 15.04

# chown www-data: -R /var/www/html/reviveads

On CentOS 7

# chown apache: -R /var/www/html/reviveads

Allowing Firewall

Now, we'll gonna configure our firewall programs to allow port 80 (http) so that our apache web server running Revive Adserver will be accessible from other machines in the network across the default http port ie 80.

On Ubuntu 15.04/CentOS 7

As CentOS 7 and Ubuntu 15.04 both has systemd installed by default, it contains firewalld running as firewall program. In order to open the port 80 (http service) on firewalld, we'll need to execute the following commands.

# firewall-cmd --permanent --add-service=http

success

# firewall-cmd --reload

success

Web Installation

Finally, after everything is done as expected, we'll now be able to access the web interface of the application using a web browser. We can go further towards the web installation, by pointing the web browser to the web server we are running in our linux machine. To do so, we'll need to point our web browser to http://ip-address/ or http://domain.com assigned to our linux machine. Here, in this tutorial, we'll point our browser to http://reviveads.linoxide.com/ .

Revive Adserver Web Installation Welcome

Here, we'll see the Welcome page of the installation of Revive Adserver with the GNU General Public License V2 as Revive Adserver is released under this license. Then, we'll simply click on I agree button in order to continue the installation.

Connecting Revive Adserver Database

In the next page, we'll need to enter the required database information in order to connect Revive Adserver with the MariaDB database server. Here, we'll need to enter the database name, user and password that we had set in the above step. In this tutorial, we entered database name, user and password as revivedb, reviveuser and Pa$$worD123 respectively then, we set the hostname as localhost and continue further.

Configuring Revive Adserver

We'll now enter the required information like administration username, password and email address so that we can use these information to login to the dashboard of our Adserver. After done, we'll head towards the Finish page in which we'll see that we have successfully installed Revive Adserver in our server.

Revive Adserver Installation Finished

Next, we'll be redirected to the Adverstiser page where we'll add new Advertisers and manage them. Then, we'll be able to navigate to our Dashboard, add new users to the adserver, add new campaign for our advertisers, banners, websites, video ads and everything that its built with.

Revive Adserver Advertisers Page

For enabling more configurations and access towards the administrative settings, we can switch our Dashboard user to the Administrator account. This will add new administrative menus in the dashboard like Plugins, Configuration through which we can add and manage plugins and configure many features and elements of Revive Adserver.

Conclusion

In this article, we learned some information on what is Revive Adserver and how we can setup on linux machine running Ubuntu 15.04 and CentOS 7 distributions. Though Revive Adserver's initial source code was bought from OpenX, currently the code base for OpenX Enterprise and Revive Adserver are completely separate. To extend more features, we can install more plugins which we can also find from http://www.adserverplugins.com/ . Really, this piece of software has changed the way of managing the ads for websites, apps, videos and made it very easy and efficient. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you !

The post How to Install Revive Adserver on Ubuntu 15.04 / CentOS 7 appeared first on LinOxide.

How to install Android Studio on Ubuntu 15.04 / CentOS 7

$
0
0

With the advancement of smart phones in the recent years, Android has become one of the biggest phone platforms and all the tools required to build Android applications are also freely available. Android Studio is an Integrated Development Environment (IDE) for developing Android applications based on IntelliJ IDEA.  It is a free and open source software by Google released in 2014 and succeeds Eclipse as the main IDE.

In this article, we will learn how to install Android Studio on Ubuntu 15.04 and CentOS 7.

Installation on Ubuntu 15.04

We can install Android Studio in two ways. One is to set up the required repository and install it; other is to download it from the official Android site and install it locally.  In the following example,  we will be setting up the repo using command line and install it.  Before proceeding, we need to make sure that we have JDK  version1.6 or greater installed.

Here, I'm installing JDK 1.8.

$ sudo add-apt-repository ppa:webupd8team/java

$ sudo apt-get update

$ sudo apt-get install oracle-java8-installer oracle-java8-set-default

Verify if java installation was successful:

poornima@poornima-Lenovo:~$ java  -version

Now,  setup the repo for installing Android Studio

$ sudo apt-add-repository ppa:paolorotolo/android-studio

Android-Studio-repo

$ sudo apt-get update

$ sudo apt-get install android-studio

Above install command will install android-studio in the directory /opt.

Now, run the following command to start the setup wizard:

$ /opt/android-studio/bin/studio.sh

This will invoke the setup screen. Following are the screen shots that follow to set up Android studio:

Android Studio setup

Install-type

 

Emulator Settings

Once you press the Finish button, Licence agreement will be displayed. After you accept the licence, it starts downloading the required components.

Download components

Android studio installation will be complete after this step. When you relaunch Android studio, you will be shown the following welcome screen from where you will be able to start working with your Android Studio.

Welcome screen

Installation on CentOS 7

Let us now learn how to install Android Studio on CentOS 7. Here also, you need to install JDK 1.6 or later.  Remember to use 'sudo' before the commands if you are not a root user.  You can download the latest version of JDK. In case you already have an older version installed, remove the same before installing the new one. In the below example, I will be installing JDK version 1.8.0_65 by downloading the required rpm.

[root@li1260-39 ~]# rpm -ivh jdk-8u65-linux-x64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:jdk1.8.0_65-2000:1.8.0_65-fcs ################################# [100%]
Unpacking JAR files...
tools.jar...
plugin.jar...
javaws.jar...
deploy.jar...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...
jfxrt.jar...

If Java path is not set properly, you will get error messages. Hence, set the correct path:

export JAVA_HOME=/usr/java/jdk1.8.0_25/
export PATH=$PATH:$JAVA_HOME

Check if the correct version has been installed:

[root@li1260-39 ~]# java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)

If you notice any error message of the sort  "unable-to-run-mksdcard-sdk-tool:" while trying to install Android Studio, you might also have to install the following packages on CentOS 7 64-bit:

glibc.i686

glibc-devel.i686

libstdc++.i686

zlib-devel.i686

ncurses-devel.i686

libX11-devel.i686

libXrender.i686

libXrandr.i686

Let us know install studio by downloading the ide file from Android site and unzipping the same.

[root@li1260-39 tmp]# unzip android-studio-ide-141.2343393-linux.zip

Move android-studio directory to /opt directory

[root@li1260-39 tmp]# mv /tmp/android-studio/ /opt/

You can create a simlink to the studio executable to quickly start it whenever you need it.

[root@li1260-39 tmp]# ln -s /opt/android-studio/bin/studio.sh /usr/local/bin/android-studio

Now launch the studio from a terminal:

[root@localhost ~]#studio

The screens that follow for completing the installation are same as the ones shown above for Ubuntu.  When the installation completes, you can start creating your own Android applications.

Conclusion

Within a year of its release, Android Studio has taken over as the primary IDE for Android development by eclipsing Eclipse.  It is the only official IDE tool that will  support future  Android SDKs and other Android features that will be provided by Google. So, what are you waiting for? Go install Android Studio and have fun developing Android apps.

The post How to install Android Studio on Ubuntu 15.04 / CentOS 7 appeared first on LinOxide.

How to Install Cockpit in Fedora / CentOS / RHEL/ Arch Linux

$
0
0

Cockpit is a free and open source server management software that makes us easy to administer our GNU/Linux servers via its beautiful web interface frontend. Cockpit helps make linux system administrator, system maintainers and DevOps easy to manage their server and to perform simple tasks, such as administering storage, inspecting journals, starting and stopping services and more. Its journal interface adds aroma in flower making people easy to switch between the terminal and web interface. And moreover, it makes easy to manage not only one server but several multiple networked servers from a single place at the same time with just a single click. It is very light weight and has easy to use web based interface. In this tutorial, we'll learn how we can setup Cockpit and use it to manage our server running Fedora, CentOS, Arch Linux and RHEL distributions as their operating system software. Some of the awesome benefits of Cockpit in our GNU/Linux servers are as follows:

  1. It consist of systemd service manager for ease.
  2. It has a Journal log viewer to perform troubleshoots and log analysis.
  3. Storage setup including LVM was never easier before.
  4. Basic Network configuration can be applied with Cockpit
  5. We can easily add and remove local users and manage multiple servers.

1. Installing Cockpit

First of all, we'll need to setup Cockpit in our linux based server. In most of the distributions, the cockpit package is already available in their official repositories. Here, in this tutorial, we'll setup Cockpit in Fedora 22, CentOS 7, Arch Linux and RHEL 7 from their official repositories.

On CentOS / RHEL

Cockpit is available in the official repository of CenOS and RHEL. So, we'll simply install it using yum manager. To do so, we'll simply run the following command under sudo/root access.

# yum install cockpit

Install Cockpit Centos

On Fedora 22/21

Alike, CentOS, it is also available by default in Fedora's official repository, we'll simply install cockpit using dnf package manager.

# dnf install cockpit

Install Cockpit Fedora

 On Arch Linux

Cockpit is currently not available in the official repository of Arch Linux but it is available in the Arch User Repository also know as AUR. So, we'll simply run the following yaourt command to install it.

# yaourt cockpit

Install Cockpit Archlinux

2. Starting and Enabling Cockpit

After we have successfully installed it, we'll gonna start the cockpit server with our service/daemon manager. As of 2015, most of the linux distributions have adopted Systemd whereas some of the linux distributions still run SysVinit to manage daemon, but Cockpit uses systemd for almost everything from running daemons to services. So, we can only setup Cockpit in the latest releases of linux distributions running Systemd. In order to start Cockpit and make it start in every boot of the system, we'll need to run the following command in a terminal or a console.

# systemctl start cockpit

# systemctl enable cockpit.socket

Created symlink from /etc/systemd/system/sockets.target.wants/cockpit.socket to /usr/lib/systemd/system/cockpit.socket.

3. Allowing Firewall

After we have started our cockpit server and enable it to start in every boot, we'll now go for configuring firewall. As we have firewall programs running in our server, we'll need to allow ports in order to make cockpit accessible outside of the server.

On Firewalld

# firewall-cmd --add-service=cockpit --permanent

success

# firewall-cmd --reload

success

Cockpit Allowing Firewalld

On Iptables

# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT

# service iptables save

4. Accessing Cockpit Web Interface

Next, we'll gonna finally access the Cockpit web interface using a web browser. We'll simply need to point our web browser to https://ip-address:9090 or https://server.domain.com:9090 according to the configuration. Here, in our tutorial, we'll gonna point our browser to https://128.199.114.17:9090 as shown in the image below.

Cockpit Webserver SSL Proceed

We'll be displayed an SSL certification warning as we are using a self-signed SSL certificate. So, we'll simply ignore it and go forward towards the login page, in chrome/chromium, we'll need to click on Show Advanced and then we'll need to click on Proceed to 128.199.114.17 (unsafe) .

Cockpit Login Screen

Now, we'll be asked to enter the login details in order to enter into the dashboard. Here, the username and password is the same as that of the login details we use to login to our linux server. After we enter the login details and click on Log In button, we will be welcomed into the Cockpit Dashboard.

Cockpit Dashboard

Here, we'll see all the menu and visualization of CPU, Disk, Network, Storage usages of the server. We'll see the dashboard as shown above.

Services

To manage services, we'll need to click on Services button on the menu situated in the right side of the web page. Then, we'll see the services under 5 categories, Targets, System Services, Sockets, Timers and Paths.

Cockpit Services

 

Docker Containers

We can even manage docker containers with Cockpit. It is pretty easy to monitor and administer Docker containers with Cockpit. As docker isn't installed and running in our server, we'll need to click on Start Docker.

Cockpit Container

Cockpit will automatically install and run docker in our server. After its running, we see the following screen. Then, we can manage the docker images, containers as per our requirement.

Cockpit Containers Mangement

Journal Log Viewer

Cockpit has a managed log viewer which separates the Errors, Warnings, Notices into different tabs. And we also have a tab All where we can see them all in a single place.

Cockpit Journal Logs

Networking

Under the networking section, we see two graphs in which there is the visualization of Sending and Receiving speed. And we can see there the list of available interfaces with option to Add Bond, Bridge, VLAN. If we need to configure an interface, we can do so by simply clicking on the interface name. Below everything, we can see the Journal Log Viewer for Networking.

Cockpit Network

Storage

Now, its easy with Cockpit to see the R/W speed of our hard disk. We can see the Journal log of the Storage in order to perform troubleshoot and fixes. A clear visualization bar of how much space is occupied is shown in the page. We can even Unmount, Format, Delete a partition of a Hard Disk and more. Features like creating RAID Device, Volume Group is also available in it.

Cockpit Storage

Account Management

We can easily create new accounts with Cockpit Web Interface. The accounts created in it is applied to the system's user account. We can change password, specify roles, delete, rename user accounts with it.

Cockpit Accounts

Live Terminal

This is an awesome feature built-in with Cockpit. Yes, we can execute commands, do stuffs with the live terminal provided by Cockpit interface. This makes us really easy to switch between the web interface and terminal according to our need.

Cockpit Terminal

Conclusion

Cockpit is a good free and open source software developed by Red Hat for making the server management easy and simple. It is best for performing simple system administration tasks and is good for the new system administrators. It is still under pre-release as its stable release hasn't been released yet. So, it is not suitable for production. It is currently developed on the latest release of Fedora, CentOS, Arch Linux, RHEL where systemd is installed by default. If you are willing to install Cockpit in Ubuntu, you can get the PPA access but is currently outdated. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank You !

The post How to Install Cockpit in Fedora / CentOS / RHEL/ Arch Linux appeared first on LinOxide.

How to Build Our Own Social Networking Site with Dolphin Pro

$
0
0

Dolphin Pro is a free and open source Content Mangement System (CMS) built for developing highly advanced and featured social networking websites. It has a complete set of features needed for a beautiful social networking site like forums, photos, video, music, blogs, polls, events, groups, chat, messenger, templates, languages and many more. We can develop awesome social networking, dating, community website and many more. Simply, we can build our own new social site like facebook, twitter, etc with all the necessary features out of the box. Dolphin is often known as the world's top social networking CMS so far. It has many beautiful theme, templates and more over has a super clean and elegant web interface and design.

Here are some easy steps on how we can setup Dolphin Pro and build our own Social Networking site in a Linux machine.

1. Installing LAMP Stack

First of all, we'll gonna install LAMP Stack, LAMP is the combination of Apache Web Server, MySQL/MariaDB Database server and PHP modules. To setup it, we'll need to run the following command as shown below.

On Ubuntu 14.04

# apt-get update
# apt-get install apache2 mariadb-server php5 php5-gd php5-mysql php5-curl php5-xsl php5-cli zip

Ubuntu Mysql Config

While installing the lamp stack, it will pop a screen as shown bellow to configure our mariadb server and will ask us to enter a new password for the root user of database server. We'll enter the root password we wanna assign and then continue for the installation. This root password should be noted which we'll need to configure the database for dolphin.

On CentOS 7

# yum install httpd mariadb-server mariadb php php-gd php-mysql php-curl php-xsl php-cli php-mbstring zip

On Fedora 22

# dnf install httpd mariadb mariadb-server php php-gd php-mysql php-curl php-xsl php-cli php-mbstring zip

2. Installing Java and ImageMagick

As some of dolphin’s features requires media streaming capabilities, we'll need to setup Java and ImageMagick in our machine. To do so, we'll need to execute the following command with respect to our distribution of linux.

On Ubuntu 14.04

# apt-get install openjdk-7-jdk ImageMagick

On CentOS 7

# yum install java-1.7.0-openjdk ImageMagick

On Fedora 22

# dnf install java-1.7.0-openjdk ImageMagick

3. Installing an MTA

If we want enable our Dolphin application to send emails, then we'll need to setup an MTA. The most popular MTA (Mail Transfer Agent) in linux is Postfix. We'll need to install postfix and configure it.

On Ubuntu 14.04

We can install postfix in ubuntu by running the following apt command.

# apt-get install postfix

On CentOS 7

We can install postfix in CentOS  by running the following yum command.

# yum install postfix

On Fedora 22

In Fedora 22, we can install it using dnf package manager.

# dnf install postfix

After installing, we'll need to edit the configuration of our postfix configuration using a text editor.

# nano /etc/postfix/main.cf

Then, we'll need to replace the value of myhostname parameter to our FQDN ie social.linoxide.com .

myhostname = social.linoxide.com

4. Starting Apache and MariaDB server

Next, we’ll gonna start our newly installed apache web server and mariadb database server in our linux box. To do so, we'll need to execute the following commands.

On Ubuntu 14.04

As Ubuntu 14.04 is shipped with SysVinit as init system, we'll need to run the following command to start our apache web server and mariadb

# service mysql start
# service apache2 start

In Ubuntu, both mariadb and apache servers are set to start automatically in every system boot by default. So, we'll no need to configure it for that.

On CentOS 7/Fedora 22

Both CentOS 7 and Fedora 22 runs systemd as the default init system, we'll run the following command to start our httpd and mariadb services.

# systemctl start httpd mariadb

Next, we'll enable them to start automatically in every startup of init system using the following command.

# systemctl enable httpd and mariadb

ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'

5. Configuring MariaDB

As we have already assigned a root password for our mariadb database server in Ubuntu, we'll simply skip this step for Ubuntu. But as we haven't assigned it for our CentOS and Fedora, if we are running CentOS or Fedora, we'll need to follow this step in order to configure it.

On CentOS 7/Fedora 22

Now, as we are starting MariaDB for the first time and no password has been assigned for MariaDB so, we’ll first need to configure a root password for it. Then, we’ll gonna create a new database so that it can store data for our Dolphin Pro installation.

To configure MariaDB and assign a root password, we’ll need to run the following command.

# mysql_secure_installation

This will ask us to enter the password for root but as we haven’t set any password before and its our first time we’ve installed mariadb, we’ll simply press enter and go further. Then, we’ll be asked to set root password, here we’ll hit Y and enter our password for root of MariaDB. Then, we’ll simply hit enter to set the default values for the further configurations.

….
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

installation should now be secure.

Thanks for using MariaDB!

6. Creating new Database

Once we have assigned password to our root user of database server, we'll start creating our new database for Dolphin Pro. To do so, first we'll need to login to our MariaDB console by running the following command.

# mysql -u root -p

After executing the above command, it will ask us to enter the password for our root which we had just defined in the above step. Then, we'll be welcomed into the MariaDB console in which we'll create our new database, database user and assign its password and permissions to create, remove and edit the tables and data stored in it.

> CREATE DATABASE dolphindb;
> CREATE USER 'dolphinuser'@'localhost' IDENTIFIED BY 'Pa$$worD123';
> GRANT ALL PRIVILEGES ON dolphindb.* TO 'dolphinuser'@'localhost';
> FLUSH PRIVILEGES;
> EXIT;

Creating New Database

Once everything above is done as expected, we’ve successfully created a database named dolphindb with username dolphinuser and password as Pa$$worD123 .

Note: It is strongly recommended to replace the above variables as your desire for the security issue.

7. Downloading Dolphin Pro

We'll now download the latest release of Dolphin Pro from their Official SourceForge.net page ie http://sourceforge.net/projects/boonex-dolphin/ . As the latest release of Dolphin Pro while writing this article was version 7.2.1, we'll gonna download it via curl and then extract it under the Apache Webroot.

# cd /tmp/
# curl -LJO http://sourceforge.net/projects/boonex-dolphin/files/Dolphin/7.2/Dolphin-v.7.2.1.zip/download

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
4 456 0 0 100 19 0 26 --:--:-- --:--:-- --:--:-- 26
0 351 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
100 29.8M 100 29.8M 0 0 6646k 0 0:00:04 0:00:04 --:--:-- 9.8M
curl: Saved to filename 'Dolphin-v.7.2.1.zip'

After its extracted, we'll run the following unzip command to extract it and then we'll move it to the default apache webroot directory ie /var/www/html/ .

# unzip Dolphin-v.7.2.1.zip
# mv Dolphin-v.7.2.1 /var/www/html/dolphin

8. Configuring Apache Server

Next, we'll gonna configure our Apache Server so that dolphin will run with proper configuration. To do so, we'll create a new virtualhost by creating a new conf file named dolphinpro.conf . The directory here may differ from one distribution to another, here is how we create in the following distributions of linux.

On Ubuntu 14.04

# touch /etc/apache2/sites-available/dolphinpro.conf
# ln -s /etc/apache2/sites-available/dolphinpro.conf /etc/apache2/sites-enabled/dolphinpro.conf
# nano /etc/apache2/sites-available/dolphinpro.conf

Now, we'll gonna add the following lines of configuration into this file using our favorite text editor.

<VirtualHost *:80>
ServerAdmin info@social.linoxide.com
DocumentRoot /var/www/html/dolphin/
ServerName social.linoxide.com
ServerAlias www.social.linoxide.com
<Directory /var/www/html/dolphin/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/apache2/social.linoxide.com-error_log
CustomLog /var/log/apache2/social.linoxide.com-access_log common
</VirtualHost>

After done, we'll gonna save the file and exit our text editor. Then, we'll restart our Apache Web server.

# service apache2 restart

On CentOS 7/Fedora 22

In CentOS and Fedora, we'll directly create the file dolphin.conf under /etc/httpd/conf.d/ directory using our favorite text editor.

# nano /etc/httpd/conf.d/dolphin.conf

Then, we'll gonna add the following lines of configuration into the file.

<VirtualHost *:80>
ServerAdmin info@social.linoxide.com
DocumentRoot /var/www/html/dolphin/
ServerName social.linoxide.com
ServerAlias www.social.linoxide.com
<Directory /var/www/html/dolphin/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/httpd/social.linoxide.com-error_log
CustomLog /var/log/httpd/social.linoxide.com-access_log common
</VirtualHost>

Once done, we'll simply save the file and exit the editor. And then, we'll gonna restart our apache web server.

# systemctl restart httpd

9. Configuring PHP

We'll now configure our PHP configuration file so that it will fulfill the requirements of Dolphin Pro. Configuring PHP as required for Dolphin will result in the best performance it can give. To configure PHP, we'll need to edit the php.ini file in our linux machine whose path differs from distribution to distribution.

On Ubuntu

Php.ini file is located under /etc/php5/apache2/ directory in Ubuntu distributions. So, we'll need to run the following command to edit php.ini with our favorite text editor.

# nano /etc/php5/apache2/php.ini

On CentOS 7/Fedora 22

It is located under /etc directory in CentOS and Fedora distributions. So, we'll run the following command to edit it.

# nano /etc/php.ini

After the file is opened using a text editor, we'll need to append the file with the following configurations.

register_globals = Off
safe_mode = Off
memory_limit = 128M
short_open_tag = On
file_uploads = On
allow_url_fopen = On
allow_url_include = Off
magic_quotes_gpc = Off
default_charset = "UTF-8"

10. Fixing Permissions and Ownership

Now, we'll gonna fix some file permissions and ownership of the dolphin's installation path. First, we'll gonna set the ownership of the dolphin's installation directory to Apache process owner so that apache web server will have full access of the files and directories to edit, create and delete.

On Ubuntu 14.04

# chown www-data: -R /var/www/html/dolphin

On CentOS 7/Fedora 22

# chown apache: -R /var/www/html/dolphin

Setting Permission

Then, we'll need to change the permission of some directories and files as follows.

# cd /var/www/html/dolphin
# chmod 755 flash/modules/global/app/ffmpeg.exe

11. Allowing Firewall

Now, we'll gonna configure our firewall programs to allow port 80 (http) so that our apache web server running Dolphin Pro will be accessible from other machines in the network across the default http port ie 80.

On Ubuntu 14.04

Iptables is a popular firewall program which is installed in the ubuntu distributions by default. To expose port 80, we'll need to run the following commands in a terminal or console.

# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# /etc/init.d/iptables save

On CentOS 7/Fedora 22

As CentOS 7 has systemd installed by default, it contains firewalld running as firewall program. In order to open the port 80 (http service) on firewalld, we'll need to execute the following commands.

# firewall-cmd --permanent --add-service=http

success

# firewall-cmd --reload

success

12. Accessing Web Interface

Finally, after everything is setup and configured in above steps, we'll now go for accessing the web installation process of Dolphin Pro. To do so, we'll need to point our web browser to http://ip-address/ or http://domain.com . Here, in this tutorial, we'll point our browser to http://social.linoxide.com/ . After done, we'll be welcomed by the Dolphin Pro Installation Page as shown below.

Dolphin Web Installation Homepage

Now, we'll gonna click on INSTALL button and get started towards the installation of Dolphin. After that, we'll navigated to next page which shows if all the files and directories have all the required permissions or not. As we have already set the permissions and ownership in the above step, we'll see everything correct with all the things in green color. Then, we'll click on Next button to continue.

Checking Directory File Permission

We can see that Dolphin checks general script paths and as we have already completed those required things, we'll see everything green in color. Then, we'll go further by clicking on Next.

Checking Scripts Path

Now here is the main part of the installation where we'll set the database information so that Dolphin will be able to have full control over its database. We'll keep host port number and socket path blank so that they will pick the default configurations. We'll need to set the database name, database user and password that we had set while creating our new database. Here, in this article, we have set dolphindb, dolphinuser and Pa$$worD123 as the database name, user and password respectively.

Configuring Database Web Interface

After done, we'll click Next and go further towards the Site Configuration page where we'll set the information of our Social networking site.

Configuring Site Information

Now, we'll need to add a new cron job which will run the script in every minute by running the following command in our linux machine.

Add Dolphin Cron Jobs

# crontab -e

We'll need to add the following lines into the opened text editor.

MAILTO=admin@social.linoxide.com
* * * * * cd /var/www/html/dolphin/periodic; /usr/bin/php -q cron.php

Permission Reversal

After done, we'll need to set Non-writable permission to the inc directory as we can seen above. And it can be done by running the following command.

# chmod -w /var/www/html/dolphin/inc

Dolphin Installed Successfully

 

13. Post Installation

Finally, as everything is setup and ready to go, we'll now need to complete a post installation task. We'll now need to remove the install directory for security measures. That can be done by executing the following command.

# rm -rf /var/www/html/dolphin/install/

Now, we'll be able to login to the Dashboard by logging in using username and password that we had just assigned in the above step. Next, we'll first need to add all those modules needed for our social networking site.

Dolphin Modules Page

And the default homepage of our social networking site will look as below.

Dolphin Social Site Homepage

Conclusion

Dolphin powers more than 300,000 web communities, online dating sites and social networking sites. It is highly extensible with its thousands of extensions, integrations, templates and language packs available at BoonEx Market. There are native open-source iOS and Android apps that we can customise as well as re-brand on our desire for our social networking website. This CMS fulfills the dream of many non technical people to run their own social networking website. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you !

The post How to Build Our Own Social Networking Site with Dolphin Pro appeared first on LinOxide.


How to Configure vTiger CRM on CentOS 7

$
0
0

vTiger CRM is a web based, modular and complete Open Source full-fledged customer relationship management system for sales force automation, customer support & service, marketing automation, procurement & fulfillment effectively. In addition to managing your customer data, vtiger offers also connectivity to a variety of other software systems in the existing software architecture. So vtiger can be connected to enterprise resource planning (ERP) systems without any problems, for example, to integrate already existing data into other critical processes of your business.

Vtiger CRM is a native thin-client, browser-based application built on the LAMP/WAMP (Linux/Windows, Apache, MySQL and PHP) stack. We will be going to install it on Linux CentOS 7 with LAMP setup.

1) Basic System Setup

Prepare your system with your minimum required system resources to install CentOS 7 and minimal packages on it and make sure that you have configured your server with a fully qualified domain name and are connected to Internet.

Then login to your server with root user or sudo user and update your with latest update with below command.

# yum update

2) LAMP Setup

You consider following our previous article to setup LAMP setup on CentOS 7 in details. We will be using Apache web server with MySQL MariaDB and PHP as a prerequisites of vTiger CRM installation on CentOS 7.

Starting the installation process of LAMP stack, let's run the below command that is all in one for installing Apache,MySLQ and PHP with required libraries.

# yum install httpd php gd gd-devel php-gd php55w php55w-mysql mariadb-server php55w-mcrypt php55w-dom php55w-imap php55w-mbstring

Press on the 'Y' key and enter to continue installing all the packages including their dependencies as shown in the image below.

AMP installation

To start and enable services run automatically at the time of boot up, run the following commands.

# systemctl start httpd
# systemctl enable httpd

# systemctl start mariadb
# systemctl enable mariadb

3) vTiger DB Setup

After LAMP installation, now we connect to the MySQL/MariaDB after setting up its root user using below commands.

# mysql_secure_installation

After executing the above command you will asked for few configurations to secure your database. Let's choose the appropriate options as shown.

Secure MySQL

Now we can connect to the MySQL/MariaDB console using the root password. After connecting run the commands below to create a new database and its user with specific user rights on the vtiger DB.

# mysql -u root -p
> CREATE DATABASE vtiger;
> CREATE USER 'vtiger'@'localhost' IDENTIFIED BY 'tiger***';
> grant all privileges on `vtiger`.* to 'vtiger'@'localhost';
> FLUSH PRIVILEGES;
> exit

vtiger DB

4) Setup vTiger Download

To download the installation package of vTiger for Linux, open the link of vTiger Download Page .

vTiger Download

You can also copy the link of download source then use the below command to get it on your server.

# wget http://sourceforge.net/projects/vtigercrm/files/vtiger%20CRM%206.4.0/Core%20Product/vtigercrm6.4.0.tar.gz

To extract and move the package into the web document root directory use below commands.

# tar -zxvf vtigercrm6.4.0.tar.gz

# mv vtigercrm /var/www/html/

# chown apache: -R /var/www/html/vtigercrm

5) vTiger Web Installation

Its time to start the web installation of vTiger on CentOS 7. Open your web browser and point the URL below.

http://172.25.10.173/vtigercrm/

Installing vTiger

Welcome to Vtiger CRM 6 Setup Wizard.
This wizard will guide you through the installation of Vtiger CRM6, click on the 'INSTALL' button to proceed forward and accept the License agreement for using vTiger CRM.

License Agreement
vTiger Agreement

Next you will reach at the Prerequisites check page where you will see the difference between and required and the current values. You might need to fix some parameters in the configuration file of PHP that 'php.ini' according the recommended settings shown in this section.

Make sure to restart Apache services after make changes in PHP file and click on the retest button to verify all the prerequisites are fine.

Prerequisites Check
Prerequisites check

Choose the system configurations with data base and admin user settings.

System Configurations
system configurations

In the next step you can verify all settings to finalize database, system and admin user settings.

Final Configurations
final configurations

The last step is to choose the type of your industry then it will takes few minutes to complete the installation.

Installation Progress
installation process

Choose you required CRM modules from the list of its different available features and click on the NExt button to complete the installation.

vTiger Modules
vTiger Modules

That's it, you have completed the web installation setup of vTiger CRM. Now you can see its web dashboard where you can add widgets to customize your dashboard according to your own way.

vTiger CRM dashboard

Conclusion

You can use the VTiger to enhance your marketing campaign creation and management, sales force automation, using the same solid features, benefits and more than those solutions. They support security, inventory and activity management. vTiger is all in one CRM solution that provide the complete solution for managing your users, sales or support department of your industry. Thanks for reading this article and leave your valuable comments or suggestions.

The post How to Configure vTiger CRM on CentOS 7 appeared first on LinOxide.

How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2

$
0
0

Nginx is free and open source HTTP server and reverse proxy, as well as an mail proxy server for IMAP/POP3. Nginx is high performance web server with rich of features, simple configuration and low memory usage. Originally written by Igor Sysoev on 2002, and until now has been used by a big technology company including Netflix, Github, Cloudflare, WordPress.com etc.

In this tutorial we will "install and configure nginx web server as reverse proxy for apache on freebsd 10.2". Apache will run with php on port 8080, and then we need to configure nginx run on port 80 to receive a request from user/visitor. If user request for web page from the browser on port 80, then nginx will pass the request to apache webserver and PHP that running on port 8080.

Prerequisite 

  • FreeBSD 10.2.
  • Root privileges.

Step 1 - Update the System

Log in to your freebsd server with ssh credential and update system with command below :

freebsd-update fetch
freebsd-update install

Step 2 - Install Apache

pache is open source HTTP server and the most widely used web server. Apache is not installed by default on freebsd, but we can install it from the ports or package on "/usr/ports/www/apache24" or install it from freebsd repository with pkg command. In this tutorial we will use pkg command to install from the freebsd repository :

pkg install apache24

Step 3 - Install PHP

Once apache is installed, followed with installing php for handling a PHP file request by a user. We will install php with pkg command as below :

pkg install php56 mod_php56 php56-mysql php56-mysqli

Step 4 - Configure Apache and PHP

Once all is installed, we will configure apache to run on port 8080, and php working with apache. To configure apache, we can edit the configuration file "httpd.conf", and for PHP we just need to copy the php configuration file php.ini on "/usr/local/etc/" directory.

Go to "/usr/local/etc/" directory and copy php.ini-production file to php.ini :

cd /usr/local/etc/
cp php.ini-production php.ini

Next, configure apache by editing file "httpd.conf" on apache directory :

cd /usr/local/etc/apache24
nano -c httpd.conf

Port configuration on line 52 :

Listen 8080

ServerName configuration on line 219 :

ServerName 127.0.0.1:8080

Add DirectoryIndex file that apache will serve it if a directory requested on line 277 :

DirectoryIndex index.php index.html

Configure apache to work with php by adding script below under line 287 :

<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>

Save and exit.

Now add apache to start at boot time with sysrc command :

sysrc apache24_enable=yes

And test apache configuration with command below :

apachectl configtest

If there is no error, start apache :

service apache24 start

If all is done, verify that php is running well with apache by creating phpinfo file on "/usr/local/www/apache24/data" directory :

cd /usr/local/www/apache24/data
echo "<?php phpinfo(); ?>" > info.php

Now visit the freebsd server IP : 192.168.1.123:8080/info.php.

Apache and PHP on Port 8080

Apache is working with php on port 8080.

Step 5 - Install Nginx

Nginx high performance web server and reverse proxy with low memory consumption. In this step we will use nginx as reverse proxy for apache, so let's install it with pkg command :

pkg install nginx

Step 6 - Configure Nginx

Once nginx is installed, we must configure it by replacing nginx file "nginx.conf" with new configuration below. Change the directory to "/usr/local/etc/nginx/" and backup default nginx.conf :

cd /usr/local/etc/nginx/
mv nginx.conf nginx.conf.oroginal

Now create new nginx configuration file :

nano -c nginx.conf

and paste configuration below :

user  www;
worker_processes  1;
error_log  /var/log/nginx/error.log;

events {
worker_connections  1024;
}

http {
include       mime.types;
default_type  application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log;

sendfile        on;
keepalive_timeout  65;

# Nginx cache configuration
proxy_cache_path    /var/nginx/cache levels=1:2 keys_zone=my-cache:8m max_size=1000m inactive=600m;
proxy_temp_path     /var/nginx/cache/tmp;
proxy_cache_key     "$scheme$host$request_uri";

gzip  on;

server {
#listen       80;
server_name  _;

location /nginx_status {

stub_status on;
access_log off;
}

# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /50x.html {
root   /usr/local/www/nginx-dist;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:8080
#
location ~ \.php$ {
proxy_pass   http://127.0.0.1:8080;
include /usr/local/etc/nginx/proxy.conf;
}
}

include /usr/local/etc/nginx/vhost/*;

}

Save and exit.

Next, create new file called proxy.conf for reverse proxy configuration on nginx directory :

cd /usr/local/etc/nginx/
nano -c proxy.conf

Paste configuration below :

proxy_buffering         on;
proxy_redirect          off;
proxy_set_header        Host            $host;
proxy_set_header        X-Real-IP       $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size    10m;
client_body_buffer_size 128k;
proxy_connect_timeout   90;
proxy_send_timeout      90;
proxy_read_timeout      90;
proxy_buffers           100 8k;
add_header              X-Cache $upstream_cache_status;

Save and exit.

And the last, create new directory for nginx cache on "/var/nginx/cache" :

mkdir -p /var/nginx/cache

Step 7 - Configure Nginx VirtualHost

In this step we will create new virtualhost for domain "saitama.me", with document root on "/usr/local/www/saitama.me" and the log file on "/var/log/nginx" directory.

First thing we must do is creating new directory to store the virtualhost file, we here use new directory called "vhost". Let's create it :

cd /usr/local/etc/nginx/
mkdir vhost

vhost directory has been created, now go to the directory and create new file virtualhost. I'me here will create new file "saitama.conf" :

cd vhost/
nano -c saitama.conf

Paste virtualhost configuration below :

server {
# Replace with your freebsd IP
listen 192.168.1.123:80;

# Document Root
root /usr/local/www/saitama.me;
index index.php index.html index.htm;

# Domain
server_name www.saitama.me saitama.me;

# Error and Access log file
error_log  /var/log/nginx/saitama-error.log;
access_log /var/log/nginx/saitama-access.log main;

# Reverse Proxy Configuration
location ~ \.php$ {
proxy_pass http://127.0.0.1:8080;
include /usr/local/etc/nginx/proxy.conf;

# Cache configuration
proxy_cache my-cache;
proxy_cache_valid 10s;
proxy_no_cache $cookie_PHPSESSID;
proxy_cache_bypass $cookie_PHPSESSID;
proxy_cache_key "$scheme$host$request_uri";

}

# Disable Cache for the file type html, json
location ~* .(?:manifest|appcache|html?|xml|json)$ {
expires -1;
}

# Enable Cache the file 30 days
location ~* .(jpg|png|gif|jpeg|css|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ {
proxy_cache_valid 200 120m;
expires 30d;
proxy_cache my-cache;
access_log off;
}

}

Save and exit.

Next, create new log directory for nginx and virtualhost on "/var/log/" :

mkdir -p /var/log/nginx/

If all is done, let's create a directory for document root for saitama.me :

cd /usr/local/www/
mkdir saitama.me

Step 8 - Testing

This step is just test our nginx configuration and test the nginx virtualhost.

Test nginx configuration with command below :

nginx -t

If there is no problem, add nginx to boot time with sysrc command, and then start it and restart apache:

sysrc nginx_enable=yes
service nginx start
service apache24 restart

All is done, now verify the the php is working by adding new file phpinfo on saitama.me directory :

cd /usr/local/www/saitama.me
echo "<?php phpinfo(); ?>" > info.php

Visit the domain : www.saitama.me/info.php.

Virtualhost Configured saitamame

Nginx as reverse proxy for apache is working, and php is working too.

And this is another results :

Test .html file with no-cache.

curl -I www.saitama.me

html with no-cache

Test .css file with 30day cache.

curl -I www.saitama.me/test.css

css file 30day cache

Test .php file with cache :

curl -I www.saitama.me/info.php

PHP file cached

All is done.

Conclusion

Nginx is most popular HTTP server and reverse proxy. Has a rich of features with high performance and low memory/RAM usage. Nginx use too for caching, we can cache a static file on the web to make the web fast load, and cache for php file if a user request for it. Nginx is easy to configure and use, use for HTTP server or act as reverse proxy for apache.

The post How to Install Nginx as Reverse Proxy for Apache on FreeBSD 10.2 appeared first on LinOxide.

How to Setup MEAN.IO Stack on Ubuntu 15.04 / CentOS 7

$
0
0

MEAN.IO is a complete stack of necessary framework which simplifies and accelerates web application development. MEAN.IO is a full-stack free and open source software that helps us to build and run MongoDB, Express, AngularJS, and Node.js based web applications. It acts as a robust framework to help developers use better practices while working with popular JavaScript components for their daily development. MEAN.IO stack helps us to start developing web application in a properly managed way. Its prime focus is to take care of the connection between existing popular frameworks and to solve common issues.

Here are some easy steps on how we can setup MEAN.IO stack on linux machine running Ubuntu 15.04 and CentOS 7 as operating system.

1. Installing NodeJS

First of all, we'll need to setup the most important and key program behind every scene ie NodeJS. NodeJS is pretty easy to install in linux machine running Ubuntu or CentOS.

Installing Dependencies

On Ubuntu 15.04

We'll first need to update our local repository index in order to retrieve required updates of the package lists available in the repository. To do so, we'll need to run the following apt-get command.

$ sudo apt-get update
$ sudo apt-get install gcc g++ make build-essential libssl-dev git

On CentOS 7

In the machine running CentOS 7, we'll need to run yum update in order to update every packages installed in the system. We'll need to run the command under root or sudo access.

$ sudo yum update

After that, we'll install the essential development packages need to compile our NodeJS.

$ sudo yum install gcc gcc-c++ git

Installing dependencies centos7

Downloading and Extracting

After the dependencies are installed, we'll download the latest release of NodeJS from the official download server using wget.

$ wget https://nodejs.org/download/release/node-latest.tar.gz -O /tmp/node-latest.tar.gz

--2015-11-22 05:01:17-- https://nodejs.org/download/release/node-latest.tar.gz
Resolving nodejs.org (nodejs.org)... 2400:cb00:2048:1::6814:172e, 2400:cb00:2048:1::6814:162e, 104.20.22.46, ...
Connecting to nodejs.org (nodejs.org)|2400:cb00:2048:1::6814:172e|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 22470092 (21M) [application/gzip]
Saving to: '/tmp/node-latest.tar.gz'
/tmp/node-latest.tar. 100%[=========================>] 21.43M 3.77MB/s in 6.9s
2015-11-22 05:01:25 (3.10 MB/s) - '/tmp/node-latest.tar.gz' saved [22470092/22470092]

$  tar -xvzf /tmp/node-latest.tar.gz

Compiling and Installing

Once the extraction of the tarball is completed, we'll continue further for the compilation of the source code of NodeJS. To do so, first, we'll need to check if every development dependencies are installed or not using ./configure command. Then, we'll compile the source code using make command which will take a lot time to finish the compilation and finally install the binary in our machine using make install command.

$ cd node-v5.1.0
$ ./configure
$ make
$ sudo make install

After the installation is complete, we'll gonna check if node was successfully installed or not by asking node its version.

$ node --version

v5.1.0

Common Error and Fixes in CentOS 7

On running node commands with sudo, we may get error sudo: npm: command not found on our shell. To fix that, we'll need to run the following commands in a terminal or console.

$ sudo ln -s /usr/local/bin/node /usr/bin/node
$ sudo ln -s /usr/local/lib/node /usr/lib/node
$ sudo ln -s /usr/local/bin/npm /usr/bin/npm
$ sudo ln -s /usr/local/bin/node-waf /usr/bin/node-waf

2. Installing MongoDB

Next, we'll install MongoDB, a free and open source document-oriented database server which is also know as NoSQL database server. It is designed for handling document-oriented storage and stores data in JSON-like documents with dynamic schema known as BSON which makes the integration of data in certain types of applications easier and faster. To install MongoDB, we'll need to follow the below setups with respect to the distribution of linux we are running.

On Ubuntu 15.04

We'll now need to add the MongoDB official repository to our source list so that we can fetch the package list and path of it. To do so, we'll need to run the following command in a terminal or console.

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
$ sudo echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list

After that, we'll gonna update our local repository index with that of the mongodb repository using apt-get command.

$ sudo apt-get update

Now, we'll need to run the following command in order to install it in our Ubuntu machine.

$ sudo apt-get install -y mongodb-org

On CentOS 7

In the machine running CentOS 7, we'll gonna install the latest stable mongodb release ie version 3.0 using yum package manager. To do so, first we'll need to add the repository in our operating system which can be done using a text editor.

$ sudo nano /etc/yum.repos.d/mongodb-org-3.0.repo

After opening the file with a text editor, we'll need to append the file with the following lines of configurations.

[mongodb-org-3.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/
gpgcheck=0
enabled=1

Adding MongoDB Repo Centos 7

Then, we'll save the file and exit the text editor. Next, we'll install the mongodb using yum package manager by running the following command.

$ sudo yum install mongodb-org

3. Starting and Enabling MongoDB

After our MongoDB is installed, we'll now gonna start our MongoDB server and make it run automatically in every boot. To do so, we'll need to run the following commands.

As Systemd is the default service/daemon, process manager replacing SysVinit in Ubuntu 15.04 and CentOS 7, we'll gonna run the following command in order to start the mongodb server.

$ sudo systemctl start mongod

Now, to enable mongod to start in every system boot, we'll need to execute the following command.

$ sudo systemctl enable mongod

4. Installing Bower

As we have got Nodejs and NPM installed, we'll now gonna install Bower package manager in our linux machine. Bower package manager manages front-end packages for our web application. It provides hooks to facilitate using packages in our tools and workflows. It fetches and installs necessary stuffs from all over making everything frameworks, libraries, assets, utilities, and rainbows managed for the developer. To install bower, we'll need to run the following command.

$ sudo npm install -g bower

/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
/usr/local/lib
└── bower@1.6.5

5. Installing Gulp

Next, we'll also need to install gulp task manager to automate and enhance our workflow. Gulp is a free and open source JavaScript task runner which makes repetitive tasks like minification, compilation, linting, unit testing, etc pretty easy and fast with its primary feature ie automation. It is used to automate our development process which makes our repetitive task easy to perform. To install gulp globally, we'll need to run the following command.

$ sudo npm install -g gulp

6. Installing mean-cli

Now, we'll install the mean-cli package using npm. This will add mean command to our system which will let us to interact (install, manage, update, etc) our Mean based application. To install it, we'll need to run the following npm command.

$ sudo npm install -g mean-cli

7. Generating MEAN Application

The application generator will ask us some questions about our new application and will create a fresh copy of a MEAN.IO application in the working directory. To do so, we'll need to run the following yo command into our project directory.

$ mean init test-app

Next, we'll install all the dependencies required to run our mean application by running the following command.

$ cd test-app && npm install

mean@0.5.5 postinstall /home/arun/test-app
> node tools/scripts/postinstall.js

$ bower install

8. Running the Application

After the MEAN application has been generated, we'll now finally run our newly created application. To run our application, we'll need to execute gulp command into our MEAN application directory.

$ gulp

Running Mean App

Now, as our application is running, we should be able to browse our web application. To do so, we'll point our favorite web browser to the server running the application. As  gulp runs the applications under port 3000 by default so, we'll point our browser to http://ip-address:3000 or http://domain.com:3000.

Mean App Web Interface

If we wanna assign a port for our application, we can simply run the following command.

$ export PORT=3001 && gulp

Conclusion

Finally, we have successfully setup MEAN.IO stack for deploying our MEAN based application on our machine running CentOS 7 and Ubuntu 15.04. It is an awesome framework for an easy starting point with MongoDB, Node.js, Express, and AngularJS based applications. It a complete replacement for our traditional LAMP Stack. It helps us to save a long time required to build our custom MEAN stack as its pretty easy with just few commands to setup a complete MEAN stack. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you !

The post How to Setup MEAN.IO Stack on Ubuntu 15.04 / CentOS 7 appeared first on LinOxide.

How to Install Ajenti with Nginx and SSL on FreeBSD 10.2

$
0
0

Ajenti is open source web based system management tools, control panel for your server based on python. Support for many distro like Ubuntu, CentOS, Debian and Unix FreeBSD. Ajenti coded with python, it is lightweight control panel with beautiful interface. It is allow you to manage your services on your server, manage apache, cron jobs, firewall, mysql database etc. Ajenti is powerfull and easy to install.

In this tutorial we will guide you to install ajenti with nginx as the web server, and then configure SSL for ajenti on freebsd 10.2. we will guide you to install ajenti from pip (Package management in python), install all package needed by ajenti from freebsd ports, and then install and configure nginx to running in front of ajenti with SSL enabled.

Prerequisite

  • FreeBSD 10.2 - 64bit.
  • Root Privileges.

Step 1 - Update FreeBSD Ports

Log in to your freebsd server and update the repository :

freebsd-update fetch
freebsd-update install

Step 2 - Install Package needed

In this step we will install all package that needed by ajenti. We will install all of it from the freebsd ports. Just go to the ports directory "/usr/ports/", then choose the package, compile and install it.

Ajenti need py-gevent, so go to the directory of py-gevent :

cd /usr/ports/devel/py-gevent

then install it with command :

make install clean

install : Compile and install the ports.

clean : Remove the work directory and other temporary files used for building the ports.

Next, Install all of this ports just like install py-gevents above.

# Install py-lxml
cd /usr/ports/devel/py-lxml
make install clean

# Install Pyhton pip
cd /usr/ports/devel/py-pip
make install clean

# Install py-ldap module
cd /usr/ports/net/py-ldap
make install clean

# Install jpeg module that needed by Pillow python imaging library.
cd /usr/ports/graphics/jpeg
make install clean

Wait all of it.

Step 3 - Install Ajenti

On linux distribution like ubuntu and centos, we can install ajenti from the repository. But in this tutorial FreeBSD 10.2, we will install ajenti from the pip command. Pip is a package management system used to install and manage software packages written in Python.

So let's install :

pip install ajenti

Now configure it.

Step 4 - Configure Ajenti

Download ajenti service script from github to "/etc/rc.d/" directory with wget command :

wget --no-check-certificate https://raw.github.com/ajenti/ajenti/1.x/packaging/files/ajenti-bsd -O /etc/rc.d/ajenti

Next, change the permission of service file :

chmod +x /etc/rc.d/ajenti

Service script for ajenti is configured, so let's download the configuration file for ajenti. Before we download it, we need to make a symlink for python binary command :

ln -s /usr/local/bin/python2 /usr/bin/python

And create new directory for ajenti configuration file :

mkdir -p /usr/local/etc/ajenti/
mkdir -p /etc/ajenti/

Next, download the configuration file to directory "/usr/local/etc/ajenti/", and create a symlink for config file to directory "/etc/ajenti/" :

wget --no-check-certificate https://github.com/ajenti/ajenti/raw/1.x/config.json -O /usr/local/etc/ajenti/config.json
ln -s /usr/local/etc/ajenti/config.json /etc/ajenti/config.json

Then edit the config file with nano editor :

nano -c /etc/ajenti/config.json

On the line 35, change the value to "true".

"authentication": true,

Save and exit.

If all is done, add ajenti to run at boot time with sysrc command, and then start it :

sysrc ajenti_enable=yes
service ajenti start

Visit your server IP on port 8000, 192.168.1.103:8000.

Ajenti Home Page

Step 5 - Generate Self Signed SSL Certificate

In this step we will generate new self signed SSL certificate. Go to "/usr/local/etc/" directory and make new directory called "ssl".

cd /usr/local/etc/
mkdir ssl
cd /usr/local/etc/ssl

Now generate the self signed SSL certificate file with single openssl command :

openssl req -new -x509 -nodes -out ajenti.crt -keyout ajenti.key
FILL With YOUR INFO

Now change permission of the private key :

chmod 600 ajenti.key

SSL Generated on directory "/usr/local/etc/ssl/".

Step 6 - Install and Configure Nginx

In this tutorial we will use nginx as reverse proxy for ajenti that running on port 8000. Install nginx from the freebsd repository with pkg command :

pkg install nginx

Next, Configure the virtualhost for ajenti.

Go to nginx directory and create new directory for virtualhost called "vhost" :

cd /usr/local/etc/nginx/
mkdir vhost

Go to vhost directory and create new file ajenti.conf with nano editor :

cd /usr/local/etc/nginx/vhost
nano -c ajenti.conf

Paste nginx virtualhost configuration below :

server {

# Domain
server_name myajenti.co;
client_max_body_size 20m;

# Nginx listening on port 80 and 443
listen 80;
listen [::]:80;
listen 443 default ssl;

# SSL Certificate File
ssl_certificate      /usr/local/etc/ssl/ajenti.crt;
ssl_certificate_key  /usr/local/etc/ssl/ajenti.key;

# Redirect HTTP to HTTPS
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}

# Proxy pass configuration for ajenti
location ~ /ajenti.* {
rewrite (/ajenti)$ / break;
rewrite /ajenti/(.*) /$1 break;
proxy_pass http://127.0.0.1:8000;
proxy_redirect / /ajenti/;
proxy_set_header Host $host;
proxy_set_header Origin http://$host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}

}

Save and exit.

Now activate the nginx virtualhost by editing the main configuration file nginx.conf on nginx directory :

cd /usr/local/etc/nginx/
nano -c nginx.conf

Add before the end of the line below :

 includ vhost/*.conf

Save and exit.

Now add nginx to the boot time, then start it and restart ajenti :

sysrc nginx_enable=yes
service nginx start
service ajenti restart

Visit your domian : myajenti.co/ajenti

ajenti with nginx and ssl

Log in to ajento with the default account username "root" and password "admin".

Ajenti Dashbord.

Ajenti Dashbord

List of Ajenti Plugins.

Ajenti Plugins

Service page to manage the service on the server.

Ajenti Service page

Ajenti with nginx and SSL is installed on FreeBSD 10.2.

Conclusion

Ajenti is web based system management tools based on python. It is lightweight and powerful, we can manage the service of the server from the admin web. Available on Linux and Unix distribution including FreeBSD. We can start and stop the service from the web page. Ajenti run on port 8000, and we can use Nginx or apache as the reverse proxy for ajenti with SSL enabled on the front end web server(Nginx or Apache). It is easy to install and configure an have a beautiful Interface.

The post How to Install Ajenti with Nginx and SSL on FreeBSD 10.2 appeared first on LinOxide.

How to Install Open-audIT on CentOS 6 / 7

$
0
0

Managing your IT infrastructure is always been a hard job if you are not taking advantage of free and Open Source network discovery, inventory and auditing application like Open-audit. It actually tell you exactly what is on your network, how it is configured and when it changes. So, we say that Open-AudIT is a database that contains the information about all the devices connected in our network then shows them on the web interface. The Open-AudIT application is written in php, bash and vbscript that makes the changes and customization both quick and easy.

To scan network and its devices automatically Open-AudIT can be configured with daily scan as per recommended for systems. That way, you can be assured of being notified if something changes. Its powerful reporting framework enables information such as software licensing, configuration changes, non-authorized devices, capacity utilization and hardware warranty status with its ability to request Reports to be run on a pre-defined schedule and emailed.

Basic Requirements

There are few basics requirements that must be figured out before the start of Open-audIT installation setup on CentOS 6/7.

1- FQDN, Hostname
2- System Update
3- Apache Web Server
4- PHP Configurations
5- MySQL Database
6- Nmap and SNMP

1) Hostname

Starting from first step, login to your centOS 6/7 server using the root or sudo user. Configure your network and host name settings by opening the hosts file with a text editor.

# vim /etc/hosts

2) System Update

If you are using an old version of CentOS, then you can upgrade it using below command.

# yum upgrade

After that make sure that your CentOS server is upto date with latest security updates and patches. You can update your system with below command.

# yum update

3) Apache, MySQL, PHP

Open-audIT is a web based apploication developed in PHP language. So we need to setup a web server, a data base server and some PHP libraries for a fully functional Open-Audit Web portal.

So, we will be installing all these required packages in one go using the below commands.

# yum -y install epel-release

# yum install httpd mysql mysql-server php php-cli php-mysql php-ldap php-mbstring php-mcrypt php-snmp php-xml nmap net-snmp zip curl perl wget sshpass screen samba-client

Press 'Y' to yes for starting installation of packages, then a list following packages will installed as shown in the image while n centOS 7 MariaDB package will be installed instead of MySQL. Open-AudIT uses Nmap for discovery, sshpass for Linux auditing and screen / samba-client / winexe for Windows auditing without these packages discovery will not work. If you are unable to install winexe using 'yum' the follow this link to get the Winexe RPM Package

# wget http://download.opensuse.org/repositories/home:/ahajda:/winexe/CentOS_CentOS-6/x86_64/winexe-1.00-2.5.x86_64.rpm
# rpm -i winexe-1.00-2.5.x86_64.rpm

Installing Packages

After installation completes start apache web server and and MySQL DB service and configure the both to run automatically at startup.

In centos6

# service httpd start
# chkconfig –levels 235 httpd on

# service mysqld start
# chkconfig –levels 235 mysqld on

In centos7

# systemctl start httpd.service
# systemctl enable httpd.service

# systemctl start mysqld.service
# systemctl enable mysqld.service

Run the command below to setup root password for the MySQL/MariaDB and choose the default options after setting up the new password.

# mysql_secure_installation

4) PHP and Apache Configuration

To configure PHP configurations, Open its default file with a text editor and update its parameters as shown.

[root@open-audit ~]# vim /etc/php.ini

# sed -i -e 's/memory_limit/;memory_limit/g' /etc/php.ini
# echo "memory_limit = 512M" >> /etc/php.ini
# sed -i -e 's/max_execution_time/;max_execution_time/g' /etc/php.ini
# echo "max_execution_time = 300" >> /etc/php.ini
# sed -i -e 's/max_input_time/;max_input_time/g' /etc/php.ini
# echo "max_input_time = 600" >> /etc/php.ini
# sed -i -e 's/error_reporting/;error_reporting/g' /etc/php.ini
# echo "error_reporting = E_ALL" >> /etc/php.ini
# sed -i -e 's/display_errors/;display_errors/g' /etc/php.ini
# echo "display_errors = On" >> /etc/php.ini
# sed -i -e 's/upload_max_filesize/;upload_max_filesize/g' /etc/php.ini
# echo "upload_max_filesize = 10M" >> /etc/php.ini
# sed -i -e 's/date.timezone/;date.timezone/g' /etc/php.ini
# echo "date.timezone = Europe/London" >> /etc/php.ini

PHP Configurations

Now configure the hostname in configuration file of apache web server using below command.

# echo "ServerName open-audit" >> /etc/httpd/conf/httpd.conf

Then change the shell for Apache and restart its services to take effect of the changes made.

[root@open-audit ~]# chsh -s /bin/bash apache
Changing shell for apache.
Shell changed.
[root@open-audit ~]# systemctl restart httpd.service

Using the commands below we will setup the SUID for the nmap binary so that it be used for apache front end to run scripts which call nmap.

[root@open-audit ~]# chmod u+s /usr/bin/nmap

Now run the below command and make sure that you see the IP Address of your Open-AudIT server.

[root@open-audit ~]# ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'

172.25.10.173

It looks great, now our next step is to move forward to start the installation of Open-Audit after downloading its latest package.

Installing Open-Audit

To install Open-Audit, Let's Open the Offical Download Page of Open-Audit to get its latest package put your information.

Download Open-Audit

Or use the the command below after copying the download source to get its package on your server.

# wget http://dl-openaudit.opmantek.com/OAE-Linux-x86_64-release_1.8.4.tar.gz

wget open-audit

Extract the package into '/usr/local' directory using below command.

# tar -zxvf OAE-Linux-x86_64-release_1.8.4.tar.gz -C /usr/local/

Once the package is extracted move to that directory and run the installation script using below command.

[root@open-audit Open-AudIT-1.8.4]# ./installer -t /var/www/html/oa

Here you might come across the below error in CentOS 7.

Can't locate version.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./installer line 38.
BEGIN failed--compilation aborted at ./installer line 38.

To fix, Open the installation script using any editor and comment out line number 38.

After that re run the installation script and it will show that the installer will install Open-AudIT into /var/www/html/oa.

Open Audit Installation

Press "Y" key or Hit to proceed then you will see that a number steps will be performed by this installation script including "Web access", "Updating YUM metadata cache", "Checking Installed Packages" and will also install the missing packages. So, you don't need to worry about if you missed any package to be installed. After that a list of following post installation operations will be performed.

Installing Open-Audit

The installation script will integrates Open-Audit with Apache and Databases, where you will be asked to provide the password for the root user.

++++++++++++++++++++++++++++++++++++++++++++++++++++++
Integration of Open-AudIT with Apache
++++++++++++++++++++++++++++++++++++++++++++++++++++++

Ok to install the updated Apache proxy config file?
Type 'y' or hit to accept, any other key for 'no':
Restarting Apache

++++++++++++++++++++++++++++++++++++++++++++++++++++++
Installing Open-AudIT files
++++++++++++++++++++++++++++++++++++++++++++++++++++++

++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copying Open-AudIT Web files
++++++++++++++++++++++++++++++++++++++++++++++++++++++

++++++++++++++++++++++++++++++++++++++++++++++++++++++
Open-AudIT Database Setup
++++++++++++++++++++++++++++++++++++++++++++++++++++++

We require the MySQL root user credentials to create the database and user.
Enter the MySQL root user's password:

After performing final update operations and Adjusting Open-AudIT for standalone operation to setup Opmantek Daemon Startup, the installation process will be completed as shown below.

Open-audit installation

Open-Audit Web Access

Let's Open you web browser and give your server's IP or FQDN in the address bar then click on the Open Audit button to get started with Open Audit.

Openmantek

Then login with default credentials providing the user and password after that change the credentials.

Open Audit Login

Upon successful credentials you will directed toward the welcome screen of Open Audit as shown.

Welcome to Open Audit

Now you free to use Open Audit by using its admin web console to discover new devices, adding new devices and groups of your choice.

Open Audit groups

Conclusion

At the end end of this article you have learned the installation of Open-Audit on CentOS 7/6 with LAMP stack and able to scan your system for auditing as well as adding new devices using its discovery or manually. This is one of the best and most important tool mostly used in large enterprise environments to keep record of their infrastructure.

The post How to Install Open-audIT on CentOS 6 / 7 appeared first on LinOxide.

How to Setup Chamilo, an E-Learning System on Ubuntu 15.04 / CentOS 7

$
0
0

Chamilo is a free and open source e-learning management system designed and developed for improving access to education and knowledge globally. It is released under the license of GNU General Public License version 3 or latter. It is currently backed up and supported by the Chamilo Association, a non-profit organization with several aims including the promotion of the software, ensuring the software 100% free, the maintenance and creation of network of services providers and software contributors. This piece of software allows us to create a virtual campus for the provision of online or semi-online training. Chamilo comes in two different tastes, one is the Chamilo Learning Managemt System (LMS) whereas the other is the Chamilo Learning Content Mangement System (LCMS) which offers a closely related but alternative platform model to the Chamilo LMS enabling users to manage their content in a particularly broad and flexible way. Here in this tutorial, we are talking about the LMS edition of Chamilo when we say Chamilo. To setup Chamilo in linux machine running Ubuntu 15.04 and CentOS 7, we'll need to follow the below steps.

1. Installing LAMP Stack

LAMP Stack stands for the combination of Apache Web Server, MariaDB or MySQL Database server and PHP modules in a Linux server. So, first of all we'll need to setup a LAMP Stack in our linux machine as Chamilo requires a server having an Apache Webserver (HTTPD), MySQL or MariDB  5.1 or latter and PHP 5.3 or latter installed and configured. Here in this tutorial, we'll install MariaDB instead of MySQL server for database as MariaDB is completely community driven with speed improvements and free extensions. To do so, we'll need to run the following commands under root or sudo privilege with respect to the distribution of linux installed in the machine.

On Ubuntu 15.04

# apt-get update
# apt-get install apache2 mariadb-server libapache2-mod-php5 php5-mysql php-pear php5-gd php5-intl php5-curl php5-xdebug php5-dev php5-ldap php5-xcache

On CentOS 7

# yum install httpd mariadb-­server php-­mysql php-­pear php-gd php-­xml php­-intl php­-curl php­xdebug php­-dev php-mbstring php-ldap php-­xcache

2. Installing Xapian

After we have installed our LAMP stack, we'll now need to setup Xapian in our linux machine. Though this is an optional package needed for Chamilo, we'll gonna install it in our system so that our Chamilo will work with its full features. Xapian PHP module has some license conflict with that of PHP so that, the binary formats of Xapian PHp module is not distributed only. That is the reason why php5-xapian is not available in the repository of Ubuntu or CentOS. So, what we'll need to do is install it manually using the latest stable release of Xapian. So, first we'll setup the dependencies required for configuring, compiling and installing Xapian in our linux machine.

Installing Dependencies

To setup the required dependencies for the installation of Xapian, we'll gonna run the following commands.

On Ubuntu 15.04

# apt-get update
# apt-get install gcc g++ build-essential uuid-dev

On CentOS 7

# yum install gcc-c++ libuuid-devel

Downloading Xapian Packages

Once the required dependencies are installed, we'll gonna download the latest and stable Xapian packages from its official download page ie http://xapian.org/download . While writing this article, the stable latest release of Xapian was 1.2.21 which we'll find the link from the site and then download the tarballs with wget.

# wget http://oligarchy.co.uk/xapian/1.2.21/xapian-core-1.2.21.tar.xz
# wget http://oligarchy.co.uk/xapian/1.2.21/xapian-omega-1.2.21.tar.xz
# wget http://oligarchy.co.uk/xapian/1.2.21/xapian-bindings-1.2.21.tar.xz

Next, we'll need to extract the downloaded tarballs using tar.

# tar xvfJ xapian-core-1.2.21.tar.xz
# tar xvfJ xapian-omega-1.2.21.tar.xz
# tar xvfJ xapian-bindings-1.2.21.tar.xz

Compiling and Installing

After the extraction has been completed, we'll gonna compile and install our xapian package. First, we'll gonna compile xapian-core then xapian-omega and at last, we'll compile xapian-bindings. While running ./configure command under xapian-bindings, we'll need to make sure that we add --with-php flag so that we can only install xapian php module out of the box.

# ./configure

# make

# make install

3. Configuring PHP

As we have installed all the required PHP modules in the above step, we'll now configure our PHP settings in order to gain the best performance out of Chamilo. To finetune our PHP configuration for Chamilo, we'll need to edit a file named php.ini which is located in different directory with respect to the distribution.

On Ubuntu 15.04

In Ubuntu distributions, php.ini file is located under /etc/php5/apache2/ directory so, we'll gonna edit he file using a text editor.

# nano /etc/php5/apache2/php.ini

On CentOS 7

Whereas, in CentOS, its situated under /etc/ directory so, we can simply edit it by running the following.

# nano /etc/php.ini

Once, the file is opened using a text editor, we'll simply need to append the file to have the following configuration.

date.timezone = 'America/New_York'
max_execution_time = 300
max_input_time = 600
memory_limit = 256M
post_max_size = 100M
upload_max_filesize = 100M
short_open_tag = Off
safe_mode = Off
magic_quotes_gpc = Off
magic_quotes_runtime = Off
session.cookie_httponly = On
extension = xapian.so

4. Starting Apache and MariaDB server

After we have installed the required dependencies, we'll now start our Apache web server and MariaDB database server as we need to configure them to make them ready to go with Chamilo.

On Ubuntu 15.04

As Ubuntu 15.04 is shipped with systemd as the default init system, we'll use systemctl command to start them. To do so, we'll need to run the following command.

# systemctl start apache2 mysql

Then, we'll make them start automatically in every system boot by enabling the daemons.

# systemctl enable apache2 mysql

Synchronizing state for apache2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d apache2 defaults
Executing /usr/sbin/update-rc.d apache2 enable
Synchronizing state for mysql.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d mysql defaults
Executing /usr/sbin/update-rc.d mysql enable

On CentOS 7

Likewise, CentOS 7 is also shipped with systemd as the default init system so, we'll simply need to execute the following command in the console.

# systemctl start httpd mysql

Next, as we did with Ubuntu, we'll simply enable the daemons to start in every system boot.

# systemctl enable httpd mysql

5. Setting MariaDB Root Password

On CentOS 7/Ubuntu 15.04

Now, as we are starting MariaDB for the first time and no password has been assigned for MariaDB so, we’ll first need to configure a root password for it. Then, we’ll gonna create a new database so that it can store data for our Chamilo installation.

To configure MariaDB and assign a root password, we’ll need to run the following command.

# mysql_secure_installation

This will ask us to enter the password for root but as we haven’t set any password before and its our first time we’ve installed mariadb, we’ll simply press enter and go further. Then, we’ll be asked to set root password, here we’ll hit Y and enter our password for root of MariaDB. Then, we’ll simply hit enter to set the default values for the further configurations.

….
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

installation should now be secure.
Thanks for using MariaDB!

Configuring MariaDB

6. Creating Chamilo Database

We'll now go for creating a new database for our Chamilo LMS so that it can store its data into our MariDB database. To do so, first we'll need to login to our MariaDB console by running the following command.

# mysql -u root -p

Then, it will ask us to enter the password of root user which we had just set in the above step. Then, we'll be welcomed into the MariaDB console in which we'll create our new database, database user and assign its password and grant all privileges to create, remove and edit the tables and data stored in it. Here, we'll set database name, user and password as chamilodb, chamilouser and Pa$$worD123 respectively.

> CREATE DATABASE chamilodb;
> CREATE USER 'chamilouser'@'localhost' IDENTIFIED BY 'Pa$$worD123';
> GRANT ALL PRIVILEGES ON chamilodb.* TO 'chamilouser'@'localhost';
> FLUSH PRIVILEGES;
> EXIT;

Note: It is strongly recommended to replace all the above variables ie database name, user and password for security measure.

7. Downloading latest Chamilo LMS

Next, we'll download the latest release of Chamilo LMS ie 1.10 which we can download from the official download page ie https://chamilo.org/chamilo-lms/#downloads . Here, we'll gonna download the compressed zip file using wget file downloader by running the following command in a terminal or console.

# cd /tmp/
# wget https://github.com/chamilo/chamilo-lms/archive/v1.10.0.zip

--2015-11-14 19:56:47-- https://github.com/chamilo/chamilo-lms/archive/v1.10.0.zip
Resolving github.com (github.com)... 192.30.252.130
...
Connecting to codeload.github.com (codeload.github.com)|192.30.252.145|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 223918345 (214M) [application/zip]
Saving to: 'v1.10.0.zip'
v1.10.0.zip 100%[============================>] 213.54M 12.2MB/s in 20s
2015-11-14 19:57:09 (10.8 MB/s) - 'v1.10.0.zip' saved [223918345/223918345]

After the download is completed, we'll extract the zip file using zip command as show below.

# unzip v1.10.0.zip

Then, we'll gonna move the extracted folder into the Apache Webroot ie /var/www/html/ by default.

# mv chamilo-lms-1.10.0 /var/www/html/chamilo

8. Configuring Apache Web Server

We'll add a new virtualhost in the apache web server so that we can define a specific configuration to the Chamilo installation.  Creating it will help us to define ports, webroot, domain, alias and other configurations for our Chamilo installation. Here are some configurations we'll setup in this tutorial respective to the distribution of linux we're running.

On Ubuntu 15.04

# touch /etc/apache2/sites-available/chamilo.conf
# ln -s /etc/apache2/sites-available/chamilo.conf /etc/apache2/sites-enabled/chamilo.conf
# nano /etc/apache2/sites-available/chamilo.conf

Now, we'll gonna add the following lines of configuration into the opened file.

<VirtualHost *:80>
ServerAdmin info@chamilo.linoxide.com
DocumentRoot /var/www/html/chamilo/
ServerName chamilo.linoxide.com
ServerAlias www.chamilo.linoxide.com
<Directory /var/www/html/chamilo/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/apache2/chamilo.linoxide.com-error_log
CustomLog /var/log/apache2/chamilo.linoxide.com-access_log common
</VirtualHost>

After done, we'll gonna save the file and exit the text editor. Then, we'll need to make sure that mod is enabled. To enable it, we'll need to execute the following command.

# a2enmod rewrite

Then, we'll restart our apache web server.

# systemctl restart apache2

On CentOS 7

In our CentOS machine, we'll create a file named chamilo.conf under /etc/httpd/conf.d/ directory using a text editor.

# nano /etc/httpd/conf.d/chamilo.conf

Then, we'll gonna add the following lines of configuration into the file.

<VirtualHost *:80>
ServerAdmin info@chamilo.linoxide.com
DocumentRoot /var/www/html/chamilo/
ServerName chamilo.linoxide.com
ServerAlias www.chamilo.linoxide.com
<Directory /var/www/html/chamilo/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/httpd/chamilo.linoxide.com-error_log
CustomLog /var/log/httpd/chamilo.linoxide.com-access_log common
</VirtualHost>

Once done, we'll simply save the file and exit the editor. We'll now need to make sure that mod is enabled. To enable it, we'll need to execute the following command.

# a2enmod rewrite

And then, we'll gonna restart our apache web server.

# systemctl restart httpd

9. Fixing Ownership and Permission

We'll also need to set the ownership of the Chamilo installation path as the Apache process user so that apache web server will have full access over every directory and files of Chamilo. To do so, we'll need to run the following commands with respect to distribution of linux we are running, as there are different usernames used.

On Ubuntu 15.04

# chown -R www-data: /var/www/html/chamilo

On CentOS 7

# chown ­-R apache: /var/www/html/chamilo

Then, we'll need to set the permission of some directories as writable by executing the following command.

# cd /var/www/html/chamilo
# chown -R 755  main/lang main/inc/ main/default_course_document/images/

10. Configuring Firewall

Next, we'll gonna configure the firewall program to allow http or port 80 to expose out of the box. This will allow Chamilo to be accessible within the network connected. As both CentOS 7 and Ubuntu 15.04 are shipped with systemd as init system, firewalld are installed in most machines. To allow http (port 80) we'll need to run the following command.

# firewall-cmd --permanent --add-service=http

success

# firewall-cmd --reload

success

11. Chamilo Web Installation

Finally, as we have setup and configured everything correctly in above steps, we'll now go for the web based installation of Chamilo LMS. To do so, we'll need to point our web browser to http://ip-address/chamilo or http://domain.com . Here, in this tutorial, we'll point our browser to http://139.162.14.134/chamilo . After done, we'll be welcomed by the Chamilo LMS Installation Page as shown below in which we'll click on "Install Chamilo" button in order to continue the installation process.

Web Installation Chamilo

Then, we'll be navigated to our installation page in which we'll be required to select the installation language. Here, we'll select English and click on "Next" button to continue to the next page.

Selecting Language

After done, we'll head forward towards the Requirements section in which we'll see if the required dependencies, ownerships and permissions are configured correctly or not. As we have already configured everything needed for running Chamilo smoothly, we'll see everything in green and blue color. If we see any red color, we'll know that the respective requirement is missing or misconfigured.

Checking Permissions Dependencies

After verifying that everything is fine, we'll click on New Installation as we're going for a new installation of Chamilo. But if you are following this tutorial for Upgrading, then you can simply click on Upgrade button. Next, we'll be headed towards the License Agreement page in which we'll simply accept the license by ticking the box with I Accept text.

License Agreement

Now, here is the main part of the installation. Here, we'll need to enter the database configuration in order to connect Chamilo with the MariaDB database server so that it can store and retrieve its required data. Here, we'll need to enter the configuration according to the above step, database host as localhost, port as 3306 which is the default port of MariaDB whereas Database login, password and database name as chamilouser, Pa$$worD123 and chamilodb respectively.

Setting Database Info

After every configuration is done, Chamilo will gain access to the database and then will direct us to the overview page where we'll enter the information for our Chamilo application like Main Language, URL, Portal name, company's name, etc as shown below. After done, we'll go ahead towards the Install Page.

Configuring Admin Settings

Here, we'll be shown all the settings and information set for the installation of Chamilo LMS. Now, in order to for the installation of it with those configurations, we'll need to click on Install Chamilo button.

Confirming Changes

After the installation process is completed, we'll be redirected to a post installation page where we'll be asked to make the entire app/config/ directory read-only and delete the main/install directory.

Post Installation

We'll now go for the security measures and do as said in the above page. To make the whole app/config/ directory read-only, we'll run the following command.

# chmod -R 0555 /var/www/html/chamilo/app/config/

Then, to remove the main/install/ directory, we'll execute as follows.

# rm -rf /var/www/html/chamilo/main/install/

After done, we'll click on Go to  your newly created portal button then we'll enter the required login details that we had set above in order to login to the dashboard.

Chamilo Login Screen

Once we have logged in, we'll finally be directed to the Control Panel of Chamilo LMS as shown below.

Chamilo Dashboard

Conclusion

Finally, we've successfully configured and installed Chamilo LMS in our linux machine running Ubuntu 15.04 and CentOS 7. It is a beautiful web based learning management system (LMS) focusing on ease of use, re-usability, collaboration and sharing. It is full of different plugins which are essential for an e-learning system. The community of Chamilo is growing day by day as this project is highly stable and effective on managing all types of e-learning system. It consists of 27 gorgeous designs which one can use as base to design or customize according to one's requirement and desire. I wanna simply say that Chamilo is whole all-in-one Online Campus. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you !

The post How to Setup Chamilo, an E-Learning System on Ubuntu 15.04 / CentOS 7 appeared first on LinOxide.

How to Install Laravel PHP Framework on CentOS 7 / Ubuntu 15.04

$
0
0

Hi All, In this article we are going to setup Laravel on CentOS 7 and Ubuntu 15.04. If you are a PHP web developer then you don't need to worry about of all modern PHP frameworks, Laravel is the easiest to get up and running that saves your time and effort and makes web development a joy. Laravel embraces a general development philosophy that sets a high priority on creating maintainable code by following some simple guidelines, you should be able to keep a rapid pace of development and be free to change your code with little fear of breaking existing functionality.

Laravel's PHP framework installation is not a big deal. You can simply follow the step by step guide in this article for your CentOS 7 or Ubuntu 15 server.

1) Server Requirements

Laravel depends upon a number of prerequisites that must be setup before installing it. Those prerequisites includes some basic tuning parameter of server like your system update, sudo rights and installation of required packages.

Once you are connected to your server make sure to configure the fully qualified domain name then run the commands below to enable EPEL Repo and update your server.

CentOS-7

# yum install epel-release

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

# yum update

Ubuntu

# apt-get install python-software-properties
# add-apt-repository ppa:ondrej/php5

# apt-get update

# apt-get install -y php5 mcrypt php5-mcrypt php5-gd

2) Firewall Setup

System Firewall and SELinux setup is an important part regarding the security of your applications in production. You can make firewall off if you are working on test server and keep SELinux to permissive mode using the below command, so that you installing setup won't be affected by it.

# setenforce 0

3) Apache, MariaDB, PHP Setup

Laravel installation requires a complete LAMP stack with OpenSSL, PDO, Mbstring and Tokenizer PHP Extensions. If you are already running LAMP server then you can skip this step to move on and just make sure that the required PHP extensions are installed.

To install AMP stack you can use the below commands on your respective server.

CentOS

# yum install httpd mariadb-server php56w php56w-mysql php56w-mcrypt php56w-dom php56w-mbstring

To start and enable Apache web and MySQL/Mariadb services at bootup on CentOS 7 , we will use below commands.

# systemctl start httpd
# systemctl enable httpd

#systemctl start mysqld
#systemctl enable mysqld

After starting MariaDB service, we will configure its secured password with below command.

#mysql_secure_installation

Ubuntu

# apt-get install mysql-server apache2 libapache2-mod-php5 php5-mysql

4) Install Composer

Now we are going to install composer that is one of the most important requirement before starting the Laravel installation that helps in installing Laravel's dependencies.

CentOS/Ubuntu
Run the below commands to setup 'composer' in CentOS/Ubuntu.

# curl -sS https://getcomposer.org/installer | php
# mv composer.phar /usr/local/bin/composer
# chmod +x /usr/local/bin/composer

composer installation

5) Installing Laravel

Laravel's installation package can be downloaded from github using the command below.

# wget https://github.com/laravel/laravel/archive/develop.zip

To extract the archived package and move into the document root directory use below commands.

# unzip develop.zip

# mv laravel-develop /var/www/

Now use the following compose command that will install all required dependencies for Laravel within its directory.

# cd /var/www/laravel-develop/
# composer install

compose laravel

6) Key Encryption

For encrypter service, we will be generating a 32 digit encryption key using the command below.

# php artisan key:generate

Application key [Lf54qK56s3qDh0ywgf9JdRxO2N0oV9qI] set successfully

Now put this key into the 'app.php' file as shown below.

# vim /var/www/laravel-develop/config/app.php

Key encryption

7) Virtua Host and Ownership

After composer installation assign the permissions and apache user ownership to the document root directory as shown.

# chmod 775 /var/www/laravel-develop/app/storage

# chown -R apache:apache /var/www/laravel-develop

Open the default configuration file of apache web server using any editor to add the following lines at the end file for new virtual host entry.

# vim /etc/httpd/conf/httpd.conf

ServerName laravel-develop
DocumentRoot /var/www/laravel/public

start Directory /var/www/laravel
AllowOverride All
Directory close

Now the time is to restart apache web server services as shown below and then open your web browser to check your localhost page.

CentOS

# systemctl restart httpd

Ubuntu

# service apache2 restart

8) Laravel 5 Web Access

Open your web browser and give your server IP or Fully Qualified Domain name and you will see the default web page of Laravel 5 frame work.

Laravel Default

Conclusion

Laravel Framework is a great tool to develop your web applications. So, at the end of this article you have learned its installation setup on Ubuntu 15 and CentOS 7 , Now start using this awesome PHP framework that provides you a lot of more features and comfort in your development work. Feel free to comment us back for your valuable suggestions an feedback to guide you in more specific and easiest way.

The post How to Install Laravel PHP Framework on CentOS 7 / Ubuntu 15.04 appeared first on LinOxide.


How to Install Bugzilla with Apache and SSL on FreeBSD 10.2

$
0
0

Bugzilla is open source web base application for bug tracker and testing tool, develop by mozilla project, and licensed under Mozilla Public License. It is used by high tech company like mozilla, redhat and gnome. Bugzilla was originally created by Terry Weissman in 1998. It written in perl, use MySQL as the database back-end. It is a server software designed to help you manage software development. Bugzilla has a lot of features, optimized database, excellent security, advanced search tool, integrated with email capabilities etc.

In this tutorial we will install bugzilla 5.0 with apache for the web server, and enable SSL for it. Then install mysql51 as the database system on freebsd 10.2.

Prerequisite

  • FreeBSD 10.2 - 64bit.
  • Root privileges.

Step 1 - Update System

Log in to the freebsd server with ssl login, and update the repository database :

sudo su
freebsd-update fetch
freebsd-update install

Step 2 - Install and Configure Apache

In this step we will install apache from the freebsd repositories with pkg command. Then configure apache by editing file "httpd.conf" on apache24 directory, configure apache to use SSL, and CGI support.

Install apache with pkg command :

pkg install apache24

Go to the apache directory and edit the file "httpd.conf" with nanao editor :

cd /usr/local/etc/apache24
nano -c httpd.conf

Uncomment the list line below :

#Line 70
LoadModule authn_socache_module libexec/apache24/mod_authn_socache.so

#Line 89
LoadModule socache_shmcb_module libexec/apache24/mod_socache_shmcb.so

# Line 117
LoadModule expires_module libexec/apache24/mod_expires.so

#Line 141 to enabling SSL
LoadModule ssl_module libexec/apache24/mod_ssl.so

# Line 162 for cgi support
LoadModule cgi_module libexec/apache24/mod_cgi.so

# Line 174 to enable mod_rewrite
LoadModule rewrite_module libexec/apache24/mod_rewrite.so

# Line 219 for the servername configuration
ServerName 127.0.0.1:80

Save and exit.

Next, we need to install mod perl from freebsd repository, and then enable it :

pkg install ap24-mod_perl2

To enable mod_perl, edit httpd.conf and add to the "Loadmodule" line below :

nano -c httpd.conf

Add line below :

# Line 175
LoadModule perl_module libexec/apache24/mod_perl.so

Save and exit.

And before start apache, add it to start at boot time with sysrc command :

sysrc apache24_enable=yes
service apache24 start

Step 3 - Install and Configure MySQL Database

We will use mysql51 for the database back-end, and it is support for perl module for mysql. Install mysql51 with pkg command below :

pkg install p5-DBD-mysql51 mysql51-server mysql51-client

Now we must add mysql to the boot time, and then start and configure the root password for mysql.

Run command below to do it all :

sysrc mysql_enable=yes
service mysql-server start
mysqladmin -u root password aqwe123

Note :

mysql password : aqwe123

Configure MySQL Password

Next, we will log in to the mysql shell with user root and password that we've configured above, then we will create new database and user for bugzilla installation.

Log in to the mysql shell with command below :

mysql -u root -p
password: aqwe123

Add the database :

create database bugzilladb;
create user bugzillauser@localhost identified by 'bugzillauser@';
grant all privileges on bugzilladb.* to bugzillauser@localhost identified by 'bugzillauser@';
flush privileges;
\q

Creating Database for Bugzilla

Database for bugzilla is created, database "bugzilladb" with user "bugzillauser" and password "bugzillauser@".

Step 4 - Generate New SSL Certificate

Generate new self signed ssl certificate on directory "ssl" for bugzilla site.

Go to the apache24 directory and create new directory "ssl" on it :

cd /usr/local/etc/apache24/
mkdir ssl; cd ssl

Next, generate the certificate file with openssl command, then change the permission of the certificate file :

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /usr/local/etc/apache24/ssl/bugzilla.key -out /usr/local/etc/apache24/ssl/bugzilla.crt
chmod 600 *

Step 5 - Configure Virtualhost

We will install bugzilla on directory "/usr/local/www/bugzilla", so we must create new virtualhost configuration for it.

Go to the apache directory and create new directory called "vhost" for virtualhost file :

cd /usr/local/etc/apache24/
mkdir vhost; cd vhost

Now create new file "bugzilla.conf" for the virtualhost file :

nano -c bugzilla.conf

Paste configuration below :

<VirtualHost *:80>
ServerName mybugzilla.me
ServerAlias www.mybuzilla.me
DocumentRoot /usr/local/www/bugzilla
Redirect permanent / https://mybugzilla.me/
</VirtualHost>

Listen 443
<VirtualHost _default_:443>
ServerName mybugzilla.me
DocumentRoot /usr/local/www/bugzilla

ErrorLog "/var/log/mybugzilla.me-error_log"
CustomLog "/var/log/mybugzilla.me-access_log" common

SSLEngine On
SSLCertificateFile /usr/local/etc/apache24/ssl/bugzilla.crt
SSLCertificateKeyFile /usr/local/etc/apache24/ssl/bugzilla.key

<Directory "/usr/local/www/bugzilla">
AddHandler cgi-script .cgi
Options +ExecCGI
DirectoryIndex index.cgi index.html
AllowOverride Limit FileInfo Indexes Options
Require all granted
</Directory>
</VirtualHost>

Save and exit.

If all is done, create new directory for bugzilla installation and then enable the bugzilla virtualhost by adding the virtualhost configuration to httpd.conf file.

Run command below on "apache24" directory :

mkdir -p /usr/local/www/bugzilla
cd /usr/local/etc/apache24/
nano -c httpd.conf

In the end of the line, add configuration below :

Include etc/apache24/vhost/*.conf

Save and exit.

Now test the apache configuration with "apachectl" command and restart it :

apachectl configtest
service apache24 restart

Step 6 - Install Bugzilla

We can install bugzilla manually by downloading the source, or install it from freebsd repository. In this step we will install bugzilla from freebsd repository with pkg command :

pkg install bugzilla50

If it's done, go to the bugzilla installation directory and install all perl module that needed by bugzilla.

cd /usr/local/www/bugzilla
./install-module --all

Wait it until all is finished, it is take the time.

Next, generate the configuration file "localconfig" by executing "checksetup.pl" file on bugzilla installation directory.

./checksetup.pl

You will see the error message about the database configuration, so edit the file "localconfig" with nano editor :

nano -c localconfig

Now add the database that was created on step 3.

#Line 57
$db_name = 'bugzilladb';

#Line 60
$db_user = 'bugzillauser';

#Line 67
$db_pass = 'bugzillauser@';

Save and exit.

Then run "checksetup.pl" again :

./checksetup.pl

You will be prompt about mail and administrator account, fill all of it with your email, user and password.

Admin Setup

In the last, we need to change the owner of the installation directory to user "www", then restart apache with service command :

cd /usr/local/www/
chown -R www:www bugzilla
service apache24 restart

Now Bugzilla is installed, you can see it by visiting mybugzilla.me and you will be redirect to the https connection.

Bugzilla home page.

Bugzilla Home

Bugzilla admin panel.

Bugzilla Admin Page

Conclusion

Bugzilla is web based application help you to manage the software development. It is written in perl and use MySQL as the database system. Bugzilla used by mozilla, redhat, gnome etc for help their software development. Bugzilla has a lot of features and easy to configure and install.

The post How to Install Bugzilla with Apache and SSL on FreeBSD 10.2 appeared first on LinOxide.

How to Setup Virtualmin Control Panel in CentOS 7.0

$
0
0

Virtualmin GPL is a free and open source powerful and flexible web hosting control panel for Linux machine based on the well-known web based application named Webmin. Virtualmin is a uniquely powerful and flexible web server administration tool. It is unmatched in features and ease of use. It offers a wide range of tools for hosting providers, web developers, web designers, and end users. There are two different editions in which we can get our Virtualmin application running, one is under Professional in which we'll need to buy license and another is under GPL edition which is free and open source. Here are some of the features responsible for making Virtualmin one of the top Web Based Hosting Control Panel.

  1. Virtualmin has a beautiful easy to use user interface with a well managed menu.
  2. It respects the user freedom as its pretty flexible and can be customized easily to everything according to the user's choice.
  3. The responsive design of its interface makes it easily accessible from any device which helps us to perform server tasks easily from anywhere.
  4. It has the ability to send SMS message if any problem arises before the user recognizes.
  5. It is pretty comprehensive as we can manage and run almost everything out of the box necessary to manage a web hosting server including emails, spams, network configurations, firewalls, databases, users and groups, system logs and statups, file managers filesystems, quotas, software packages, and many more .

Here are some easy steps to setup Virtualmin in a machine running CentOS 7 distribution of linux.

System Requirements

Before we hurry up for the installation of Virtualmin, we'll need to make sure that our system will support Virtualmin and will run with its full performance. To install and run Virtualmin, we'll require a machine having at least 1 GB RAM. If you have a machine with RAM less than 3GB memory size, then it is recommended to run 32 bit of linux distribution with 32 bit package of Virtualmin. It is highly recommeneded to setup Virtualmin in a freshly installed server in order to prevent conflicts. After the sytem requirements are fulfilled, we'll need to set the hostname of our machine to a fully qualified domain name.

To see the currently set hostname, we'll need to run the following command.

# hostname -f

li862-235.members.linode.com

And in order to change the hostname of our machine to a valid FQDN, we'll need to run the following command.

# hostname panel.linoxide.com

Updating the System

Once our system requirement has been checked and fulfilled, we'll go further towards the installation of Virtualmin in our machine. We'll first make sure that we have the latest software packages installed in our CentOS 7 machine, do update all the packages to the latest and stable versions, we'll need to run the following command under root or sudo access.

# yum update

Updating Centos7 System

Downloading VirtualMin

VirtualMin can be installed in many ways but as we are running CentOS 7, it is pretty easy for us to setup in a clean machine. We can setup using an automated script which will automatically install every dependencies and packages. To do so, first we'll need to download the script file of VirtualMin using wget.

# wget http://software.virtualmin.com/gpl/scripts/install.sh -O /tmp/virtualmin-install.sh

--2015-11-20 05:32:30-- http://software.virtualmin.com/gpl/scripts/install.sh
Resolving software.virtualmin.com (software.virtualmin.com)... 108.60.199.107
Connecting to software.virtualmin.com (software.virtualmin.com)|108.60.199.107|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 47633 (47K) [application/x-sh]
Saving to: ‘/tmp/virtualmin-install.sh’
100%[=========================================>] 47,633 114KB/s in 0.4s
2015-11-20 05:32:31 (114 KB/s) - ‘/tmp/virtualmin-install.sh’ saved [47633/47633]

Here, the script file named install.sh is downloaded from the official download server http://software.virtualmin.com/gpl/ using wget and is saved under /tmp/ directory as virtualmin-install.sh

Running the VirtualMin script

After the VirtualMin script has been downloaded successfully, we'll go for the execution of the script file. To do so, first we'll need to make the script file executable by running the following chmod command.

# chmod +x /tmp/virtualmin-install.sh

Once the file is made executable, we'll go further towards running it using a shell. Here, we'll run it using sh as shown below.

# sh /tmp/virtualmin-install.sh

Installing Virtualmin

Doing this will start the Virtualmin installation wizard. It will prompt a license agreement, to continue the installation, we'll need to press Y followed by Enter . The installer script will start performing several checks and installing the required components.

Allowing Firewall

As CentOS 7 is shipped with systemd as the default init system, firewalld is installed in most machines as a firewall solution. We'll configure the firewall program to allow port 10000 to expose out of the box. This will make VirtualMin accessible within the connected network. To allow port 10000 from the firewall, we'll need to run the following command.

# firewall-cmd --permanent --zone=public --add-port=10000/tcp

success

# firewall-cmd --reload

success

Accessing VirtualMin

As our virtualmin has been successfully installed and the port 10000 is allowed to expose by the firewall program, we'll point our web browser to our server as https://ip-address:10000 or https://domain.com:10000 according to the system configuration. Here, according to our configuration, we'll point our web browser to https://panel.linoxide.com:10000. This will display some warning regarding SSL certificate as we have installed virtualmin under a self-signed SSL certifications. As we're running Google Chrome browser, we'll see the below warnings, we'll simply ignore it and continue it by clicking on Advanced button. After that, we'll simply click on Proceed to panel.linoxide.com (unsafe) to continue to the VirtualMin login page.

Virtualmin SSL Certificate

Next, we'll need to enter the root username and password which is same as of the linux system's to get access to the Web based Control Panel of VirtualMin.

Virtualmin Login

After we have entered the login details, we'll click on Login button which will load the Dashboard with the Post Installation Wizard interface.

Virtualmin Post Installation Wizard

Post Installation

We'll now click on Next in order to continue the post installation wizard which is essential in order to configure different packages and elements of VirtualMin for better performance. Here, we'll go through the wizard in which we'll need to select the required option we want to setup VirtualMin with. While configuring or running a service, we'll need to keep in mind if our RAM has the capacity to handle those service properly or not in order to ensure the quality of the server. Here, we'll choose Yes to both Preload Virtualmin libraries and Run email domain lookup server for improving the Virtualmin UI and mail processing speed respectively.

Virtualmin Tuning

Then, we'll click Next and continue further towards the Virus Scanning section. Here, as we want our mail processing to be fast, we'll select Yes to run ClamAV server scanner.

Enabling Clamav Scanner

We'll also enable SpamAssassin server filter in order to filter the unwanted spam messages coming through the emails from the internet.

SpamAssassin Mail Filter

After that, we'll go for the selection of database server to run with Virtualmin. As MySQL server is widely used and supported by most applications, we'll simply select Yes to MySQL and select No to PostgreSQL database server.

Choosing Database

We'll now need to set the root password for the MySQL server which will be used to access the MySQL Database server. Here, we'll set the password for the root user as Pa$$worD123 .

MySQL root password

Next, we'll be navigated to MySQL database size page where we'll need to select the MySQL configuration size, here we'll select Large System (1G) after that, we'll need to set a resolvable nameserver in the next page.

Database Size

Then, we'll be asked to choose the Password Storage Mode, we'll choose Only store hashed passwords for security concerns.

Password Storage Mode

After done, we'll see that our Virtualmin configuration was completed, to continue into the dashboard, we'll need to click Next. Finally, after everything is done, we'll be able to access our fully configured Virtualmin Control Panel.

Virtualmin Dashboard

Conclusion

Finally, we have successfully installed VirtualMin web based control panel in our machine running CentOS 7 as operating system. Now, we can easily manage our VPS, multiple websites, clusters, applications, servers, daemons and the whole system. Really, Virtualmin has made it possible to manage and administer our servers out of the box from any device from anywhere around the world. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you !

The post How to Setup Virtualmin Control Panel in CentOS 7.0 appeared first on LinOxide.

How to Setup DirectAdmin Hosting Control Panel on CentOS 6 / 7

$
0
0

Direct Admin is a Graphical User Interface (GUI) web hosting control panel that provides you the administrative options for managing all the parts of your hosting account and can be used for the management of web hosting and making your users easier to perform common web hosting account management tasks. DirectAdmin automates the tasks for creating separate packages and defining your customized rules so that the web servers can be easily shared and give web site owners a way to quickly set-up and manage their web sites.

The DirectAdmin control panel is very low cost and has become one of the most popular web hosting control panel in use today that provided every feature that you would like to set up on your web site with shared hosting.

Preparing Servers

In this article we going to show you the complete installation steps for DirectAmin Web Hosting control Panel on CentOS 6 and CentOS 7 servers.

1) Hostname Setup

Let's prepare your CentOS server with basic parameters by configuring its proper Host names and IP address. To configure the basic server parameters, login to your server using the root or sudo credentials and configure your host name using below commands.

CentOS 6

# vi /etc/sysconfig/network
HOSTNAME=cantos-6

# vi /etc/hosts
72.25.10.175 centos-6 centos-6.linoxide.com

CentOS 7

# Hostnamectl set-hostname centos-7

# vi /etc/hosts
72.25.10.173 centos-7 centos-7.linoxide.com

2) Firewall Settings

After host name setup configure your firewall and SELinux to permissive mode so that you won't get any issue during your installation setup but keep a note that enable it back and allow only your required ports in firewall if you are working on production environment.

CentOS 6

# Service iptables start

# vi /etc/sysconfig/selinux
SELINUX=permissive

CentOS 7

# systemctl start firewalls

# setenforce 0

3) System Update

Now run the following command to update your CentOS 6/7 servers with latest patches and updates.

# yum update

You asked to press Y for Yes and N for No to exit from the update, so press "Y" key and hit enter to start installing missing packages and their updates.

4) Installing Packages

Before starting the DirectAdmin installation setup, we will be installing few packages that must be installed on your CentOS 6 or 7 server.

Let's run the below command to install some dependent packages on your CentOS server.

CentOS 6

# yum install wget zip unzip gcc gcc-c++ flex bison quota make perl bind bind-libs bind-utils openssl openssl-devel libaio libcom_err-devel libcurl-devel gd zlib-devel libcap-devel cronie bzip2 autoconf automake libtool which patch mailx cyrus-sasl-devel perl-ExtUtils-Embed db4-devel

After successful execution of above command you will be asked whether to proceed for the installation of these packages including their dependencies and updates. So, press "Y" key to proceed the installation.

CentOS 7

In CentOS 7, we need to install the following dependencies for with addition to some general packages installation as shown below.

# yum install wget unzip psmisc net-tools libdb-devel perl-DBI systemd-devel

Downloading DirectAdmin

To download the latest installation script for DirectAdmin we will be using the following command on CentOS 6/7 servers as shown.

# wget http://www.directadmin.com/setup.sh

Assign the executable permissions to the downloaded script by using the below command.

# chmod 755 setup.sh

Now you can see by list your current directory that it should have the proper executable permissions.

Starting DirectAdmin Installation:

To start installation of DirectAdmin on CentOS 6/7, let's point to installation script and execute it within your current direct directory where you have downloaded then press "Y" key to install the required pre installation packages as shown.

#./setup.sh

*** 64-bit OS ***

*****************************************************
*
* DirectAdmin requires certain packages, described here:
* http://help.directadmin.com/item.php?id=354
*
* Would you like to install these required pre-install packages? (y/n): y

This might take a while to install the prerequisites, after that you will be asked to configure some of the following settings. So, choose the best appropriate answers according to your environment and give correct Client ID and License ID that you have got from DirectAdmin against your public IP.

Complete!
*
*****************************************************

Please enter your Client ID : xxxxx
Please enter your License ID : xxxxxx
Please enter your hostname (server.domain.com)
It must be a Fully Qualified Domain Name
Do *not* use a domain you plan on using for the hostname:
eg. don't use domain.com. Use server.domain.com instead.
Do not enter http:// or www

Enter your hostname (FQDN) : centos-7.linoxide.com
Client ID:
License ID:
Hostname: centos-007.linoxide.com
Is this correct? (y,n) : y
Is ens160 your network adaptor with the license IP (72.25.10.173)? (y,n) : y
Your external IP: xx.xx.xx.xx
The external IP should typically match your license IP.

Is 72.25.10.173 the IP in your license? (y,n) : y

DirectAdmin will now be installed on: Enterprise 7.1
Is this correct? (must match license) (y,n) : y
You have chosen custombuild 2.0.
--2015-12-08 22:13:35-- http://files.directadmin.com/services/custombuild/2.0/custombuild/build
Resolving files.directadmin.com (files.directadmin.com)... 69.162.69.58, 208.167.226.3, 216.144.254.90
Connecting to files.directadmin.com (files.directadmin.com)|69.162.69.58|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 617821 (603K)
Saving to: ‘/usr/local/directadmin/custombuild/build’

100%[====================================================================================>] 617,821 431KB/s in 1.4s

2015-12-08 22:13:37 (431 KB/s) - ‘/usr/local/directadmin/custombuild/build’ saved [617821/617821]

Would you like the default settings of apache 2.4 with mod_ruid2 and php 5.5 cli? (y/n):y

After downloading the updates and packages with your client id and license id for your IP address you see a multiple number of DirectAdmin processes taking place on your screen to complete the installation setup.

DirectAdmin Web Access

Upon successful completion of the installation setup of DirectAdmin, you can access its Web Console on your web browser with the FQDN of your server and port '2222'.

http://your-servers-ip:2222

Make sure that the port 80 and 2222 is allowed in your firewall/iptable settings.

Conclusion

In this article you have learned about installation of DirectAdmin on CentOS 6 and 7 server. DirectAdmin is one the best alternative to WHM-cPanel and its quite cheap and fairly easily to setup. Thank you for reading this article we hope you find it much helpful. Don't forget to leave your valuable comments.

The post How to Setup DirectAdmin Hosting Control Panel on CentOS 6 / 7 appeared first on LinOxide.

Introduction to IRC with XChat, Irssi and UnrealIRCD on CentOS 7.0

$
0
0

Hi tuxman, this time we are going to talk about the Internet Relay Chat, or simply IRC. In the first part of this article we will review this protocol, how to use Irssi or XChat to connect on Freenode and other IRC networks,enter on channels and talk to people. After that, you will see how to start your own IRC service with UnrealIRCd.

Table of contents

  • Introduction
  • Connecting on IRC
  • Basic IRC commands
  • Serving IRC with UnrealIRCd

Introduction

You may remember the IRC chats, when there was no such thing as Facebook Google+ or LinkedIn and our social networks were IRC chat channels. Today we have a lot of alternatives to talk to someone on the internet, along with the social networks we have many popular messaging services, such as Whatsapp, Skype, Hangouts and so on.

However, despite IRC is not the main communication program on the internet, it is still alive and a great tool. It is a lightweight, widely deployed and  standardized protocol, originally created on 1988 by BBS users as a replacement and improvement for the talk program and that by its characteristics, saw the birth and death of many other messaging systems.

Connecting on IRC

To connect to an IRC network, you will need a client software. Here are some good clients for Linux.

Irssi

Irssi is a curses based IRC client, it is pretty great, customizable, allows the use of scripts and dismiss the need of a X server.

Install

yum install irssi

Connect to a network with the -c flag,

irssi -c irc.freenode.org

To switch between Irssi windows can be a little tricky at the first time,  you can use [Ctrl+n] to go to next window and [Ctrl+p] for the previous. the /window command.

/window [ next | previous ]

Use the list parameter to display a list with the open windows

/window list

You can then jump to the listed window number with [Alt+#], where # is the window number between 1-9. Another way to do this is with the goto parameter

/window goto [1-9]

You can also find good tips on how to use Irssi on quadpoint website.

XChat

XChat simplify the process for new comers by giving you point and click options to commands and most actions.

You can install XChat with yum

yum install xchat

Connect to IRC networks, using the dialog presented to you when you just start XChat, also accessible from  menu XChat->Network List [Ctrl+s]

Connect to IRC networks on XChat

Connect to IRC networks on XChat

As you sucessfully connect to the network, you can select one of the options to join to channels. You can also use the menu Server->List of Channels.

IRC join Freenode XChat

IRC join Freenode XChat

Basic IRC commands

Now you have a client ,here are some commands that you can use on IRC. When you first connect on a network, you will be given a nickname based on your system login by the client, and to change your nickname to Tuxman for instance, try this.

/nick Tuxman

With a new, you may want to enter on a channel. To list channels related to development try

/list #devel*

Once you find the channel you are interested on, try to join with /join #channelname.

/join #linux

OK, you are on a channel, you can start talking now, to know who is on the channel, do this with names

/names

Maybe you want to know more about who is someone on the network, try whois.

/whois MrRobot

Want to a chat window with someone? query.

/query MrRobot

Register you nick

You don't need to create an account to chat on IRC networks. However, if you want to prevent your nickname of being be used by someone else, you must register you nickname on the network. This will also give you access to resources that require registered nicknames, such as cloaking and access to more channels.

Let's suppose that you want to register the Tuxman nickname on Freenode. Ask the NickServ to REGISTER your nickname

/msg NickServ REGISTER password me@email.com

After that you must get your verification code that was sent to the email you provided and send it to NickServ

/msg NickServ VERIFY REGISTER nickname verifycode

You have registered your nickname, now you can identify yourself to the network

/msg NickServ IDENTIFY password

Connect and identify at Irssi startup with -n and -w flags.

irssi -c irc.freenode.net -n nickname -w password

You should also change your password from time to time, use the following command

/msg nickserv set password newpassword

Installing UnrealIRCd

Among other Ircd implementations there is the UnrealIRCd. It is fully featured, modular and highly documented, also the most implemented IRC server nowadays, corresponding to more than 50% of the currently running IRC servers.

Extra Requirements

Here is some requirements to get best of your UnrealIRCd, despite it is not required, it is strongly recommended as you will see.

Ntp - You must have correct time and date, ntp is your best choice to maintain time and date correct.

Install ntp

yum install ntp

Enable ntpd

chkconfig ntpd on

OpenSSL - This is also optional,  this will be used if you want SSL/TLS support.

yum install openssl

Zlib - This will let you to compress the network packets and reduce the load over the links.

yum install zlib

Get UnrealIRCd

Download Unrealircd.

wget --no-check-certificate https://www.unrealircd.org/downloads/Unreal3.2.10.5.tar.gz

Extact the tarball

tar zxvf Unreal3.2.10.5.tar.gz

Enter the sources tree

cd Unreal*

Enable chroot irc user and irc group (recommended)

This step is optional but strongly recommended as it will allow you to drop superuser rights and run UnreadIRCd under an unprivileged user account, inside a chrooted environment, and thus will make the whole setup much safer.

To do this you must edit include/config.h file within the sources directory.

Chroot environment feature is defined by the following directive

/* #define CHROOTDIR    */

Define the IRC_USER constant

/* #define IRC_USER  "<user name>" */

Define the IRC_GROUP constant

/* #define IRC_GROUP "<group name>" */

enable-user-chroot

Create group for ircd

groupadd ircd

Create ircd user and add it to the ircd group.

useradd ircd -s /bin/false -g ircd

Set the password for the ircd user to make sure no one can enter.

passwd ircd

Configure the build

At this point you follow the questions on the screen,  and you can use default settings most of then, however, I advice you to answer Yes when asked to enable ssl support.

./config

Configuring UnrealIRCd build

Configuring UnrealIRCd build

Build the sources

make

Install files

make install

If you enabled the ircd user, group and chroot features, you should now change the ownership of UnrealIRCd directory.

chown -R ircd:ircd /home/ircd/UnrealIRCd

Configure

It is time to make your IRC daemon work. For this edit the unrealircd.conf, the configuration file for UnrealIRCd. You can find the well documented file doc/sample.conf under your UnrealIRCD directory tree, it may help you in your journey. I created this working snippets with a brief description.

me - This block sets some basic server settings, name, basic info and the numeric value that must be unique across server on the same network.

me {

name "irc.localhost";
info "My Server";
numeric 1;

};

admin -  Here you set who is the server administrator, its name, nickname and email.

admin {

"George Jedi"; /* Name */
"geroge";/* Nick Name */
"george@heaven.net"; /* Email */

};

class clients/servers - This sets how clients and other servers are handled by the our server respectively. ping frequency, maximum of clients connections, frequency of reconnection tries, receive and send queues.

class clients {

pingfreq 90;
maxclients 500;
sendq 100000;
recvq 8000;

};'

class servers {

pingfreq 90;
maxclients 10; /* Max servers we can have linked at a time */
sendq 1000000;
connfreq 100; /* How many seconds between each connection attempt */

};

allow - Define who can connect to the server and how. First block allows user connections from any IP or hostname and limits the connections to 5 per IP. Second block allows only one authenticated connection to people from ugly.people.com

allow {

ip *;
hostname *;
class clients;
maxperip 5;

};

allow {

ip *@*;
hostname *@*.ugly.people.com;
class clients;
password "jayajaya";
maxperip 1;

};

listen - Which ports to listen for connections. On the block we are listening at port 6697 for user clients connecting over secure socket layer (SSL). Note also the line simple statement for plaintext connections at port 6667

listen *:6697 {

options {

ssl;
clientsonly;

};

};
#listen *:8067;
listen *:6667;
#listen *:6660-6669;

oper - Operator attributes, in this example we use an operator nicknamed george that can connect from anywhere with the "fuba" password

oper george {
class clients;
from {
userhost *@*;
};

password "fuba";
flags {

netadmin;
can_gkline;
can_kline;
can_unkline;
can_gzline;
can_zline;
can_restart;
can_die;
can_rehash;
global;

};

swhois "Example of a whois mask";
snomask cFfkoSsqNG;

};

loadmodule - Loads modules, these are the minimum recommended

loadmodule "modules/commands.so";
loadmodule "modules/cloak.so";

log - How log files will be written, on the example we log events flagged as errors, kills and so

log ircd.log {

maxsize 5MB;
flags {

errors;
kills;
oper;
tkl;

};

};

set - You may set many other things here, in our example we have a network at domain gaia.net called gaianet, that connect people to the #welcome channel, we set 3 different alphanumeric cloak keys, set the hosts on the network, create a #help  channel and other options that are detailed on nrealircd.org.

set {

kline-address my@email.address;
auto-join #welcome;
op

options {

hide-ulines;

};

maxchannelsperuser 10;
services-server         "services.gaia.net";
default-server              "localhost";
network-name                "gaianet";
help-channel                "#help";
hiddenhost-prefix           "gaia";

cloak-keys {

"aoAr1O6fh3Q6w4Hnl3J7hVz4Zb7x4YwpW";
"andaoAr1HnR6gl3sJ7uhVzO6fh3Q6w4oN3";
"a2Ja2JO6fh3Q6w4oNs7O6fh3Q6w4oN3s7";

};

hosts {

local           "locop.gaia.net";
global          "ircop.gaia.net";
coadmin         "coadmin.gaia.net";
admin           "admin.gaia.net";
servicesadmin   "csops.gaia.net";
netadmin        "netadmin.gaia.net";
host-on-oper-up "no";

};

};

Start UnrealIRCd

With all things in place, you can start your IRC daemon now.  Add the following command on rc.local to start UnrealIRCd when your system starts.

/home/ircd/UnrealIRCd/unreal start

It should run with no problems, however if face any problem during the startup, read the error messages on the terminal and also on the ircd.log file to figure out what is wrong.

Conclusion

You are done for now, your client and server should be running now, you can talk to people worldwide using some of the global networks or using your own network. However, it is a good idea to learn more on the IRC protocol, how to manage networks, channels and users, etc. The following documents should help you.

RFC documents

The following RFC defines the standards for the IRC protocol. You should read this before you can get best of IRC.

RFC-1459, RFC-2810, RFC-2811, RFC-2812, RFC-2813, RFC-7194

UnrealIRCd support and docs

Refer official documentation of UnrealIRCd to acquire more information. It contains all details that are not described on this document. You can also get help from IRC by connecting on irc.unrealircd.org:6667 on the #unreal-support channel. Thanks for reading!

The post Introduction to IRC with XChat, Irssi and UnrealIRCD on CentOS 7.0 appeared first on LinOxide.

How to Install PostgreSQL and PhpPgAdmin on FreeBSD 10.2

$
0
0

Postgresql or postgres is open-source object relational database system developed by PostgreSQL Global Development Group. 15 years active development, and until now has proven for the intregity, reliabelity and ability as the database server. It is powerfull and is very suitable for the use of large-scale database, support for all major operating system, including Linux, Unix, Mac OS X and Windows.

In this tutorial we will guide you about postgresql installation and configuration on Unix operating system FreeBSD 10.2. And then will install a phppgadmin as the premier web-based administration tool for postgresql that required apache and php.

Prerequisite

  • FreeBSD 10.2 - 64bit
  • Root privileges

Step 1 - Update the Repository Database

Log in to the freebsd server with the ssh credential, and the gain the sudo/root privileges with command "sudo su", and update the repository :

freebsd-update fetch
freebsd-update install

Step 2 - Install PostgreSQL Database

In this tutorial we will install all the package from the freebsd repository with pkg command, run pkg command as sudo user to install postgresql database :

pkg install postgresql93-server postgresql93-client

If the installation finished, next add postgresql to start at the booti time with sysrc command :

sysrc postgresql_enable=yes

Next, run command 'initdb' to initialize the database :

service postgresql initdb

And if you want the database postgresql to be accessed from the network, you must edit the postgresql.conf on pssql directory. Go to the postgresql configuration directory and edit the file with nano command.

cd /usr/local/psql/data/
nano -c postgresql.conf

Uncomment the listen address on line 59 and change the value to "*".

listen_addresses = '*'

On the line 63, uncomment the port option to enable postgresql listening on that port :

port = 5432

Save and exit.

And now start the postgresql with service command :

service postgresql start

Verify that postgresql is running on port 5432 with 'sockstat' command below :

sockstat -l4 | grep post

pgsql    postgres   19966 4  tcp4   *:5432                *:*

Step 3 - Configure User for PostgreSQL

Once the postgresql installation, it will create new user called 'pgsql', and in this step we need to change the password for 'pgsql' that used for log in to the pgsql shell/environment.

Run command below as root/sudo privileges :

passwd pgsql
New Password: INPUT YOUR PASSWORD HERE

And try to log in to the pgsql shell with command :

su pgsql

NOTE : If you run that command as roo/sudo privileges, you will not be ask for 'pgsql' password, but if you run it on the normal user, you will be ask a password for 'pgsql' user.

A password for pgsql user has changed, and the next step is to create new user and new database for postgresql. This user used to log in to the postgresql databse from the phppgadmin web based tool.

Log in to the pgsql user shell/environment :

su pgsql

And create new user 'imnewuser' and create new databse 'newdb' with command below :

createuser -sdrP imnewuser
createdb -O imnewuser newdb

  • -s : role will be superuser.
  • -d : role can create new database.
  • -r : role can create new roles.
  • -P : assign a password for new role.
  • -O : database user to own the new database.

New user and database is created, this user will be use for the next step to log in to the phppgadmin.

You can test with command below :

Test the database and User

Step 4 - Install Apache and PHP

PhpPgAdmin is php application, web based administrative tool for postgresql, so we need this up and accessible from the browser, and we need apache and php for it.

Install apache from freebsd repository with pkg command :

pkg install apache24

Go to the apache configuration directory and edit the file 'httpd.conf' :

cd /usr/local/etc/apache24/
nano -c httpd.conf

Uncomment the ServerName on line 219, and chage it to localhost IP :

ServerName 127.0.0.1:80

Save and exit.

And now add the apache to start at boot time, then start it :

sysrc apache24_enable=yes
service apache24 start

Apache Installation is done.

Next install php56 with pkg command :

pkg install php56 mod_php56 php56-curl php56-session php56-pgsql

And now you must configure php to work with apache by adding the php configuration to the apache configuration file 'httpd.conf'.

Go to the apache apache configuration directory and edit httpd.conf :

cd /usr/local/etc/apache24/
nano -c httpd.conf

Add php configuration below under line 288 :

<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>

And add the index.php on line 278 :

<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>

Save and exit.

Configure Apache and PHP

Next step is just copying the php.ini file on '/usr/local/etc/' directory :

cd /usr/local/etc/
cp php.ini-production php.ini

And restart the apache :

service apache24 restart

Apache and php is configured, and you can verify it by creating new php file on the web root directory. Go to the web directory and create the php file :

cd /usr/local/www/apache24/data
echo "<?php phpinfo(); ?>" > info.php

Visit the server IP : 192.168.1.108/info.php

Apache and PHP is Done

Step 5 - Install and Configure PhpPgAdmin

PhpPgAdmin is web application based on PHP for managing the Postgresql database. We can install it from source, but it is now available on freebsd repository, so let's install it with pkg command :

pkg install phppgadmin-5.1_1

On the installation step you will get error :

cp: /usr/local/www/data-dist/phpPgAdmin/conf/config.inc.php: No such file or directory

It is fine, dont worry about it.

Next, PhpPgAdmin is installed on directory '/usr/local/www/phpPgAdmin', and we must make the symlink of that directory to the apache web directory '/usr/local/www/apache24/data'.

cd /usr/local/www/apache24/data
ln -s /usr/local/www/phpPgAdmin/ /usr/local/www/apache24/data/

Now visit the server IP : 192.168.1.108/phpPgAdmin/.

And you will see the phppgadmin page, try to log in with the user and password created.

PhpPgAdmin Login Page

After logged in, we can see the database 'newdb' taht was created.

PhpPgAdmin is Done

PostgreSQL with PhpPgAdmin is installed on FreeBSD 10.2.

Conclusion

PostgreSQL is powerful and open-source object relational database management system (RDBMS). Developed more then 15 year, and it is very suitable for large scale database. It is Cross Platform, can run on Linux, Unix and Windows. PhpPgAdmin is web application based on php, used for manage the postgresql database from the browser. Postgresql and PhpPgAdmin is easy to install and configure.

The post How to Install PostgreSQL and PhpPgAdmin on FreeBSD 10.2 appeared first on LinOxide.

Viewing all 382 articles
Browse latest View live