Quantcast
Channel: Websetnet
Viewing all 4268 articles
Browse latest View live

How to Install MariaDB 10 on CentOS 7 CPanel Server

$
0
0

MariaDB is a enhanced open source and drop-in replacement for MySQL. It is developed by MariaDB community and available under the terms of the GPL v2 license. Software Security is the main focus for the MariaDB developers. They maintain its own set of security patches for each MariaDB releases. When any critical security issues are discovered, the developers introduces a new release of MariaDB to get the fix out as soon as possible.

MariaDB is always up-to-date with the latest MySQL releases. It is highly compatible and works exactly like the MySQL. Almost all commands, data, table definition files, Client APIs, protocols, interfaces, structures, filenames, binaries, ports, database storage locations etc are same as the MySQL. It isn’t even needed to convert databases to switch to MariaDB.

Advantages of MariaDB

  • Truly Open source
  • More quicker and transparent security releases
  • Highly Compatible with MySQL
  • Improved Performance
  • More storage engines compared to MySQL

In this article, I provides guidelines on how to upgrade MySQL 5.5 to the latest MariaDB on a CentOS 7 CPanel server. Let’s walk through the Pre-installation steps.

Pre-requisites:

1. Stop current MySQL Service

root@server1 [/var/# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5859
Server version: 5.5.47-cll MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

root@server1 [~]# systemctl stop mysql
root@server1 [~]# systemctl status mysql
● mysql.service – LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysql)
Active: failed (Result: exit-code) since Sun 2016-01-31 10:00:02 UTC; 1min 31s ago
Docs: man:systemd-sysv-generator(8)
Main PID: 23430 (code=exited, status=203/EXEC)

Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Started MySQL Server.
Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Starting MySQL Server…
Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service: main process exited, code=exited, status=203/EXEC
Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Unit mysql.service entered failed state.
Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service failed.

2. Move all configuration files and databases prior to the upgrade

Move the DB storage path and MySQL configuration files

root@server1 [~]# cp -Rf /var/lib/mysql /var/lib/mysql-old

root@server1 [/var/lib/mysql]# cat /etc/my.cnf
[mysqld]
default-storage-engine=MyISAM
innodb_file_per_table=1
max_allowed_packet=268435456
open_files_limit=10000

root@server1 [~]#mv /etc/my.cnf /etc/my.cnf-old

3. Remove and uninstall all MySQL rpms from the server

Run the following commands to disable the MySQL RPM targets. By running this commands, cPanel will no longer handle MySQL updates, and mark these rpm.versions as uninstalled on the system.

/scripts/update_local_rpm_versions –edit target_settings.MySQL50 uninstalled
/scripts/update_local_rpm_versions –edit target_settings.MySQL51 uninstalled
/scripts/update_local_rpm_versions –edit target_settings.MySQL55 uninstalled
/scripts/update_local_rpm_versions –edit target_settings.MySQL56 uninstalled

Now run the this command:

/scripts/check_cpanel_rpms –fix –targets=MySQL50,MySQL51,MySQL55,MySQL56 to remove all existing MySQL rpms on the server and leave a clean environment for MariaDB installation. Please see its output below:

root@server1 [/var/lib/mysql]# /scripts/check_cpanel_rpms –fix –targets=MySQL50,MySQL51,MySQL55,MySQL56
[2016-01-31 09:53:59 +0000]
[2016-01-31 09:53:59 +0000] Problems were detected with cPanel-provided files which are RPM controlled.
[2016-01-31 09:53:59 +0000] If you did not make these changes intentionally, you can correct them by running:
[2016-01-31 09:53:59 +0000]
[2016-01-31 09:53:59 +0000] > /usr/local/cpanel/scripts/check_cpanel_rpms –fix
[2016-01-31 09:53:59 +0000]
[2016-01-31 09:53:59 +0000] The following RPMs are unneeded on your system and should be uninstalled:
[2016-01-31 09:53:59 +0000] MySQL55-client-5.5.47-1.cp1148
[2016-01-31 09:53:59 +0000] MySQL55-devel-5.5.47-1.cp1148
[2016-01-31 09:53:59 +0000] MySQL55-server-5.5.47-1.cp1148
[2016-01-31 09:53:59 +0000] MySQL55-shared-5.5.47-1.cp1148
[2016-01-31 09:53:59 +0000] MySQL55-test-5.5.47-1.cp1148
[2016-01-31 09:53:59 +0000] compat-MySQL50-shared-5.0.96-4.cp1136
[2016-01-31 09:53:59 +0000] compat-MySQL51-shared-5.1.73-1.cp1150
[2016-01-31 09:53:59 +0000] Removing 0 broken rpms:
[2016-01-31 09:53:59 +0000] rpm: no packages given for erase
[2016-01-31 09:53:59 +0000] No new RPMS needed for install
[2016-01-31 09:53:59 +0000] Disabling service monitoring.
[2016-01-31 09:54:01 +0000] Uninstalling unneeded rpms: MySQL55-test MySQL55-server MySQL55-client compat-MySQL51-shared compat-MySQL50-shared MySQL55-shared MySQL55-devel
[2016-01-31 09:54:04 +0000] Removed symlink /etc/systemd/system/multi-user.target.wants/mysql.service.
[2016-01-31 09:54:04 +0000] Restoring service monitoring.

With these steps, we’ve uninstalled existing MySQL RPMs, marked targets to prevent further MySQL updates and made the server ready and clean for the MariaDB installation.

To startup with the installation, we need to create a yum repository for MariaDB depending on the MariaDB & CentOS versions. This is how I did it!

Installation procedures:

Step 1: Creating a YUM repository.

root@server1 [~]# vim /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
root@server1 [/etc/yum.repos.d]# cat /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Step 2: Open the /etc/yum.conf and modify the exclude line as below:

Remove this line exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* mysql* nsd* php* proftpd* pure-ftpd* spamassassin* squirrelmail*

And replace with this line exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* proftpd* pure-ftpd* spamassassin* squirrelmail*
**IMPORTANT ***

We need to make sure, we’ve removed the MySQL and PHP from the exclude list.

Step 3: Run the following command to install MariaDB and related packages.

yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql

root@server1 [~]#yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql

Dependencies Resolved

===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
MariaDB-client x86_64 10.0.23-1.el7.centos mariadb 10 M
MariaDB-devel x86_64 10.0.23-1.el7.centos mariadb 6.3 M
MariaDB-server x86_64 10.0.23-1.el7.centos mariadb 55 M
php-mysql x86_64 5.4.16-36.el7_1 base 99 k
Installing for dependencies:
MariaDB-common x86_64 10.0.23-1.el7.centos mariadb 43 k
MariaDB-shared x86_64 10.0.23-1.el7.centos mariadb 1.2 M
libzip x86_64 0.10.1-8.el7 base 48 k
php-common x86_64 5.4.16-36.el7_1 base 563 k
php-pdo x86_64 5.4.16-36.el7_1 base 97 k

Transaction Summary
===============================================================================================================================================
Install 4 Packages (+5 Dependent package)

Step 4: Restart and make sure the MySQL service is up.

root@server1 [~]# systemctl start mysql
root@server1 [~]#
root@server1 [~]#
root@server1 [~]# systemctl status mysql
● mysql.service – LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysql)
Active: active (exited) since Sun 2016-01-31 10:01:46 UTC; 3s ago
Docs: man:systemd-sysv-generator(8)
Process: 23717 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS)
Main PID: 23430 (code=exited, status=203/EXEC)

Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL…
Jan 31 10:01:46 server1.centos7-test.com mysql[23717]: Starting MySQL SUCCESS!
Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL.

Step 5 : Run mysql_upgrade command

It will examine all tables in all databases for incompatibilities with the current installed version and upgrades the system tables if necessary to take advantage of new privileges or capabilities that might have added with the current version.

root@server1 [~]# mysql_upgrade
MySQL upgrade detected
Phase 1/6: Checking and upgrading mysql database
Processing databases
mysql
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Phase 2/6: Fixing views from mysql
Phase 3/6: Running ‘mysql_fix_privilege_tables’
Phase 4/6: Fixing table and database names
Phase 5/6: Checking and upgrading tables
Processing databases
cphulkd
cphulkd.auths OK
cphulkd.blacklist OK
cphulkd.brutes OK
cphulkd.good_logins OK
cphulkd.ip_lists OK
cphulkd.known_netblocks OK
cphulkd.login_track OK
cphulkd.logins OK
cphulkd.report OK
cphulkd.whitelist OK
eximstats
eximstats.defers OK
eximstats.failures OK
eximstats.sends OK
eximstats.smtp OK
information_schema
leechprotect
leechprotect.hits OK
modsec
modsec.hits OK
performance_schema
roundcube
roundcube.cache OK
roundcube.cache_index OK
roundcube.cache_messages OK
roundcube.cache_shared OK
roundcube.cache_thread OK
roundcube.contactgroupmembers OK
roundcube.contactgroups OK
roundcube.contacts OK
roundcube.cp_schema_version OK
roundcube.dictionary OK
roundcube.identities OK
roundcube.searches OK
roundcube.session OK
roundcube.system OK
roundcube.users OK
saheetha_test
saheetha_test.authors OK
whmxfer
whmxfer.sessions OK
Phase 6/6: Running ‘FLUSH PRIVILEGES’
OK

Step 6 : Restart the MySQL service once again to ensure everything works perfect.

root@server1 [~]# systemctl restart mysql
root@server1 [~]#
root@server1 [~]# systemctl status mysql
● mysql.service – LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysql)
Active: active (running) since Sun 2016-01-31 10:04:11 UTC; 9s ago
Docs: man:systemd-sysv-generator(8)
Process: 23831 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS)
Process: 23854 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS)
Main PID: 23430 (code=exited, status=203/EXEC)
CGroup: /system.slice/mysql.service
├─23861 /bin/sh /usr/bin/mysqld_safe –datadir=/var/lib/mysql –pid-file=/var/lib/mysql/server1.centos7-test.com.pid
└─23933 /usr/sbin/mysqld –basedir=/usr –datadir=/var/lib/mysql –plugin-dir=/usr/lib64/mysql/plugin –user=mysql –log-error=/v…

Jan 31 10:04:10 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL…
Jan 31 10:04:11 server1.centos7-test.com mysql[23854]: Starting MySQL. SUCCESS!
Jan 31 10:04:11 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL.

Step 7: Run EasyApache to rebuild Apache/PHP with MariaDB and ensure all PHP modules remains intact.

root@server1 [~]#/scripts/easyapache –build

****IMPORTANT *****
If you forget to rebuild Apache/PHP after the MariaDB installation, it will report the library error as below:

root@server1 [/etc/my.cnf.d]# php -v
php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

Step 8: Now verify the installation and databases.

root@server1 [/var/lib/mysql]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 15
Server version: 10.0.23-MariaDB MariaDB Server

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

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> show storage engines;
+——————–+———+—————————————————————————-+————–+——+————+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+——————–+———+—————————————————————————-+————–+——+————+
| CSV | YES | CSV storage engine | NO | NO | NO |
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| FEDERATED | YES | FederatedX pluggable storage engine | YES | NO | YES |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
+——————–+———+—————————————————————————-+————–+——+————+
10 rows in set (0.00 sec)

That’s all :). Now we’re all set to go with MariaDB with its improved and efficient features. Hope you enjoyed reading this documentation. I would recommend your valuable suggestions and feedback on this!


How to Update CURL with CPanel on CentOS 7

$
0
0

CURL is a simple module that allows you to connect and communicate to various types of servers using various types of protocols. Curl mainly supports http, https, ftp, gopher, telnet, dict, file, and ldap protocols. It also supports SMB, SMBS, IMAP, IMAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, TFT, HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, and user/password authentication.

We know that, an increasing amount of web applications has made the HTTP scripting more frequently requested and necessary. There is a high demand for such a tool which helps us to automatically extract information from the Web, upload, proxy or POST data to the web servers.

CURL is a simple commandline tool which can be used to do all these URL manipulations and data transfers. It is powered by libcurl, which is a library created by Daniel Stenberg.

It is mandatory to keep such softwares always updated, since there is a chance of hacking attempts, data diddling or loop holes due to old insecure versions. In this article, I’m discussing a simple method on how to update the Curl in a more efficient way to the latest available versions on a cPanel server.

First of all, check the current version installed on the server. Please see the current CURL version in my server below:

root@server1 [/usr/local/src]# /usr/bin/curl -V
curl 7.38.0 (x86_64-redhat-linux-gnu) libcurl/7.38.0 NSS/3.19.1 Basic ECC zlib/1.2.7 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL UnixSockets

current_curl_status

As you can see the CURL version is 7.38 and is compiled to support these many protocols like dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet and tftp.

We are going to configure CURL with Asynchronous DNS to improve its performance and make the requests more faster without any delays. Let’s start our update process now.

Step 1. Download the latest Curl and Asynchronous DNS Package from their website and extract.

root@server1 [~]# cd /usr/local/src/
root@server1 [/usr/local/src]# wget http://c-ares.haxx.se/download/c-ares-1.10.0.tar.gz
–2016-01-26 06:29:25– http://c-ares.haxx.se/download/c-ares-1.10.0.tar.gz
Resolving c-ares.haxx.se (c-ares.haxx.se)… 2a00:1a28:1200:9::2, 80.67.6.50
Connecting to c-ares.haxx.se (c-ares.haxx.se)|2a00:1a28:1200:9::2|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 809073 (790K) [application/x-gzip]
Saving to: ‘c-ares-1.10.0.tar.gz’

100%[=====================================================================================================>] 8,09,073 1.18MB/s in 0.7s

2016-01-26 06:29:26 (1.18 MB/s) – ‘c-ares-1.10.0.tar.gz’ saved [809073/809073]

root@server1 [/usr/local/src]#tar -xvf c-ares-1.10.0.tar.gz
root@server1 [/usr/local/src]# wget http://curl.haxx.se/download/curl-7.46.0.tar.gz
–2016-01-26 06:29:59– http://curl.haxx.se/download/curl-7.46.0.tar.gz
Resolving curl.haxx.se (curl.haxx.se)… 2a00:1a28:1200:9::2, 80.67.6.50
Connecting to curl.haxx.se (curl.haxx.se)|2a00:1a28:1200:9::2|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 4551902 (4.3M) [application/x-gzip]
Saving to: ‘curl-7.46.0.tar.gz’

100%[=====================================================================================================>] 45,51,902 3.79MB/s in 1.1s

2016-01-26 06:30:01 (3.79 MB/s) – ‘curl-7.46.0.tar.gz’ saved [4551902/4551902]

root@server1 [/usr/local/src]#tar -xvf curl-7.46.0.tar.gz

Step 2. Configure, make and install the Asynchronous DNS package.

root@server1 [/usr/local/src/c-ares-1.10.0]# ./configure

root@server1 [/usr/local/src/c-ares-1.10.0]# make
make all-am
make[1]: Entering directory `/usr/local/src/c-ares-1.10.0′
/bin/sh ./libtool –tag=CC –mode=compile gcc -DHAVE_CONFIG_H -I. -I. -DCARES_BUILDING_LIBRARY -DCARES_SYMBOL_HIDING -fvisibility=hidden -g0 -O2 -Wno-system-headers -MT libcares_la-ares__close_sockets.lo -MD -MP -MF .deps/libcares_la-ares__close_sockets.Tpo -c -o libcares_la-ares__close_sockets.lo `test -f ‘ares__close_sockets.c’ || echo ‘./’`ares__close_sockets.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -DCARES_BUILDING_LIBRARY -DCARES_SYMBOL_HIDING -fvisibility=hidden -g0 -O2 -Wno-system-headers -MT libcares_la-ares__close_sockets.lo -MD -MP -MF .deps/libcares_la-ares__close_sockets.Tpo -c ares__close_sockets.c -fPIC -DPIC -o .libs/libcares_la-ares__close_sockets.o
make[1]: Leaving directory `/usr/local/src/c-ares-1.10.0’

root@server1 [/usr/local/src/c-ares-1.10.0]# make install

/usr/bin/install -c -m 644 ares_version.3 ares_inet_pton.3 ares_inet_ntop.3 ‘/usr/local/share/man/man3’
/usr/bin/mkdir -p ‘/usr/local/lib/pkgconfig’
/usr/bin/install -c -m 644 libcares.pc ‘/usr/local/lib/pkgconfig’
make[1]: Leaving directory `/usr/local/src/c-ares-1.10.0′

Step 3. Now configure CURL with Asynchornous DNS and all other required Protocols.

root@server1 [/usr/local/src/curl-7.46.0]# ./configure –enable-ares=/usr/local/src/c-ares-1.10.0 –enable-http –enable-imap –enable-pop3 –enable-ftp –enable-proxy –enable-tftp –enable-ntlm –enable-static –with-ssl=/usr/local/ssl –enable-ipv6 –enable-shared –disable-ldap –enable-gobher –enable-smtp –with-libidn –disable-rtsp –without-zlib
root@server1 [/usr/local/src/curl-7.46.0]#make
curl version: 7.46.0
Host setup: x86_64-pc-linux-gnu
Install prefix: /usr/local
Compiler: gcc
SSL support: enabled (OpenSSL)
SSH support: no (–with-libssh2)
zlib support: no (–with-zlib)
GSS-API support: no (–with-gssapi)
TLS-SRP support: no (–enable-tls-srp)
resolver: c-ares
IPv6 support: enabled
Unix sockets support: enabled
IDN support: enabled
Build libcurl: Shared=yes, Static=yes
Built-in manual: enabled
–libcurl option: enabled (–disable-libcurl-option)
Verbose errors: enabled (–disable-verbose)
SSPI support: no (–enable-sspi)
ca cert bundle: /etc/pki/tls/certs/ca-bundle.crt
ca cert path: no
LDAP support: no (–enable-ldap / –with-ldap-lib / –with-lber-lib)
LDAPS support: no (–enable-ldaps)
RTSP support: no (–enable-rtsp)
RTMP support: no (–with-librtmp)
metalink support: no (–with-libmetalink)
PSL support: no (libpsl not found)
HTTP2 support: disabled (–with-nghttp2)
Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS POP3 POP3S SMB SMBS SMTP SMTPS TELNET TFTP
root@server1 [/usr/local/src/curl-7.46.0]# make install
Making install in lib
make[1]: Entering directory `/usr/local/src/curl-7.46.0/lib’
make[2]: Entering directory `/usr/local/src/curl-7.46.0/lib’
/usr/bin/mkdir -p ‘/usr/local/lib’
/bin/sh ../libtool –mode=install /usr/bin/install -c libcurl.la ‘/usr/local/lib’
libtool: install: /usr/bin/install -c .libs/libcurl.so.4.4.0 /usr/local/lib/libcurl.so.4.4.0
libtool: install: (cd /usr/local/lib && { ln -s -f libcurl.so.4.4.0 libcurl.so.4 || { rm -f libcurl.so.4 && ln -s libcurl.so.4.4.0 libcurl.so.4; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libcurl.so.4.4.0 libcurl.so || { rm -f libcurl.so && ln -s libcurl.so.4.4.0 libcurl.so; }; })
libtool: install: /usr/bin/install -c .libs/libcurl.lai /usr/local/lib/libcurl.la
libtool: install: /usr/bin/install -c .libs/libcurl.a /usr/local/lib/libcurl.a
libtool: install: chmod 644 /usr/local/lib/libcurl.a
libtool: install: ranlib /usr/local/lib/libcurl.a
libtool: finish: PATH=”/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/sbin” ldconfig -n /usr/local/lib
———————————————————————-
Libraries have been installed in:
/usr/local/lib

Step 4 . Edit the file /var/cpanel/easy/apache/rawopts/all_php5 to enable custom CURL module with our downloaded latest asynchronous DNS package as below

root@server1 [~]# vim /var/cpanel/easy/apache/rawopts/all_php5
–with-gssapi
–with-curl=/usr/local/src/curl-7.46.0
–enable-ares=/usr/local/src/c-ares-1.10.0

Step 5. Run EasyApache to configure and install the latest CURL package.

root@server1 [~]#/scripts/easyapache

Step 6. Check and confirm the version and settings of the newly installed Curl version.

root@server1 [~]# curl-config –version
libcurl 7.46.0
root@server1 [/usr/local/src/curl-7.46.0]# curl-config –features –protocols
SSL
IPv6
UnixSockets
AsynchDNS
IDN
NTLM
NTLM_WB
DICT
FILE
FTP
FTPS
GOPHER
HTTP
HTTPS
IMAP
IMAPS
POP3
POP3S
SMB
SMBS
SMTP
SMTPS
TELNET
TFTP
root@server1 [/usr/local/src/curl-7.46.0]# curl –version
curl 7.46.0 (x86_64-pc-linux-gnu) libcurl/7.46.0 OpenSSL/1.0.1e c-ares/1.10.0 libidn/1.28
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile NTLM NTLM_WB SSL UnixSockets

Now you see our CURL is updated to the latest version available CURL 7.46.0 and it’s compiled with Asynchronous DNS to support all the required protocols. You can confirm the compiled curl status with a PHPINFO page.

curl_latest

PHP can be coded to make use of these asynchronous CURL requests to fasten the script execution more efficiently. I hope you find this article useful and informative. I would recommend your valuable comments and suggestions on this.

Enjoy!!

Install miniBB forum on CentOS 7

$
0
0

minibbminiBB or Mini Bulletin Board is a PHP based standalone, open source program for building your own Internet forums. In this tutorial we will install miniBB on a CentOS 7 VPS with Apache, PHP and MariaDB.

 

Log in to your CentOS server via SSH as user root

ssh rooot@your_IP

and first of all make sure that all packages installed on your server are up to date:

yum -y update

miniBB requires and empty database, so we will have to install a database server. Run the following command to install MariaDB server:

yum install mariadb mariadb-server

Start the MariaDB database server and enable it to start at the boot time:

systemctl start mariadb
systemctl enable mariadb

Run the ‘mysql_secure_installation’ script to secure the database server and set your MariaDB root password.

Log in to the MariaDB server using the MySQL ‘root’ user and create new database and user for miniBB:

mysql -u root -p

CREATE DATABASE minibb;
CREATE USER 'minibbuser'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON `minibb`.* TO 'minibbuser'@'localhost';
FLUSH PRIVILEGES;

Don’t forget to replace ‘PASSWORD’ with a strong password.

Install Apache web server

yum install httpd

Start the web server and add it to automatically start on the system start-up:

systemctl start httpd
systemctl enable httpd

miniBB is a PHP based application and it requires PHP. So, install PHP on your server:

yum install php php-common

Download the latest stable release of miniBB forum from their official website. At the moment of writing this article it is version 3.2.1.

Unpack the downloaded zip archive to the document root directory on your server:

unzip minibb.zip -d /var/www/html

If you are not sure where is your document root directory you can use the following command to find out:

grep -i '^documentroot' /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html"

Change the ownership of the miniBB files:

chown -R apache:apache /var/www/html/minibb

Now, open the ‘setup_options.php’ file which contains almost every common option of miniBB. We will enter the information of the MySQL database we created in this post and create a new administrator user.

vim /var/www/html/minibb/setup_options.php

$DBhost='localhost';
$DBname='minibb';
$DBusr='minibbuser';
$DBpwd='PASSWORD';
$admin_usr = 'ADMIN_USR';
$admin_pwd = 'ADMIN_PASSWORD';
$admin_email = 'admin@yourdomain.com';
$main_url='http://yourdomain.com';

More information about the options available in the configuration file you can find at miniBB’s official website

Next, create Apache virtual host for your domain. Create ‘/etc/httpd/conf.d/vhosts.conf’ file with the following content

vim /etc/httpd/conf.d/vhosts.conf

IncludeOptional vhosts.d/*.conf

and create the virtual host

vim /etc/httpd/vhosts.d/yourdomain.com.conf

<VirtualHost YOUR_SERVER_IP:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/html/minibb/"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined

<Directory "/var/www/html/minibb/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

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

systemctl restart httpd

Now, navigate your favorite web browser to http://yourdomain.com/_install.php to finish the miniBB installation.

How to Set Nginx as Reverse Proxy on Centos7 CPanel

$
0
0

Nginx is one of the fastest and most powerful web-server. It is known for its high performance and low resource utilization. It can be installed as both a standalone and a Reverse Proxy Web-server. In this article, I’m discussing about the installation of Nginx as a reverse proxy along with Apache on a CPanel server with latest CentOS 7 installed.

Nginx as a reverse proxy will work as a frontend webserver serving static contents along with Apache serving the dynamic files in backend. This setup will boost up the overall server performance.

Let’s walk through the installation steps for Nginx as reverse proxy in CentOS7 x86_64 bit server with cPanel 11.52 installed.

First of all, we need to install the EPEL repo to start-up with the process.

Step 1 : Install the EPEL repo.

root@server1 [/usr]# yum -y install epel-release
Loaded plugins: fastestmirror, tsflags, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 66.23.237.210
* base: mirrors.linode.com
* extras: mirrors.linode.com
* updates: mirrors.linode.com
Resolving Dependencies
–> Running transaction check
—> Package epel-release.noarch 0:7-5 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
epel-release noarch 7-5 extras 14 k

Step 2: After installing the repo, we can start with the installation of the nDeploy RPM repo for CentOS to install our required nDeploy Webstack and Nginx plugin.

root@server1 [/usr]# yum -y install http://rpm.piserve.com/nDeploy-release-centos-1.0-1.noarch.rpm
Loaded plugins: fastestmirror, tsflags, universal-hooks
nDeploy-release-centos-1.0-1.noarch.rpm | 1.7 kB 00:00:00
Examining /var/tmp/yum-root-ei5tWJ/nDeploy-release-centos-1.0-1.noarch.rpm: nDeploy-release-centos-1.0-1.noarch
Marking /var/tmp/yum-root-ei5tWJ/nDeploy-release-centos-1.0-1.noarch.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package nDeploy-release-centos.noarch 0:1.0-1 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
nDeploy-release-centos noarch 1.0-1 /nDeploy-release-centos-1.0-1.noarch 110

Step 3: Install the nDeploy and Nginx nDeploy plugins.

root@server1 [/usr]# yum –enablerepo=ndeploy install nginx-nDeploy nDeploy
Loaded plugins: fastestmirror, tsflags, universal-hooks
epel/x86_64/metalink | 9.9 kB 00:00:00
epel | 4.3 kB 00:00:00
ndeploy | 2.9 kB 00:00:00
(1/4): ndeploy/7/x86_64/primary_db | 14 kB 00:00:00
(2/4): epel/x86_64/group_gz | 169 kB 00:00:00
(3/4): epel/x86_64/primary_db | 3.7 MB 00:00:02

Dependencies Resolved

===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
nDeploy noarch 2.0-11.el7 ndeploy 80 k
nginx-nDeploy x86_64 1.8.0-34.el7 ndeploy 36 M
Installing for dependencies:
PyYAML x86_64 3.10-11.el7 base 153 k
libevent x86_64 2.0.21-4.el7 base 214 k
memcached x86_64 1.4.15-9.el7 base 84 k
python-inotify noarch 0.9.4-4.el7 base 49 k
python-lxml x86_64 3.2.1-4.el7 base 758 k

Transaction Summary
===============================================================================================================================================
Install 2 Packages (+5 Dependent packages)

With these steps, we’ve completed with the installation of Nginx plugin in our server. Now we need to configure Nginx as reverse proxy and create the virtualhost for the existing cPanel user accounts. For that we can run the following script.

Step 4: To enable Nginx as a front end Web Server and create the default configuration files.

root@server1 [/usr]# /opt/nDeploy/scripts/cpanel-nDeploy-setup.sh enable
Modifying apache http and https port in cpanel

httpd restarted successfully.
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/ndeploy_watcher.service to /usr/lib/systemd/system/ndeploy_watcher.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/ndeploy_backends.service to /usr/lib/systemd/system/ndeploy_backends.service.
ConfGen:: saheetha
ConfGen:: satest

As you can see these script will modify the Apache port from 80 to another port to make Nginx run as a front end web server and create the virtual host configuration files for the existing cPanel accounts. Once it is done, confirm the status of both Apache and Nginx.

Apache Status:

root@server1 [/var/run/httpd]# systemctl status httpd
● httpd.service – Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2016-01-18 06:34:23 UTC; 12s ago
Process: 25606 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 24760 (httpd)
CGroup: /system.slice/httpd.service
‣ 24760 /usr/local/apache/bin/httpd -k start

Jan 18 06:34:23 server1.centos7-test.com systemd[1]: Starting Apache Web Server…
Jan 18 06:34:23 server1.centos7-test.com apachectl[25606]: httpd (pid 24760) already running
Jan 18 06:34:23 server1.centos7-test.com systemd[1]: Started Apache Web Server.

Nginx Status:

root@server1 [~]# systemctl status nginx
● nginx.service – nginx-nDeploy – high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2016-01-17 17:18:29 UTC; 13h ago
Docs: http://nginx.org/en/docs/
Main PID: 3833 (nginx)
CGroup: /system.slice/nginx.service
├─ 3833 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
├─25473 nginx: worker process
├─25474 nginx: worker process
└─25475 nginx: cache manager process

Jan 17 17:18:29 server1.centos7-test.com systemd[1]: Starting nginx-nDeploy – high performance web server…
Jan 17 17:18:29 server1.centos7-test.com nginx[3804]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Jan 17 17:18:29 server1.centos7-test.com nginx[3804]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Jan 17 17:18:29 server1.centos7-test.com systemd[1]: Started nginx-nDeploy – high performance web server.

Nginx act as a frontend webserver running on port 80 and Apache configuration is modified to listen on http port 9999 and https port 4430. Please see their status below:

root@server1 [/usr/local/src]# netstat -plan | grep httpd
tcp 0 0 0.0.0.0:4430 0.0.0.0:* LISTEN 17270/httpd
tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 17270/httpd
tcp6 0 0 :::4430 :::* LISTEN 17270/httpd
tcp6 0 0 :::9999 :::* LISTEN 17270/httpd

apacheport
root@server1 [/usr/local/src]# netstat -plan | grep nginx
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 17802/nginx: master
tcp 0 0 45.79.183.73:80 0.0.0.0:* LISTEN 17802/nginx: master

The virtualhost entries created for the existing users as located in the folder “/etc/nginx/sites-enabled“. This file path is included in the Nginx main configuration file.

root@server1 [/etc/nginx/sites-enabled]# ll | grep .conf
-rw-r–r– 1 root root 311 Jan 17 09:02 saheetha.com.conf
-rw-r–r– 1 root root 336 Jan 17 09:02 saheethastest.com.conf

Sample Vhost for a domain:

server {

listen 45.79.183.73:80;
#CPIPVSIX:80;

# ServerNames
server_name saheetha.com www.saheetha.com;
access_log /usr/local/apache/domlogs/saheetha.com main;
access_log /usr/local/apache/domlogs/saheetha.com-bytes_log bytes_log;

include /etc/nginx/sites-enabled/saheetha.com.include;

}

We can confirm the working of the web server status by calling a website in the browser. Please see the web server information on my server after the installation.

root@server1 [/home]# ip a | grep -i eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
inet 45.79.183.73/24 brd 45.79.183.255 scope global dynamic eth0
root@server1 [/home]# nginx -v
nginx version: nginx/1.8.0

webserver-status

Nginx will create the virtual host automatically for any newly created accounts in cPanel. With these simple steps we can configure Nginx as reverse proxy on a CentOS 7/CPanel server.

Advantages of Nginx as Reverse Proxy:

  1. Easy to install and configure
  2. Performance and efficiency
  3. Prevent DDOS attacks
  4. Allows .htaccess PHP rewrite rules

I hope this article is useful for you guys. Thank you for referring to this. I would appreciate your valuable comments and suggestions on this for further improvements.

Install Ghost with Nginx on CentOS 7

$
0
0

ghostGhost is a free and open source blogging platform written in JavaScript and built on Node.js, designed to simplify the process of online publishing for individual bloggers as well as online publications.

The Ghost user interface is very simple and straightforward making it great for beginners as well as advanced users.

In this article we will install Ghost with Nginx on a CentOS 7 VPS. We will use our SSD 1 Linux VPS hosting plan with a clean CentOS environment which means that there is no PHP, Nginx and MySQL installed. We will only need PHP-FPM and Nginx for this tutorial, but if you need to install a full LEMP stack on CentOS 7 then you can easily do that by following our excellent article.

UPDATE THE SYSTEM

As always, make sure your server is fully up-to-date. Also install unzip and a text editor of your choice. We will use nano:

# yum update && yum install unzip nano

Install the EPEL repository after which you will be able to install Node.js and npm:

# yum install epel-release -y

Now install Node.js and npm:

# yum install nodejs npm --enablerepo=epel

Next, install a process manager so you can control your Node.js applications. This process manager will allow you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks. Enter the following command:

# npm install pm2 -g

Your next step is to install Nginx and PHP-FPM along with some much needed dependencies:

# yum install nginx php php-fpm php-cli php-mysql php-curl php-gd

Start Nginx and enable it to start on boot:

# systemctl start nginx
# systemctl enable nginx

INSTALL GHOST

First, create a directory for your Ghost website:

# mkdir /var/www/html/your_site

Enter the newly created dir:

# cd /var/www/html/your_site

Download the latest Ghost version:

# curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip

Unzip the archive:

# unzip ghost.zip

Delete the archive:

# rm ghost.zip

Now install the app with the npm installer:

# npm install -production

After the installation is completed, configure Ghost and update the URL in the config file with your domain. Copy the example config into a new file:

# cp config.example.js config.js

Open the file:

# nano config.js

Find the ‘Production’ section and update the URL with your domain. After modifying it should look like this:

// ### Production
    // When running Ghost in the wild, use the production environment.
    // Configure your URL and mail settings here
    production: {
        url: 'http://your_domain',

Save and close the file.

Now you can use the process manager that we installed earlier to configure Ghost to run forever. Execute the below command:

# NODE_ENV=production pm2 start index.js --name "Ghost"

To start/stop/restart Ghost you can use:

# pm2 start Ghost

# pm2 stop Ghost

# pm2 restart Ghost

Your next step is to configure Nginx to act as a reverse proxy for your Ghost application. Open a config file:

# nano /etc/nginx/conf.d/your_domain.conf

Paste the following:

upstream ghost {
    server 127.0.0.1:2368;
}

server {
    listen      80;
    server_name your_domain;

    access_log  /var/log/nginx/ghost.access.log;
    error_log   /var/log/nginx/ghost.error.log;

    proxy_buffers 16 64k;
    proxy_buffer_size 128k;

location / {
        proxy_pass  http://ghost;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        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;
        proxy_set_header    X-Forwarded-Proto https;
    }

}

Don’t forget to replace your_domain with your actual domain. Save and close the file.

Test the Nginx configuration and restart Nginx so the changes can take effect:

# nginx -t

# service nginx restart

Congratulations, you have successfully installed Ghost on your CentOS 7 VPS. Now open your favorite web browser and navigate to http://your_domain/ghost and create an admin user.

For more information about how manage your Ghost blog ,please refer to the their website.

CentOS 7 Review

$
0
0

According to the CentOS website’s about page, CentOS is a stable, predictable, manageable and reproducable platform derived from the sources of Red Hat Linux.
If we were talking in terms of Ghostbusters, Fedora Linux would be Venkman and CentOS would be Spengler. Fedora is basically more up to date but can be unpredictable whereas CentOS is more like Debian in that it is stable and trustworthy.
CentOS is basically a community version of Red Hat Linux without the branding. That means it should be good right?
Well let’s find out.

How To Get CentOS Linux

To download the latest version of CentOS visit https://www.centos.org/download/.
The download page has 3 big orange buttons with options as follows:

  • DVD ISO
  • Everything ISO
  • Minimal ISO

The DVD is a large download (over 4 gigabytes) which is ok if you have a nice fiberoptic broadband connection but for many people too big.
If the DVD ISO is too big then the Everything ISO is even bigger at 7.1 gigabytes.
The minimal ISO is much smaller but it is like the Ubuntu minimal ISO or the Debian minimal ISO in that it just gives the basic operating system with no GUI.
What we really want is a live DVD and the three big orange buttons don’t provide it.
This link provides a list of download mirrors for CentOS. Clicking on a mirror will show a list of available ISO files. You should find the following live versions:

  • KDE Desktop
  • GNOME Desktop

If all that seems too much effort you can always buy a CentOS DVD or USB drive.
I chose to use the GNOME version because I just so happen to prefer GNOME to KDE.

Installation

The tool I used to create a live USB drive was Win32 Disk Imager (Windows) or if you are using Linux you can use the dd command.
The CentOS installer is the same one used by Fedora.
This guide shows how to create a bootable Fedora USB drive and this guide shows how to install Fedora.These guides will also work for CentOS.

First Impressions


After installing from the live GNOME dvd CentOS boots into the Gnome Classic desktop.
A browser appears with a getting started guide. The best place for information about CentOS however is the CentOS Wiki.
The desktop has the CentOS 7 wallpaper and two panels (one at the top and bottom).
The panel at the top has the applications and places menus on the left side and system icons on the right side for audio, bluetooth, network, power and user settings.
Personally I prefer the actual Gnome desktop to the classic one. If you feel the same way then switch to the Gnome desktop. Log out by clicking on your username in the top right corner and select “Log Out”.
When logging back in click on the settings cog and choose the Gnome desktop instead of the Gnome Classic desktop.

The GNOME desktop is easy to navigate with an activities menu in the top corner and the same system icons on the top right.
Use the keyboard to bring up the activities by pressing the super key (windows key).
The activities window has a search box in the top middle, a launch bar with icons to your favourite applications on the left and workspaces on the right. Any open applications will appear in the centre and you can scroll through them.
I have written a guide listing all of the Gnome keyboard shortcuts.

Applications


CentOS has a decent set of applications which come as default:

  • Boxes – Virtualisation (like VirtualBox)
  • Brasero – DVD burner
  • Calculator
  • Cheese – Webcam Viewer
  • Clock
  • Contacts
  • Documents – Document Viewer
  • Ekiga Softphone – VOIP
  • Empathy – Chat client
  • Evolution – Email Client
  • Files – File Manager
  • FireFox – Web Browser
  • gEdit – Text Editor
  • LibreOffice – Office Suite
  • Rhythmbox – Audio Player
  • Shotwell – Photo Manager
  • Youtube Browser

I used Boxes to get some screenshots for the installation process and loaded CentOS 7 as a virtual machine. (I am thinking of loading another CentOS 7 in the boxes on the virtual machine and keep doing it, like one of those window within window effects).
Boxes wouldn’t allow me to add a virtual machine however due to the way SELinux is working. I had to change the SELinux settings to be permissive.
Evolution is the standard email client, which coincidentally was top of my list of best Linux email clients which I produced recently.
FireFox is the default web browser and is my second choice web browser behind Chrome (as highlighted in my list of the best Linux web browsers).
Other than that there isn’t much to report. There is LibreOffice which pretty much every distribution ships with as an alternative to MS Office and Rhythmbox which is a decent audio player which ships with GNOME anyway.

Flash, Multimedia Codecs and Video

As CentOS is a community distribution you should not be surprised to find out that Flash doesn’t work without a little bit of extra work. Flash, who cares right?
The point of this section therefore is to make you aware of this webpage which shows how to install Flash, multimedia codecs and other useful packages like Handbrake, SMPlayer and VLC.
(https://wiki.centos.org/TipsAndTricks/MultimediaOnCentOS7)
Whilst I am here it is also worth sending you in the direction of these two articles from the Dedoimedo site which show how to create the perfect CentOS experience.
http://www.dedoimedo.com/computers/centos-7-perfect-desktop.html
http://www.dedoimedo.com/computers/centos-7-perfect-desktop-more.html

Installing Applications

The graphical package manager is the GNOME software tool.
It has a simple interface with categories down the left, found packages in the top right and a description in the bottom right, as well as buttons for installing packages, visiting the package’s website, and highlighting dependencies.
The most important part of this software is the menu which in GNOME will appear on the top bar away from the main application itself. I highlight this point because it is easy to forget the menus are there sometimes.
The menu has an option called “only show native packages”. If left on, this can lead to frustration as you will search for software which you know should be there but doesn’t show up in the list.
The menu also has a link to the software sources. This is where you can get access to the non-free repositories and CentOS extra repositories.

Connecting To Network Storage


I have a WD MyCloud as a network storage device. To be honest it drives me mad but not because of Linux but because it keeps losing it’s network connection.
Anyhow, none of this is CentOS’s concern because connecting to it is a breeze. Simply open Nautilus (the file manager) and select “Browse Network”. As you can see from the picture above, CentOS has no issues with regards to accessing the device.

Printing

As with accessing the network storage, setting up the printer did not cause me any headaches either.
Simply search for print settings from the search menu and then click add.
As I have a network printer it was found straight away with no extra work required to get it to print.

Issues

There were no major issues found whilst using CentOS. Like I mentioned before there was a permissions issue whilst trying to use Boxes but that is about it.
All in all after 2 weeks use I am happy to say that there have been no dramas and that really is what CentOS is all about. Steady, run of the mill, desktop computing.

Summary

CentOS is everything I expected it would be. It is reasonably easy to install, solid and dependable.
If you are new to Linux then you shouldn’t find this too difficult to master.
There are no oddballs nor are there any real quirks. In fact it is really hard to summarise CentOS in great detail.
It is just good.
The CentOS WIKI will become your best friend though whilst using it.

How to reset the root password on Linux and FreeBSD

$
0
0

How to reset the root password on Linux and FreeBSD

Listed below are the step by step procedures to reset the root password in different versions of CentOS, CoreOS, Debian, Ubuntu and FreeBSD. Begin this procedure by booting your server into single user mode. If you have direct (physical access) to the server, then just reboot it and proceed with the steps for your OS below. In case that the server is in a datacenter and only accessible by remote console, begin with accessing customer portal of your server hosting provider and search for the KVM or server console. The rest of options are different and dependent on bootloader version in a machine.

CentOS 7, Ubuntu and Debian

Restart the server via any one of the two options. Choose [RESTART] button or click [View Console] and proceed further to click CTRL+ALT+DEL appearing on the top to the right. While booting, press ESC to open boot prompt.

GRUB boot prompt appears on screen, type e which opens the edit option for boot. (Upon absence of GRUB prompt, one can press any key before machine boot to open the prompt).

Type: “/bin/bash" (without the qoutes) at the end of line that has “linux/boot/" in the beginning.

Press F10 or CTRL-X to boot it again. Upon booting, the root prompt opens up. Key in

mount -rw -o remount /

followed by

passwd

to successfully change the root password. Reboot again.

CentOS 6

Restart the server by clicking [RESTART] or click [View Console] and choose the send CTRL+ALT+DEL button which is visible on top to the right.

GRUB boot prompt appears on screen, prompting you to press a key – this prompting waits for few seconds before automatically booting the machine. (If you miss the chance to key in your option, restart VM and follow it from step one).

Once GRUB prompt opens up, type a in the boot command to begin append process. Type single and hit enter.

This should boot your system and open root prompt. Once in root prompt write passwd to reset root-password. Reboot again.

CoreOS requires an SSH key to proceed further

CoreOS makes use of SSH key for authentication in a default mode. Password and Root user are created using Vultr, during which one can select SSH key in VPS. This key is to be given when one has to log in as ‘‘core’’ user mode. Resetting standard root login is achieved when sudo passwd is executed as ‘‘core’’. It requires logging in as ‘‘core’’ via SSH key.

In case of loss/missing SSH key

One can login to ‘‘core’’ user via grub loader editor. Listed below are easy steps to follow in case of missing SSH key.

Restart the server by clicking [RESTART] or choose [View Console] and choose send CTRL+ALT+DEL button which is visible on top to the right.

GRUB boot prompt appears on screen, type e which opens the edit option for boot.(Upon absence of GRUB prompt, one can press any key before machine boot to open the prompt). Typecoreos.autologin=tty 1 (without quotes) at the line which has linux$ in the beginning.

Press F10 or CTRL-X to boot it again. Upon booting, you have successfully logged in as ‘‘core’’. Do not forget to reboot the server after resetting the login.

FreeBSD

The boot menu in FreeBSD offers a user to boot via single-user mode. Press appropriate key to choose single-user mode.

When root prompt opens up, write “passwd" (without quotes). Reboot your server again.

How to install Fail2Ban on CentOS 7

$
0
0

How to install Fail2Ban on CentOS 7

Most Linux servers offer an SSH login via Port 22 for remote administration purposes. This port is a well-known port, therefore, it is often attacked by brute force attacks. Fail2ban is a software that scans log files for brute force login attempts in real-time and bans the attackers with firewalld or iptables. Fail2ban recognizes unwanted access or security breach efforts to the server within the administrator set time frame and blocks the IP addresses which show signs of brute force attacks or dictionary attacks. This program works in the background and continuously scans the log files for unusual login patterns and security breach attempts.

This tutorial shows the installation and configuration of Fail2Ban with firewalld on CentOS 7.

Installing Fail2Ban

To install Fail2Ban on CentOS 7, we will have to install EPEL (Extra Packages for Enterprise Linux) repository first. EPEL contains additional packages for all CentOS versions, one of these additional packages is Fail2Ban.

The following commands must be executed after switching to the root user.

yum install epel-release

yum install fail2ban fail2ban-systemd

If you have SELinux installed, then update the SELinux policies:

yum update -y selinux-policy*

Configure settings for Fail2Ban

Once installed, we will have to configure and customize the software with a jail.local configuration file. The jail.local file overrides the jail.conf file and is used to make your custom configuration update safe.

Make a copy of the jail.conf file and save it with the name jail.local:

cp -pf /etc/fail2ban/jail.conf /etc/fail2ban/jail.local

Open the jail.local file for editing in Nano with the following command.

nano /etc/fail2ban/jail.local

The file code may consist of many lines of codes which execute to prevent a ban on one or many IP addresses, set bantime duration, etc. A typical jail configuration file contains the following lines.

[DEFAULT]
#
# MISCELLANEOUS OPTIONS
#
# "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
# ban a host which matches an address in this list. Several addresses can be
# defined using space separator.
ignoreip = 127.0.0.1/8
# External command that will take an tagged arguments to ignore, e.g. <ip>,
# and return true if the IP is to be ignored. False otherwise.
#
# ignorecommand = /path/to/command <ip>
ignorecommand =
# "bantime" is the number of seconds that a host is banned.
bantime = 600
# A host is banned if it has generated "maxretry" during the last "findtime"
# seconds.
findtime = 600
# "maxretry" is the number of failures before a host get banned.
maxretry = 5

Ignoreip is used to set the list of IPs which will not be banned. The list of IP addresses should be given with a space separator. This parameter is used to set your personal IP address (if you access the server from a fixed IP).

Bantime parameter is used to set the duration of seconds for which a host needs to be banned.

Findtime is the parameter which is used to check if a host must be banned or not. When the host generates maxrety in its last findtime, it is banned.

Maxretry is the parameter used to set the limit for the number of retry’s by a host, upon exceeding this limit, the host is banned.

Add a jail file to protect SSH.

Create a new file with the Nano editor

nano /etc/fail2ban/jail.d/sshd.local

To the above file, add the following lines of code.

[sshd]
enabled = true
port = ssh
#action = firewallcmd-ipset
logpath = %(sshd_log)s
maxretry = 5
bantime = 86400

Parameter enabled is set to true, in order to provide protection, to deactivate protection, it is set to false. The filter parameter checks the sshd configuration file, located in the path /etc/fail2ban/filter.d/sshd.conf.

The parameter action is used to derive the IP address which needs to be banned using the filter available from /etc/fail2ban/action.d/firewallcmd-ipset.conf.

Port parameter may be changed to a new value such as port=1212, as is the case. When using port 22, there is no need to change this parameter.

Logpath provides the path where the log file is stored. This log file is scanned by Fail2Ban.

Maxretry is used to set the maximum limit for failed login entries.

Bantime parameter is used to set the duration of seconds for which a host needs to be banned.

Running Fail2Ban service

When you are not running the CentOS Firewall yet, then start it:

systemctl enable firewalld
systemctl start firewalld

Execute the following lines of command to run the protective Fail2Ban software on the server.

systemctl enable fail2ban
systemctl start fail2ban

Tracking Failed login entries

The following command is used to check whether there had been failed attempts to login to sever via ssh port.

cat /var/log/secure | grep ‘Failed password’

Executing above command will get a list of failed root password attempts from different IP addresses. The format of results will be similar to the one showed below:

Fer 8 12:41:12 htf sshd[5487]: Failed password for root from 108.61.157.25 port 23021 ssh2
Fer 8 12:41:15 htf sshd[1254]: Failed password for root from 108.61.157.25 port 15486 ssh2
Fer 8 12:41:16 htf sshd[1254]: Failed password for root from 108.61.157.25 port 24457 ssh2
Fer 8 12:41:18 htf sshd[1254]: Failed password for root from 108.61.157.25 port 24457 ssh2

Checking the banned IPs by Fail2Ban

The following command is used to get a list of banned IP addresses which were recognized as brute force threats.

iptables -L -n

Check the Fal2Ban Status

Use the following command to check the status of the Fail2Ban jails:

fail2ban-client status

The result should be similar to this:

[root@htf ]# fail2ban-client status
Status
|- Number of jail: 1
`- Jail list: sshd

Unbanning an IP address

In order to remove an IP address from the banned list, parameter IPADDRESS is set to appropriate IP which needs unbanning. The name “sshd” is the name of the jail, in this case the “sshd” jail that we configured above. The following command does the job.

fail2ban-client set sshd unbanip IPADDRESS


How to Install Kolab Groupware Server on CentOS 7

$
0
0

How to Install Kolab Groupware Server on CentOS 7

Kolab is a free open source groupware server. It is a scalable and reliable collaborative software that provides shared email, calendar, address books, tasks and a file cloud. Kolab supports several client environments: on Windows you can use Outlook, on Linux, you can use KDE Kontact, on all OS that have a web browser you can use the web interface. Kolab is a secure groupware solution that uses the IMAP protocol for email and LDAP as the backend to store the users, configuration and contact details.

In this tutorial, we will install Kolab groupware on a CentOS 7 server.

Prerequisite

  • CentOS 7 server – 64bit.
  • Root privileges.

Step 1 – Disable SELINUX

According to the Kolab Documentation, not all Kolab modules are compatible with SELinux, therefore, we have to disable SELinux first. Hopefully, this changes in future as SELinux is an important aspect to keep servers secure. To disable SELinux, we have to edit the file ‘/etc/selinux/config’ with vim editor and then change enforcing or permissive to disabled.

vim /etc/selinux/config

Change the SELINUX value to disabled.

SELINUX=disabled

Save the file and exit.

Step 2 – Configure Firewalld

On CentOS 7 we will turn on the firewalld. We will configure firewalld and open some ports that are required by Kolab. By default, firewalld is disabled and we need to turn it on and make sure it’s run at the boot time.

Start firewalld and enable it to start at boot time:

systemctl enable firewalld
systemctl start firewalld

Firewalld is started. Now we have to open some ports for Kolab. Create a new bash file named ‘firewall_cmd.sh’ with the vim editor.

cd ~/
vim firewall_cmd.sh

Paste the bash script below:

#!/bin/sh
for s in ssh http https pop3s imaps smtp ldap ldaps
do
firewall-cmd --permanent --add-service=$s
done
for p in 110/tcp 143/tcp 587/tcp
do
firewall-cmd --permanent --add-port=$p
done
firewall-cmd --reload

Save the file and exit.

Now make the script executable and run it:

chmod +x firewall_cmd.sh
./firewall_cmd.sh

The script will open the firewall ports for HTTP, HTTPS, IMAPS, LDAP, LDAPS, POP3S, SMTP and SSH.

We can check it with the command below:

firewall-cmd –list-all

Check the firewall.

Step 3 – Configure the domain (FQDN)

The FQDN or Fully Qualified Domain Name is an absolute domain name for the host or computer on the internet. It consists of two main parts, the hostname, and the domain. In this tutorial, I will use the hostname “madhouse” and the domain name “kolab.me”. This results in the server FQDN “madhouse.kolab.me”. This just the FQDN of my test server, you should use a FQDN based on your own domain name here.

To check your hostname, you can use command below:

hostname

Edit the /etc/hosts file to configure FQDN on the server:

vim /etc/hosts

Add your IP (or edit the line with your IP, if it is already there), then add your hostname + domain name and then your hostname:

IPADDRESS madhouse.kolab.me madhouse

Save and exit.

Next edit the file /etc/sysconfig/network.

vim /etc/sysconfig/network

And add the hostname there too:

madhouse

Save and exit.

Now check the hostname and FQDN again with (it might be nescessary to reboot if the new name does not show up yet):

hostname

hostname -f

Set the Hostname on CentOS.

The FQDN configuration is done.

Step 4 – Install EPEL Repository

Install the EPEL repository with this rpm command:

rpm -Uhv https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Then install plugin-priorities.

yum install -y yum-plugin-priorities

The next step is installing Kolab.

Step 5 – Install and Configure Kolab

Add the Kolab repository to your Centos server by downloading the repository file to the yum.repos.d directory.

cd /etc/yum.repos.d/
wget http://obs.kolabsys.com/repositories/Kolab:/16/CentOS_7/Kolab:16.repo

Ensure the Kolab repository has a higher priority than the other repositories like EPEL etc.

for f in /etc/yum.repos.d/Kolab*.repo; do echo “priority = 60” >> $f; done

Next, import the GPG key that is used to sign the packages.

rpm –import https://ssl.kolabsys.com/community.asc

And install Kolab with this command:

yum -y install kolab

Wait until the installation process is finished. Now we have to configure Kolab by configuring the LDAP password, the domain name, the MySQL password etc. We can do that with setup-kolab command:

setup-kolab

You will be asked to type in the password for the LDAP administrator user “admin”, make sure that your password is strong. I recommended to use a long password.

Administrator password [3HQM01i8oUa9LUB]: TYPE YOUR PASSWORD
Confirm Administrator password: CONFIRM

Directory manager password configuration.

Directory Manager password [DLQjpdhyUOlwljy]: TYPE YOUR PASSWORD
Confirm Directory Manager password: CONFIRM

We can use the default user for Kolab, Kolab will run as ‘nobody’.

User [nobody]: Press Enter
Group [nobody]: Press Enter

Next, we will be asked about the domain name. The domain name is obtained from the reverse DNS (rDNS), make sure you have it in your DNS configuration.

kolab.me [Y/n]: Y
dc=kolab,dc=me [Y/n]: Y

Now configure the Cyrus administrator password. The password is used by Kolab to execute some tasks by Cyrus IMAP.

Cyrus Administrator password [GH8pw5CdNaQIBv5]: TYPE YOUR PASSWORD
Confirm Cyrus Administrator password: CONFIRM

Then configure the Kolab service password, this is used by some services like a postfix, roundcobe.

Kolab Service password [sTeZFB-7nxS6Osg]: TYPE YOUR PASSWORD
Confirm Kolab Service password: CONFIRM

Now all services will start. Then we have to configure the MySQL password for Kolab.

What MySQL server are we setting up?
– 1: Existing MySQL server (with root password already set).
– 2: New MySQL server (needs to be initialized).
Choice: 1

Enter your MySQL root password.

MySQL root password:

Next configure the MySQL password for user “kolab”.

MySQL kolab password [4quZUHanM7b3bHF]: TYPE YOUR PASSWORD
Confirm MySQL kolab password: CONFIRM

Timezone configuration: type in your timezone.

Timezone ID [UTC]: Asia/Jakarta

And finally the password for the MySQL user ’roundcube’. This password will be used by the Roundcube webmail interface.

MySQL roundcube password [IuCKSeFk_udD9-G]: TYPE YOUR PASSWORD
Confirm MySQL roundcube password: CONFIRM

Kolab is installed and configured. Now you can visit the Kolab admin: IP/kolab-webadmin/.

Kolab admin login.

Login with username and password:

username = cn=Directory Manager
Password = YOUR PASSWORD

And then you will see the Kolab admin page.

The Kolab administration interface.

Done. Kolab is installed and configured so we can start using it.

Conclusion

Kolab is an open source groupware server that provides a shared email, calendar, and address book service. On the server side, Kolb can be installed on Ubuntu, Centos or Debian easily. On the client side, we can use Windows with Outlook, Linux with KDE Kontact, or we can use a web browser. Kolab is simple and easy to use: for the installation, we just need to configure the server FQDN correctly and then add the Kolab repository and install it.

How to install LiteSpeed web server on CentOS 7

$
0
0

How to install LiteSpeed web server on CentOS 7

LiteSpeed web server is a popular choice for replacing Apache web server. Its features include an optimization of the web content and content delivery which maximizes the download speed and combines better performance with a smaller memory footprint. Being compatible with Apache features is also an added benefit, which helps to reduce downtime during migration from Apache to LiteSpeed. This installation assumes that you have installed a clean CentOS 7 server.

There are 3 editions of this software available:

  • OpenLiteSpeed is the open-source version of the LiteSpeed server.
  • The LiteSpeed standard edition, as well as OpenLiteSpeed, are available free of charge.
  • LiteSpeed is also available in advanced commercial web server package.

Before any server package installation, the server must be checked for updates and these have to be installed. So we start with the command yum update.

yum update -y

The output should be similar to the one below:

Update CentOS with yum.

This may take some time, depending on how frequently the server is updated. Do not interrupt the update.

Installing the Developer Tools for LiteSpeed

Use these yum commands to install the development tools first and then the libraries for LiteSpeed.

sudo yum groupinstall ‘Development Tools’

sudo yum install libxml2-devel.x86_64 openssl-devel.x86_64 bzip2-devel.x86_64 libcurl-devel.x86_64 db4-devel.x86_64
libjpeg-devel.x86_64 libpng-devel.x86_64 libXpm-devel.x86_64 freetype-devel.x86_64 gmp-devel.x86_64
libc-client-devel.x86_64 openldap-devel.x86_64 libmcrypt-devel.x86_64 mhash-devel.x86_64 freetds-devel.x86_64
zlib-devel.x86_64 mysql-devel.x86_64 ncurses-devel.x86_64 pcre-devel.x86_64 unixODBC-devel.x86_64 postgresql-devel.x86_64
sqlite-devel.x86_64 aspell-devel.x86_64 readline-devel.x86_64 recode-devel.x86_64 net-snmp-devel.x86_64
libtidy-devel.x86_64 libxslt-devel.x86_64 t1lib-devel.x86_64

The install output should be similar to the one below:

Installing Developer tools.

After installing the said developer tools, one can proceed to download the free standard package from LiteSpeed.

Downloading LiteSpeed Package using wget

To get the LiteSpeed standard edition package file, one must acquire the web link at which this is available. To get this, one can go to LiteSpeed website and search for Linux (x86_64) LiteSpeed Standard edition, that’s the version for 64Bit Linux systems which should be the default on today’s server.

If you are unsure, run the command:

uname -a

Which returns the Kernel version. If it contains the word “x86_64” then you run a 64Bit Kernel.

To copy the link, right click on it and select copy link address. The address to the link may resemble:

http://www.litespeedtech.com/packages/5.0/lsws-5.0.12-ent-x86_64-linux.tar.gz

Now use the wget command and append the link address to it. The format to use wget is:

wget URL

Following the above example, the command to download LiteSpeed Standard Edition is:

wget http://www.litespeedtech.com/packages/5.0/lsws-5.0.12-ent-x86_64-linux.tar.gz

Sample output:

Download LiteSpeed with Wget.

Next step is to unpack the tar file. Execute the folowing command to do the same.

tar -zxvf lsws*

Sample output:

Unpack the LiteSpeed Archive.

Installation of LiteSpeed

The installation is started by running the install.sh file located in LiteSpeed folder. In order to do so, change directory to LiteSpeed and then follow the execute command as shown below:

./install.sh

Upon running this command, user agreement terms are showcased. One can scroll down the terms and conditions agreement by pressing the space bar, and reach the declaration at the end which displays:

IMPORTANT: In order to continue installation you must agree with above
license terms by typing "Yes" with capital "Y"!

Sample output:

LiteSpeed License.

Upon agreement, press Y, which prompts the user to select the directory for installation. To continue installation in a default directory simply hit enter, when the following comes on screen.

Please specify the destination directory. You must have permissions to
create and manage the directory. It is recommended to install the web server
at /opt/lsws, /usr/local/lsws or in your home directory like '~/lsws'.
ATTENTION: The user 'nobody' must be able to access the destination
directory.
Destination [/usr/local/lsws]:

Sample output:

Choose a installation directory for LiteSpeed.

A prompt which asks to enter administrator username and password details comes up. The password is necessary for logging into web interface later. Continue giving appropriate details and hit enter. The screen will look like the following:

Please specify the user name of the administrator.
This is the user name required to log into the administration web interface.
User name [admin]:

Sample output:

Select the admin Username.

In the event that you want to use the name “admin”, simply press enter. I recommend that you change the name for security reasons. Enter your custom administrator username and hit enter.

You will now be asked to enter a password for your administrator user. You will need to use this password later to access the web interface.

Please specify the administrator's password.
This is the password required to log into the administration web interface.
Password:

Sample output:

Set the admin password.

The password that you use must be secure so that no one can guess or access it via random methods. Otherwise, they may be able to manage, and access your server.

The prompt will then ask for an email address, to mail any important or urgent notification related to installation or server performance and maintenance. You can add a list of email addresses separated by commas.

Please specify administrators' email addresses.
It is recommended to specify a real email address,
Multiple email addresses can be set by a comma
delimited list of email addresses. Whenever something
abnormal happened, a notificiation will be sent to
emails listed here.
Email addresses [root@localhost]:

For example:

Email addresses [root@localhost]: [email protected]

When providing a list of email addresses, the following syntax must be followed.

Email addresses [root@localhost]: [email protected], [email protected]

Sample output:

Configure the Notification email addresses.

The installer will then prompt to provide the user name under which this server is run. You can either create a separate user with non-root privileges and provide the details here or choose the default user “nobody”. It is important that root user should not run the server. It makes the server vulnerable and insecure. The following is displayed on screen which prompts you to enter the user name.

As you are the root user, you must choose the user and group
whom the web server will be running as. For security reason, you should choose
a non-system user who does not have login shell and home directory such as
'nobody'.
User [nobody]:

Sample output:

LiteSpeed will run under this Linux username.

When you are unsure of what to enter, it is best to leave the username as ”nobody”. Continue this in the next prompt which resembles the following:

Please choose the group that the web server running as.
User 'nobody' is the member of following group(s):  nobody
Group [nobody]:

Confirm the group.

The next prompt is for providing details on which port LiteSpeed shall listen. The default port for web servers is port 80 and I recommend to keep that. This helps in simplifying the URL for the visitors, which otherwise would have required the mentioning of the port number after the URL. For specialized access, this port number may be changed to appropriate value.

Please specify the port for normal HTTP service.
Port 80 is the standard HTTP port, only 'root' user is allowed to use
port 80, if you have another web server running on port 80, you need to
specify another port or stop the other web server before starting LiteSpeed
Web Server.
You can access the normal web page at http://<YOUR_HOST>:<HTTP_PORT>/
HTTP port [8088]: 80

Sample output:

Choose the http port.

LiteSpeed provides a separate administration interface to ease management of the web server. The default port that it runs on is 7080. You can change it if you are specific about listening on other port. To open up administration web interface, the web URL must be given as http://domain.com:port.

Please specify the HTTP port for the administration web interface,
which can be accessed through http://<YOUR_HOST>:<ADMIN_PORT>/
Admin HTTP port [7080]:

Sample output:

Choose the admin port.

Then the prompt will ask for details regarding usage of PHP. In case you are using a CMS like, WordPress or Joomla, PHP needs to be enabled. To enable PHP, enter Y otherwise type N.

You can setup a global script handler for PHP with the pre-built PHP engine
shipped with this package now. The PHP engine runs as Fast CGI which
outperforms Apache's mod_php.
You can always replace the pre-built PHP engine with your customized PHP engine.
Setup up PHP [Y/n]: Y

Sample output:

Choose wther PHP shall be installed.

After this prompt, you can specify a different PHP file extension. Normally it is not necessary to specify a different extension here, so just hit enter and proceed further.

Suffix for PHP script(comma separated list) [php]:

Sample output:

Select the PHP file extension.

The next prompt asks for providing details in case you are interested in using AWStats. This is a program which is a statistics generation tool used to check visitor numbers, page views etc. To be able to collect detailed visitor information, enter Y otherwise type N and proceed further.

AWStats is a popular log analyzer that generates advanced web server
statistics. LiteSpeed web server seamlessly integrates AWStats into
its Web Admin Interface. AWStats configuration and statistics update
have been taken care of by LiteSpeed web server.
Note: If AWStats has been installed already, you do not need to
install again unless a new version of AWStats is available.
Would you like to install AWStats Add-on module [y/N]? N

Sample output:

Enable AWStats in LiteSpeed.

The next prompt will probe whether you prefer LiteSpeed to run automatically whenever the server is restarted. Write Y to avoid downtimes in a server.

Would you like to have LiteSpeed Web Server started automatically
when the server restarts [Y/n]? Y

This, when executed, notifies about successful startup script addition for LiteSpeed and prompts the user to choose to start the server right now. Type Y to do the same, or N to start it manually at a later stage. I recommend to start it right now.

[OK] The startup script has been successfully installed!
Would you like to start it right now [Y/n]? Y

Upon successful installation, the following message is displayed.

LiteSpeed Web Server started successfully! Have fun!

Sample output:

The installation is finished.

After this is successful installation message, accessing server by IP or the domain name will open up a default web page. Now, you can get building your website.

Firewall Configuration

To allow the visitor traffic to access the server, web ports, 80 (server port) and 7080 (administration web interface) must be opened. Most CentOS 7 Servers use firewalld, These commands open the ports in firewalld:

firewall-cmd –permanent –zone=public –add-service=http
firewall-cmd –permanent –zone=public –add-port=7080/tcp
firewall-cmd –reload

If you use a IPTables firewalla nd not firewalld, then use these commands instead.

iptables -I INPUT -p tcp –dport 80 -j ACCEPT
iptables -I INPUT -p tcp –dport 7080 -j ACCEPT
service iptables save

In case you have altered the port numbers during script installation, do reflect the same in the iptables and firewalld rules.

Congratulations on your new functional LiteSpeed server.

CentOS 7 & Nvidia kmod tutorial

$
0
0

 

Ladies and gentlemen, you know I like CentOS quite a bit. It’s really a dandy operating system, for home use as well as work, or if you want, the other way around, and it really surprises with its simplicity and flexibility. True, we started on the wrong foot due to a rather severe lack of extra repos and stuff, then we fixed it, and pimped it to the max.

With the release of build 1503, things are looking even brighter, and I thought this would be a good opportunity to refresh my Nvidia guide for this fine distro, and this time show you how it’s done using the ELRepo kmod package, so you don’t have to manually reinstall the driver every time there’s a kernel upgrade. Let us.

Teaser

Preparations

You don’t need to bother too much, but it’s always useful to have the necessary build tools in place and blacklist Nouveau, which we have already learned how to do in the first article. Now, once this step is done, we need a new repo. To add the ELRepo, uh, repo, you will need to perform two steps. The first one is to get the repository key, so you don’t get warnings about unsigned packages.

rpm –import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

And after that, install the binary. Do note the exact version could change, so consult the website if you get a 404 not found error.

rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

Search for Nvidia drivers

Next, let’s search for the drivers – yum search nvidia. You will get a long list of entries, and we need to understand what we get here. What you want is the kmod-nvidia package with the right architecture (32-bit or 64-bit) and the driver version that best suits your needs. Even on my elderly LG laptop, the 340 series is quite all right.

Then, you also want the compatibility files that match the selected version. Lastly, it’s not a bad idea to also install the nvidia-detect tool, which can also check for conflicts. The results are self-explanatory, but I can understand where people new to Linux or CentOS might struggle.

kmod-nvidia.x86_64 : nvidia kernel module(s)
kmod-nvidia-304xx.x86_64 : nvidia-304xx kernel module(s)
kmod-nvidia-340xx.x86_64 : nvidia-340xx kernel module(s)
nvidia-detect.x86_64 : NVIDIA graphics card detection utility
nvidia-x11-drv.x86_64 : NVIDIA OpenGL X11 display driver files
nvidia-x11-drv-304xx.x86_64 : NVIDIA 304xx OpenGL X11 display driver files
nvidia-x11-drv-304xx-32bit.x86_64 : Compatibility 32-bit files for the 64-bit : Proprietary NVIDIA driver
nvidia-x11-drv-32bit.x86_64 : Compatibility 32-bit files for the 64-bit : Proprietary NVIDIA driver
nvidia-x11-drv-340xx.x86_64 : NVIDIA OpenGL X11 display driver files
nvidia-x11-drv-340xx-32bit.x86_64 : Compatibility 32-bit files for the 64-bit : Proprietary NVIDIA driver
yum-plugin-nvidia.noarch : Yum plugin to prevent update of NVIDIA drivers on : unsupported hardware
bumblebee.x86_64 : Bumblebee is a project that enables Linux to utilize the : Nvidia Optimus Hybrid cards
xorg-x11-drv-nouveau.x86_64 : Xorg X11 nouveau video driver for NVIDIA graphics : chipsets

Our final set includes:

yum install kmod-nvidia-340xx.x86_64 nvidia-x11-drv-340xx.x86_64 nvidia-detect.x86_64

Installation & glamor warning

The driver will now install. This can take a few minutes. Relax!

Installing

During the setup, you may also get a warning, informing you that one of the installed packages is incompatible with the kmod driver. You will need to resolve this conflict.

WARNING:
Disable glamoregl or uninstall xorg-x11-glamor
See: http://elrepo.org/tiki/kmod-nvidia (Known Issues) for more information

What this is about? Well glamor is a part of the ATI driver framework, so this definitely does not work with Nvidia, which is why you should remove the package after you finish installing the driver.

yum remove xorg-x11-glamor
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
–> Running transaction check
—> Package xorg-x11-glamor.x86_64 0:0.6.0-2.20140918git347ef4f.el7 will be erased
–> Processing Dependency: libglamor.so.0()(64bit) for package: xorg-x11-drv-ati-7.4.0-1.20140918git56c7fb8.el7.x86_64
–> Running transaction check
—> Package xorg-x11-drv-ati.x86_64 0:7.4.0-1.20140918git56c7fb8.el7 will be erased
–> Processing Dependency: xorg-x11-drv-ati for package: xorg-x11-drivers-7.7-6.el7.x86_64
–> Running transaction check
—> Package xorg-x11-drivers.x86_64 0:7.7-6.el7 will be erased
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
xorg-x11-glamor x86_64 0.6.0-2… @base/$releasever 258 k
Removing for dependencies:
xorg-x11-drivers x86_64 7.7-6… @base/$releasever 0.0
xorg-x11-drv-ati x86_64 7.4.0… @base/$releasever 444 k

Transaction Summary
================================================================================
Remove 1 Package (+2 Dependent packages)

Installed size: 702 k
Is this ok [y/N]:

Reboot and enjoy

And that’s it. Now, your CentOS 7 is even perfecter than before. Don’t forget my pimping guide, or the sequel, which guarantees you will be having all the fine bits and pieces like LibreOffice, VLC, Steam, Skype, Chrome, and other cool and useful software.

CentOS, ready

Conclusion

There you go, another fine topic mastered and slain. This one is really cool, because it allows you to have Nvidia drivers as a seamless part of your overall CentOS experience, without any manual tampering and tweaking. Indeed, if you look at my two guides for how to enhance the basic CentOS set into a perfect desktop, it comes down to several extra repositories, and very little manual work. Good stuff. Just like Ubuntu.

Well, this should come handy. You’ve learned how to work with additional repositories, search for drivers, and even fix a conflict with the default package set. Now, your CentOS karma should be complete. Or whole. However karma is measured. Take care.




FacebookTwitterDiggStumbleUponGoogle Plus



RSS Feed Powered by MaxBlogPress Bring My Blog Visitors Back

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.




FacebookTwitterDiggStumbleUponGoogle Plus



RSS Feed Powered by MaxBlogPress Bring My Blog Visitors Back

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.




FacebookTwitterDiggStumbleUponGoogle Plus



RSS Feed Powered by MaxBlogPress Bring My Blog Visitors Back

How to Setup Munin Monitoring System on CentOS 7

$
0
0

Hello Everybody! Welcome to our today’s article on one the most widely used, free of cost and Open Source Munin Network Resource Monitoring System. Its a perl software application can help you monitoring your each and every asset that keeps record of it and sends you the critical alerts of services for your servers, switches, applications, and any any other devices connected to your network whether its your computers, network, storage or the whole IT infrastructure. It shows all the information in graphs through a web interface that emphasis on plug and play capabilities.

Munin has a master/node architecture in which the master connects to all the nodes at regular intervals and asks them for data, then stores the data in RRD files to updates the graphs if needed. So, after completing its installation a high number of monitoring plugins will be playing with no more effort.

Prerequisites

Your systems hardware resources depends upon your own requirements while in this article we will be using the following system resource for Munin installation on CentOS 7.

Munin installation setup requires the basic web server packages to be installed on the server. So, after basic networking setup configure your hostname, IP address and firewall settings by keeping SELinux into permissive mode.

Then start installing packages by update your system first and enabling EPEL repository on it using below commands.

# yum install epel-release
# rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

# yum update

You will be asked to press “Y” key and hit Enter to proceed for installing all required updates. Once the updates are successfully installed on your system then proceed to the installation of Apache Web server.

Apache Web Setup

To setup your Apache web server, we need to start by installing its package using the below ‘yum’ command.

# yum install httpd

Upon completion of packages installation, start and enable its service and check that its active and enabled using the following commands respectively.

# systemctl enable httpd
# systemctl start httpd
# systemctl status httpd

Apache Status

Installing Munin

We can install Munin and Munin Node using the below ‘yum’ command through its available repository on CentOS 7 as shown.

# yum install munin munin-node

Hit “Y” plus Enter key to start installation of Munin and Munin Noe including a large number its required dependencies.

Once the installation is complete, start its service and enable it at auto start during reboot by using the following commands.

Munin Node Status

Munin Configurations

Now configure Munin by open its default configuration using any editor as used in below command.

# vim /etc/munin/munin.conf

# a simple host tree, change localhost with your FQDN.

[localhost]
address 127.0.0.1
use_node_name yes
:wq!

After saving the Munin configuration file, Open its apache virtual host configuration file to add access permissions to your network.

# vim /etc/httpd/conf.d/munin.conf

Munin Network

After saving the configuration file changes , restart apache web server service using command below.

# systemctl restart httpd

Now we are going to add a new user and password to the /etc/munin/munin-htpasswd file as the Munin statistics are protected with a username and password, so we need to setup the basic Apache Authentication.

# htpasswd -c /etc/munin/munin-htpasswd admin

This will add a new user with the name “admin” and asks for the new password as shown.

Apache Auth

# vi /etc/munin/munin-node.conf

host_name munin.linoxide.com

Save and close the file and restart munin-node services and access the following link by mentioning your FQDN or IP from the client which is in your network that was allowed in configuration file.

http://your_servers_IP/munin

Munin Web Access

Welcome to Munin Web Console

Here is the Munin dashboard, now you can check the graphs of your required servers.

Munin Dashboard

We can customize Munin dashboard by adding different available plugins and add multiple node to it. While using its web console we have options to create multiple groups and categories according to the required group of services.

You can check and see the status of your critical service by opening its graph from the Munin web console that will show you the current and past data from its maintained hostory as shown in below image.

Munin Load Graph

Conclusion

Munin installation has been setup. We hope you have enjoyed reading this article. The installation of Munin is quite simple, now simply add the client node and start monitoring your whole IT infrastructure using this awesome tool without paying any charges. Now enjoy using Munin on your environment and feel free to share your thoughts or suggestions in comments section.




FacebookTwitterDiggStumbleUponGoogle Plus



RSS Feed Powered by MaxBlogPress Bring My Blog Visitors Back

Install Habari on a CentOS 7 VPS

$
0
0

habariHabari is a free and open source publishing platform and application framework with a modular, object-oriented Core. In this guide we will install Habari on a CentOS 7 VPS with Apache, MariaDB and PHP. Its installation is pretty easy and straightforward.

To start the installation of Habari, log in to your server as user root:

ssh root@IP

and as usual, run the following command to make sure that all packages on your CentOS 7 VPS are up to date:

yum -y update

Now, we will install Apache web server:

yum install httpd

Once it is installed, start Apache and set it to start on system start up:

systemctl start httpd
systemctl enable httpd

Habari is PHP based application, so we will install PHP among with few PHP modules required by the application:

yum -y install php php-pdo php-common php-mbstring php-gd php-mysql

Habari requires already created empty database. It supports multiple database backends but in this tutorial we will install and use MariaDB. Run the following commands to install MariaDB on your server:

yum install mariadb mariadb-server

Start the MariaDB server and enable it to start on system start up:

systemctl start mariadb
systemctl enable mariadb

Run the mysql_secure_installation script to secure the database server and set your MariaDB root password.

Now, log in to the MariaDB server  using user ‘root’  and create new database and user for Habari:

mysql -u root -p

CREATE DATABASE habari;
CREATE USER 'habariuser'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON `habari`.* TO 'habariuser'@'localhost';
FLUSH PRIVILEGES;
exit

Don’t forget to replace ‘PASSWORD’ with an actual strong password.

Go to Habari’s official website and download the latest stable version of the application. At the moment of writing this article it is version 0.9.2.

wget http://habariproject.org/dist/habari-0.9.2.zip

Create a directory for Habari’s installation and unpack the zip arhive to the document root directory on your server:

mkdir -p /var/www/html/habari
yum -y install unzip
unzip habari-0.9.2.zip -d /var/www/html/habari/

Change the ownership of the ‘/var/www/html/habari/’ directory:

chown -R apache:apache /var/www/html/habari/

Create Apache virtual host for your website. First create ‘/etc/httpd/conf.d/vhosts.conf’ file with the following content:

vim /etc/httpd/conf.d/vhosts.conf

IncludeOptional vhosts.d/*.conf

and create the virtual host:

mkdir /etc/httpd/vhosts.d/
vim /etc/httpd/vhosts.d/yourdomain.com.conf

<VirtualHost YOUR_SERVER_IP:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/html/habari/"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined

<Directory "/var/www/html/habari/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

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

systemctl restart httpd<p/re>

Now, open your favorite web browser and point it to http://yourdomain.com to run the web installer. You will have to choose your database type and enter the necessary information to complete the installation.




FacebookTwitterDiggStumbleUponGoogle Plus



RSS Feed Powered by MaxBlogPress Bring My Blog Visitors Back

Introduction to IRC with XChat, Irssi and UnrealIRCD on CentOS 7.0

$
0
0

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

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

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

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!




FacebookTwitterDiggStumbleUponGoogle Plus



RSS Feed Powered by MaxBlogPress Bring My Blog Visitors Back

How to Configure Logrotate

$
0
0

It’s always important to keep your server logs around for as long as it makes business sense. You’ll need them for auditing system access, discovering abuses, or to identify root causes to problems, among other reasons. The challenge, though, is that depending on the service being provided and the amount of traffic received, your logs are capable of growing to gargantuan sizes, consuming every last bit of disk space available.

Logrotate allows us to better manage our logs to prevent from consuming too much disk space. Depending on the schedule you decide on, your logs can be rotated every day, week, or month. Each rotation renames your existing log file, usually by appending a ‘.’ and number to the end, and then creates a new file. To preserve storage the logs that have been rotated can be compressed using Gzip.

Thankfully, most major Linux distributions, like Ubuntu, automatically rotates most logs found under /var/log.

Installation

Logrotate is installed by default on most recent distributions.  As of this writing that means Ubuntu 15.10 and CentOS 7 – 1511. However, if you find that your installation does not include it, it can easily be installed through Yum or Apt.

Create a Log Rotate Configuration

Logrotate configuration files are stored under /etc/logrotate.d. When the logrotate cron job runs, it will look execute any configuration found in that directory.

The following example is that of a default Apache2 log from a CentOS 7 server. We can use it as a template for our own application logs, separate from the default ones.

/var/log/httpd/*log {
    missingok
    notifempty
    sharedscripts
    delaycompress
    postrotate
        /bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
    endscript
}

Here’s an explanation of the settings used above.

Logrotate supports many more options than what’s listed above. To see a complete list, you can man logrotate or visit linuxcommand.org logrotate page. Here are a few options you may find useful.

 

Test Your Configuration

As with anything, before you roll your configuration into production you will want to test it to ensure everything works. Logrotate includes a feature that allows us to run a configuration, in debug mode, without it doing any work. If there are errors discovered in the syntax or some other issues, you will be notified.

sudo logrotate -d /etc/logrotate.d/myapp.conf

The output will look similar to the example below. The output displays the discovered logs based on the location /var/httpd/*log, and what was done for each log. None of the logs were rotated since I ran the test on a server that was newly built. However, if the logs had more content and were aged a little more, we would see a message indicating our logs were rotated. For now, we can take this as our configuration file syntax is correct.

empty log files are not rotated, old logs are removed
considering log /var/log/httpd/access_log
  log does not need rotating
considering log /var/log/httpd/error_log
  log does not need rotating
not running postrotate script, since no logs were rotated



FacebookTwitterDiggStumbleUponGoogle Plus



RSS Feed Powered by MaxBlogPress Bring My Blog Visitors Back

How to install Confluence on CentOS 7

$
0
0

logo-confluenceConfluence is a wiki team collaboration software which is written in Java. It is a centralized place where you and your team members can work together on projects.

With Confluence you can add custom features via plugins, integrate Microsoft Office and SharePoint, easily edit and publish project related tasks and more.

In this article we will cover the steps needed for installing Confluence on a CentOS 7 VPS.

REQUIREMENTS

We will be using our CentOS 7 Linux VPS template for this tutorial. Before proceeding you should check the system requirements for Confluence.

The server on which you will install Confluence will need a working LAMP (Linux, Apache, MySQL & PHP) stack installed. So if you need to install LAMP you can do that by following our excellent article.  However, do not install MariaDB as shown in the tutorial since Confluence supports MySQL instead of MariaDB . We will cover the MySQL installation later in this article.

UPDATE THE SYSTEM

As always, make sure your server is fully up-to-date with the command below:

# yum update

Also, install a text editor of your choice. We will use nano as our text editor:

# yum install nano
INSTALL AND SETUP JAVA

Confluence requires JAVA in order to run. We are going to install Oracle’s JAVA JDK 8. Use the command below to download JDK 8:

# wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.rpm" -O /opt/jdk-8-linux-x64.rpm

Install JAVA:

# yum install /opt/jdk-8-linux-x64.rpm

Configure the JAVA package using the alternatives command:

# JDK_DIRS=($(ls -d /usr/java/jdk*))

# JDK_VER=${JDK_DIRS[@]:(-1)}

# alternatives --install /usr/bin/java java /usr/java/"${JDK_VER##*/}"/jre/bin/java 20000

# alternatives --install /usr/bin/jar jar /usr/java/"${JDK_VER##*/}"/bin/jar 20000

# alternatives --install /usr/bin/javac javac /usr/java/"${JDK_VER##*/}"/bin/javac 20000

# alternatives --install /usr/bin/javaws javaws /usr/java/"${JDK_VER##*/}"/jre/bin/javaws 20000

# alternatives --set java /usr/java/"${JDK_VER##*/}"/jre/bin/java

# alternatives --set javaws /usr/java/"${JDK_VER##*/}"/jre/bin/javaws

# alternatives --set javac /usr/java/"${JDK_VER##*/}"/bin/javac

You can check if JAVA has been properly setup on your server using:

# java -version
INSTALL MYSQL

You need to install MySQL from the community repository.

Download and install the repo:

# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

# sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm

Update the package index:

# yum update

Now install and start MySQL:

# yum install mysql-server mysql-client

# systemctl start mysqld

Enable MySQL to start on boot:

# systemctl enable mysqld

With the MySQL installation out of our way, we can now create a database for the Confluence installation. But first, run the mysql_secure_installation script to harden your MySQL server:

# mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- 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

Now, log into MySQL as root and create the database:

# mysql -u root -p

mysql> CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON confluence.* TO 'confluenceuser'@'localhost' IDENTIFIED BY 'your_password';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
INSTALL CONFLUENCE

You need to download the appropriate Confluence ‘Linux 64-bit/ 32-bit installer’ from their download page.
We are using a 64-bit CentOS 7 VPS, so we will use the 64-bit installer.

You can use the arch command to check whether you are running a 64 or 32 bit OS on your server. For example our CentOS 7 OS is 64-bit:

[root@linuxvps /]# arch
x86_64

Ok, now let’s get down to business. We are downloading the 64-bit installer:

# wget https://downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-5.9.1-x64.bin

Make the bin file executable:

# chmod a+x atlassian-confluence-5.9.1-x64.bin

Run the installer with ‘root‘ user privileges and the installation will create a dedicated Linux user account named ‘confluence‘ which will be used to run Confluence:

# ./atlassian-confluence-5.9.1-x64.bin

You will get the following output:

Unpacking JRE ...
Starting Installer ...
Dec 03, 2015 10:43:54 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.

This will install Confluence 5.9.1 on your computer.
OK [o, Enter], Cancel [c]

Press enter.

Choose the appropriate installation or upgrade option.
Please choose one of the following:
Express Install (uses default settings) [1],
Custom Install (recommended for advanced users) [2, Enter],
Upgrade an existing Confluence installation [3]

You can proceed with a custom install if you want, but we will enter 1 in our CLI for an Express install with the default settings:

See where Confluence will be installed and the settings that will be used.
Installation Directory: /opt/atlassian/confluence
Home Directory: /var/atlassian/application-data/confluence
HTTP Port: 8090
RMI Port: 8000
Install as service: Yes
Install [i, Enter], Exit [e]

Press Enter again to start the Confluence installation which will give you the below output:

Extracting files ...

Please wait a few moments while Confluence starts up.
Launching Confluence ...
Installation of Confluence 5.9.1 is complete
Your installation of Confluence 5.9.1 is now ready and can be accessed via
your browser.
Confluence 5.9.1 can be accessed at http://localhost:8090
Finishing installation ...

As you can see, Confluence is listening on port 8090. You can change this and the URI path in the server.xml file. And indeed, we need to change the URL from which we will access Confluence. Therefore, enter the conf directory:

# cd /opt/atlassian/confluence/conf

However, you need to shutdown Confluence first and then edit the server.xml file.

# sh /opt/atlassian/confluence/bin/shutdown.sh

# nano server.xml

Now, find the ‘localhost’ value and replace it with your server IP address.

Save and exit the file. Next step is to configure a MySQL datasource connection for Confluence. In order to do that, you need to install the MySQL JDBC driver. Below is the procedure to do that. Execute the below commands:

# cd /opt
# wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.35.tar.gz
# tar -zxvf mysql-connector-java-5.1.35.tar.gz
# cd /opt/mysql-connector-java-5.1.35
# mv mysql-connector-java-5.1.35-bin.jar /opt/atlassian/confluence/confluence/WEB-INF/lib/

With these commands you are downloading the JDBC driver in the /opt directory, extracting it and then move the unpacked jar file in the appropriate Confluence directory (/opt/atlassian/confluence/confluence/WEB-INF/lib/).

Next, edit the server.xml file again:

# nano /opt/atlassian/confluence/conf/server.xml

Find the following lines:

<Context path="" docBase="../confluence" debug="0" reloadable="true">
   <!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->

Insert the underneath lines within the Context element (between the ‘<Context path=”” docBase=”” ‘ and ‘<!– Logger is deprecated in Tomcat 5.5.” ‘ line):

<Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource"
          username="confluenceuser"
          password="your_password"
          driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/confluence?useUnicode=true&amp;characterEncoding=utf8"
          maxActive="15"
          maxIdle="7"
          defaultTransactionIsolation="READ_COMMITTED"
          validationQuery="Select 1" />

Of course replace your_password with the password you configured during the creation of the confluence database. Save and close the file. Now edit the web.xml file located in the WEB-INF directory:

# nano /opt/atlassian/confluence/confluence/WEB-INF/web.xml

Insert the following components just before </web-app> near the end of the file:

<resource-ref>
    <description>Connection Pool</description>
    <res-ref-name>jdbc/confluence</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
   <res-auth>Container</res-auth>
</resource-ref>

Save and close the web.xml file.

After all these changes you’ve made to the configuration files, you can now start Confluence. Issue this command:

# sh /opt/atlassian/confluence/bin/start-confluence.sh

For troubleshooting use the Confluence log file (/opt/atlassian/confluence/logs/catalina.out).

You can now finish the Confluence installation at: http://your_server_IP:8090 . You will be welcomed by the installation page as shown in the picture below:

confluence

 

Click on Production Installation (you can choose a Trial Installation of course, since the Product install requires you to have an active Confluence license), choose if you want to have an addon and enter your license key in the following screen.

Then, set up the database. Choose MySQL and Direct JDBC Connection. Enter the corresponding settings:

Driver Class Name: com.mysql.jdbc.Driver

Database URL: jdbc:mysql://localhost:3306/confluence?useUnicode=true&characterEncoding=utf8

Username: confluenceuser

Password: your_password

Then click on Next and finish the Confluence configuration.

Congratulations, if you followed our steps carefully you now have a fully working Confluence installation on your CentOS 7 VPS. For more information about Confluence, visit their official documentation.




FacebookTwitterDiggStumbleUponGoogle Plus



RSS Feed Powered by MaxBlogPress Bring My Blog Visitors Back

How to Install Tine 2.0 on CentOS 7

$
0
0

tine 2.0 vpsIn this tutorial we will show you how to install Tine 2.0 on a CentOS 7 VPS with Apache, PHP and MariaDB.
Tine 2.0 is an open source groupware and customer relationship management (CRM) application. Listed below are some of the main Tine 2.0 features:

  • Address book
  • Calendar
  • CRM
  • File manager
  • Human resources
  • Inventory
  • Synchronisation with mobile devices
  • Task management
  • Time tracker
  • VoIP integration
  • Web based mail client etc.

In order to install Tine 2.0 on your server, you need to make sure it meets the following requirements:

  • PHP 5.3 or later with the following PHP extensions enabled: ctype, date, dom, gd, hash, iconv, json, mcrypt, mysql, pdo_mysql, SimpleXML, SPL, xml and zip;
  • Apache Web Server 2.0 or later compiled with mod_rewrite module;
  • MySQL 5.0 or later or MariaDB installed on your virtual server.

Make sure that all OS packages are up to date by executing the following command:

yum -y update

Install the required packages:

yum install mariadb mariadb-server httpd php php-common php-gd php-ldap php-mcrypt php-mbstring php-xml unzip

Start the Apache web server and MariaDB database server and enable them to start on boot:

systemctl start httpd
systemctl start mariadb

systemctl enable httpd
systemctl enable mariadb

Download the latest stable version of Tine at http://www.tine20.org/download/ to the ‘/opt’ directory on the server. Then, extract it and move the Tine files and directories to the ‘/var/www/html/tine’ directory. At the time of writing this tutorial, the latest stable version of Tine is 2.0.

cd /opt/
wget http://packages.tine20.org/source/2015.07.6/tine20-allinone_2015.07.6.zip
mkdir -p /var/www/html/tine
unzip -d /var/www/html/tine tine20*.zip

Create a new MariaDB database and user for the Tine 2.0 application:

mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE tinedb DEFAULT CHARACTER SET 'UTF8';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON tinedb.* TO 'tine'@'localhost' IDENTIFIED BY 'y0ur_passw0rd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> quit

Create a new Apache configuration file (e.g. /etc/httpd/conf.d/your-domain.com.conf):

vi /etc/httpd/conf.d/your-domain.com.conf

Add the following virtual host directives to it:

<VirtualHost YOUR_SERVER_IP:80>
ServerAdmin webmaster@your-domain.com
DocumentRoot "/var/www/html/tine"
ServerName your-domain.com
ServerAlias www.your-domain.com
ErrorLog "/var/log/httpd/your-domain.com-error_log"
CustomLog "/var/log/httpd/your-domain.com-access_log" combined
<Directory "/var/www/html/tine/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Restart the Apache service for the changes to take effect:

systemctl restart httpd

Copy the sample Tine configuration file:

cp /var/www/html/tine/config.inc.php.dist /var/www/html/tine/config.inc.php

Then, edit the newly created ‘config.inc.php’ configuration file. Add the database information and specify login credentials for the setup user. For example:

vi /var/www/html/tine/config.inc.php
<?php
return array(
 'captcha' => array('count'=>0),
 'database' => array(
 'host' => 'localhost',
 'dbname' => 'tinedb',
 'username' => 'tine',
 'password' => 'y0ur_passw0rd',
 'adapter' => 'pdo_mysql',
 'tableprefix' => 'tine20_',
 ),
 'setupuser' => array(
 'username' => 'setupuser',
 'password' => 'Ax6hd35RbM'
 ),

);

Do not forget to change the password for the setup user.

The web server user (Apache) needs to be able to write to certain files and directories, so you can easily accomplish that by executing the following command:

chown apache:apache -R /var/www/html/tine

You may also create an empty ‘config.inc.php’ configuration file, make it writeable to the web server and modify it later via the setup interface:

touch /var/www/html/tine/config.inc.php
chown apache:apache -R /var/www/html/tine/config.inc.php
chmod 644 /var/www/html/tine/config.inc.php

Open http://your-domain.com/setup.php in your favorite web browser to run the Tine installer and log in using the user login credentials defined in the Tine configuration file. Then, follow the installer’s instructions:

Accept the license and privacy agreements, click on ‘Setup Checks’ from the left-hand menu and if all PHP requirements are met, click on ‘Config Manager’ and set /tmp as a temporary file path.

Click on ‘Authentication/Accounts’ and set the admin login credentials, configure password settings and click on ‘Save config and install’ button.

Select ‘Application manager’ and install additional Tine modules, such as calendar, CRM, file manager, FeLaMiMail web-based IMAP email client, tasks etc. If you install FeLaMiMail, do not forget to configure IMAP and SMTP settings via ‘Email menu’.

That is it. The Tine installation is now complete. Log out as setup user and log in to the administrator back-end using the newly created administrator account. Here you can manage users, groups, specify privileges based on groups, manage installed Tine modules etc.




FacebookTwitterDiggStumbleUponGoogle Plus



RSS Feed Powered by MaxBlogPress Bring My Blog Visitors Back

How to Install Wine 1.8 on Ubuntu 15.x / Centos 7

$
0
0

Wine (Wine Is Not an Emulator)) is a free and open source compatibility layer software application for the implementation of Windows based applications to run on Linux. Different applications have their own dependencies to run on any operating system. Windows programs won’t run on Linux and Linux programs won’t run on the Windows applications because both are the different operating operating systems developed in their own languages. So, in order to run Windows based applications on UNIX like operating system we need an intermediate application called WINE to be installed on Linux. Using WINE whenever a Windows based program tries to perform a function that Linux doesn’t normally understand, it will translate that program’s instruction into one supported by the system.

There are multiple features of using WINE like on the thin clients by simply installing Wine on a Linux server and access from any X Windows terminal by make existing Windows applications available on the Web by using VNC and its Java client.

1) Prerequisites

To install the latest version of Wine 1.8 on your Ubuntu 15 and CentOS 7 operating system, you need to complete the basic OS requirements before moving to the installation setup.

First of all open the command line terminal from the the drop down ‘Applications’ from your Ubuntu 15 or CentOS 7 desktop menu and run the commands below using root privileges to update your operating system with base system and security update.

On Ubuntu:

#apt-get update

On CentOS:

#yum install update

2) Download Wine 1.8 Source

You can download latest package 1.8 version of Wine to download.

Download wine 1.8

You can directly download it on your system using the ‘wget’ command by copying the source link address by using the command below that would be same for both Ubuntu and CentOS systems.

# wget http://dl.winehq.org/wine/source/1.8/wine-1.8.tar.bz2

Wget Wine

3) Extract the Archive

Change your directory to the extracted folder of Wine and then configure the source package by running the below command.

# tar -xvjf wine-1.8.tar.bz2

4) Compiling Wine 1.8

You need to enable 32 bit architecture in your 64 bit operating system for installing 32 Bit supporting packages. So, run the below commands as per your requirements.

For 32 Bit:

# ./configure

For 64 Bit:

# ./configure –enable-win64

You might get few warnings about some missing libraries that you can install on your Desktop system upon requirements and then proceed to with the compilation process by using the below command in your system.

# make

compile wine 1.8

The compilation process would take some time to complete its compilation process. Once the compilation completes the finally run this command to install Wine on your Ubuntu or CentOS 7 system.

# make install

make install

5) Installing Wine 1.8 Through PPA

You have the option to install the latest version of Wine 1.8 from the Official PPA of Ubuntu by using the following below commands on Ubuntu 15.

Enable 32 Bit Architecture

To enable 32 Bit software architecture system run the below command.

#dpkg –add-architecture i386

After adding teh Wine PPA repository Update your system packages by using the below commands.

#apt-get update

# add-apt-repository ppa:wine/wine-builds

More info: https://launchpad.net/~wine/+archive/ubuntu/wine-builds
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmp2c2c3jtl/secring.gpg’ created
gpg: keyring `/tmp/tmp2c2c3jtl/pubring.gpg’ created
gpg: requesting key 77C899CB from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp2c2c3jtl/trustdb.gpg: trustdb created
gpg: key 77C899CB: public key “Launchpad PPA for Wine” imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK

# apt-get install –install-recommends winehq-devel

You will be prompted to accept or reject by choose from the available options whether to proceed with installation or not.

6) Using Wine 1.8

You can check the version of your currently installed Wine 1.8 by executing the below command and see its version as shown in the image.

For 32 Bit and 64 bit installation of Wine you can execute the following commands respectively on your installation

# wine –version

# wine64 –version

Wine Version check

To get help about using the Wine you can run the following command.

root@ubuntu:~/wine-1.8# wine64 –help
Usage: wine PROGRAM [ARGUMENTS…] Run the specified program
wine –help Display this help and exit
wine –version Output version information and exit

To run any windows based application on your Ubuntu and CentOS 7 Desktop run the below command.

root@ubuntu:~/wine-1.8# wine64 vlc-2.2.1-win64.exe

root@ubuntu:~# wine putty.exe

You can run the windows based applications by doing a right click and openning it with “Wine Windows Program Loader” as shown in the image.

Using Wine 1.8

7) Configure Wine

You can configure your Wine application by opening its configuration panel by running the below command in the terminal and then configure is different settings like adding new applications and Drivers as shown.

Wine Conf

Conclusion

That’s it, we are successful in installing the latest version on Wine 1.8 on Ubuntu 15 and CentOS 7 by following the simple steps mentioned in this post. Now you can easily run your window’s based software applications on your Linux system and enjoy with your best X window operating System on Linux. You will get every thing in your Linux System that you want from your Windows system. Let’s enjoy using Wine on Linux and feel free to leave your comment for your valuable suggestions and comments, Cheers.




FacebookTwitterDiggStumbleUponGoogle Plus



RSS Feed Powered by MaxBlogPress Bring My Blog Visitors Back
Viewing all 4268 articles
Browse latest View live