centos | LinuxHostSupport Linux Tutorials and Guides Tue, 29 Jun 2021 06:35:57 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 How to Install XWiki on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-xwiki-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-xwiki-on-centos-7/#respond Thu, 24 Dec 2020 10:22:02 +0000 https://linuxhostsupport.com/blog/?p=1322 In this tutorial, we are going to show you how to XWiki on CentOS 7. XWiki is a free and open-source advanced wiki software platform written in Java. It runs on servlet containers like JBoss, Tomcat, etc. which uses a database such as MySQL or PostgreSQL to store its information. We will use a VPS […]

The post How to Install XWiki on CentOS 7 appeared first on LinuxHostSupport.

]]>
instaling xwiki on centos 7In this tutorial, we are going to show you how to XWiki on CentOS 7. XWiki is a free and open-source advanced wiki software platform written in Java. It runs on servlet containers like JBoss, Tomcat, etc. which uses a database such as MySQL or PostgreSQL to store its information.

We will use a VPS with CentOS 7 but you should be able to install XWiki following this tutorial on all Red hat based Linux distributions. Installing XWiki on CentOS 7 is a fairly easy task and it shouldn’t take more than 20 minutes to finish it.

XWiki comes with tons of useful features such as the following:

  • BLog
  • Page editing
  • Content organization
  • Forums
  • Create your own applications
  • File Manager
  • Tasks
  • Different translations of the documents
  • Meetings
  • Version control
  • Content imports
    and much more…

Log in to your CentOS 7 server

Log in to your VPS via SSH as a sudo user:

ssh userame@IP_Address

Once you are logged in, issue the following commands to make sure all installed packages are up to date:

sudo yum update

Install Java

XWiki is a Java-based application so the first step is to install Java on your server. Use the following command to install OpenJDK 8 JRE using yum:

sudo yum install java-1.8.0-openjdk

Verify the installation by running:

java -version

The command above should print something like the following:

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

2. Download Tomcat 8

XWiki works with any Servlet Container such as Tomcat, GlassFish, JBoss, and Jetty. In this guide, we will use Tomcat.

Create a system user that will run the Tomcat service:

sudo groupadd tomcat
sudo useradd  -g tomcat -d /opt/tomcat tomcat

Before downloading Tomcat source files change to the tomcat user:

su - tomcat

Download the latest stable version of Apache Tomcat 8 from the official tomcat downloads page:

wget http://www-us.apache.org/dist/tomcat/tomcat-8/v8.0.53/bin/apache-tomcat-8.0.53.zip

When the download is completed unzip the archive by running the following command:

unzip apache-tomcat-8.0.53.zip

Move the apache-tomcat-8.0.53 directory to tomcat:

mv apache-tomcat-8.0.53 tomcat

Set the correct permissions to the startup scripts:

chmod +x tomcat/bin/*.sh

Once completed switch back to the sudo user:

exit

Create SystemD unit file

To create a SystemD unit file for Apache Tomcat 8 open your text editor and create the following file:

sudo nano /etc/systemd/system/tomcat.service

Copy and paste the following code:

[Unit]
Description=Apache Tomcat 8 Service
After=syslog.target network.target

[Service]
Type=forking

User=tomcat
Group=tomcat

Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat/tomcat
Environment=CATALINA_BASE=/opt/tomcat/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -XX:MaxPermSize=192m -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/tomcat/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID

[Install]
WantedBy=multi-user.target

Save and close the file.

Rn the following commands to reload units and to start the Apache Tomcat service:

sudo systemctl daemon-reload
sudo systemctl start tomcat

Enable the Apache Tomcat service to start on boot:

sudo systemctl enable tomcat

Create MySQL database

XWiki works with a lot of relational databases such as MySQL, PostgreSQL, Oracle, and Derby. In this guide, we will use MySQL.

If you don’t have MySQL or MariaDB installed on your server install it with the following command:

sudo yum install mariadb-server

Once installed set the storage engine to InnoDB. Open the MariaDB configuration file with”

sudo nano /etc/my.cnf.d/server.cnf

and add default-storage-engine = innodb in the [mysqld] section:

[mysqld]
default-storage-engine = innodb

Start and enable the MariaDB service:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Login to the MySQL server with:

mysql -u root

Create a new database and user for XWiki:

create database xwiki default character set utf8 collate utf8_bin;
grant all privileges on xwiki.* to xwiki@localhost identified by 'xwiki_password';

Download and Configure XWiki

Switch to the tomcat user:

su - tomcat

Download the latest stable version of XWiki from its official downloads page:

wget http://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/platform/xwiki-platform-distribution-war/10.8/xwiki-platform-distribution-war-10.8.war

Once the download is completed, move the war file to the Tomcat webapps directory as XWiki.war

 mv xwiki-platform-distribution-war-10.8.war tomcat/webapps/xwiki.war

Switch back to the sudo user and restart the Tomcat service:

sudo systemctl restart tomcat

After the Tomcat service is restarted move to the XWiki’s WEB-INF/lib directory and download the MySQL JDBC Driver JAR:

su - tomcat
cd /opt/tomcat/tomcat/webapps/xwiki/WEB-INF/lib/
wget http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.9/mysql-connector-java-5.1.9.jar

Open the WEB-INF/hibernate.cfg.xml file and configure XWiki to use MySQL:

nano /opt/tomcat/tomcat/webapps/xwiki/WEB-INF/hibernate.cfg.xml

Comment out the default hsqldb database section and uncomment and edit the MySQL database section as shown below:

<!-- Configuration for the default database.
Comment out this section and uncomment other sections below if you want to use another database.
Note that the database tables will be created automatically if they don't already exist.

If you want the main wiki database to be different than "xwiki" (or the default schema for schema based engines)
you will also have to set the property xwiki.db in xwiki.cfg file
-->
<!--
<property name="connection.url">jdbc:hsqldb:file:${environment.permanentDirectory}/database/xwiki_db;shutdown=true</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
<property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>

<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>

<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="activitystream.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>
-->
<!-- MySQL configuration.
Uncomment if you want to use MySQL and comment out other database configurations.
Notes:
- if you want the main wiki database to be different than "xwiki"
you will also have to set the property xwiki.db in xwiki.cfg file
-->

<property name="connection.url">jdbc:mysql://localhost/xwiki?useSSL=false</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">xwiki_password</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<property name="dbcp.poolPreparedStatements">true</property>
<property name="dbcp.maxOpenPreparedStatements">20</property>

<property name="hibernate.connection.charSet">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.characterEncoding">utf8</property>

<mapping resource="xwiki.hbm.xml"/>
<mapping resource="feeds.hbm.xml"/>
<mapping resource="activitystream.hbm.xml"/>
<mapping resource="instance.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>
<mapping resource="mailsender.hbm.xml"/>

Switch back to the sudo user and restart the Tomcat service:
sudo systemctl restart tomcat

Access XWiki

XWiki runs on port 8080. To access your XWiki installation open your web browser and type: http://yourdomain_or_ip_address:8080/xwiki

You will be asked to create a new admin user for your XWiki and select a flavor. After the browser installation is completed, you can log in as your admin user and access your XWiki admin page.

For more information about XWiki, you can visit their official website.

 

install xwiki on centos 7If you use one of our Managed Server Support services,  you can simply ask our expert Linux admins to install XWiki on CentOS 7 for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on how to install XWiki on CentOS 7,  please share it with your friends on the social networks using the buttons below or simply leave a comment in the Comments Section below. Thanks.

The post How to Install XWiki on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-xwiki-on-centos-7/feed/ 0
How to Install Let’s Encrypt on CentOS 7 with Nginx https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-on-centos-7-with-nginx/ https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-on-centos-7-with-nginx/#comments Wed, 30 Sep 2020 18:53:05 +0000 https://linuxhostsupport.com/blog/?p=1282 In this tutorial, we will set up a Let’s Encrypt SSL certificate on a CentOS 7 server with Nginx as the web server. After completing the instructions described in this article, you should be able to access your site using HTTPS. Using SSL (short for Secure Socket Layer) is vital to keeping your site’s visitors […]

The post How to Install Let’s Encrypt on CentOS 7 with Nginx appeared first on LinuxHostSupport.

]]>
In this tutorial, we will set up a Let’s Encrypt SSL certificate on a CentOS 7 server with Nginx as the web server. After completing the instructions described in this article, you should be able to access your site using HTTPS.

Using SSL (short for Secure Socket Layer) is vital to keeping your site’s visitors safe as well as improving your webpage’s ranking on search engines. Without SSL, the data and information sent between your web server and your site’s visitors can be seen by third parties that are transmitting that data. With SSL, this data is encrypted, and only you and your visitors can see the information, keeping both sides safer.

Let’s Encrypt lets you set up an SSL certificate on your server for free. Their goal was to make SSL a commodity and give everyone the ability to have a safe and secure website. Let’s Encrypt makes the process of installing/renewing certificates easy for most users. This is very useful for making your website secure without needing the technical knowledge that is usually expected. Google and other search engines further encourage securing your website by giving websites that use SSL a higher ranking than websites without SSL.

In this guide, we will use the Certbot tool from EFF (https://certbot.eff.org).

Prerequisites

As a requirement, we need to install the Extra Packages for Enterprise Linux (EPEL) package. You will need a server or VPS running CentOS 7, and a user that has sudo privileges, or access to the root user itself. Assume the following commands described here are performed by the root user. Let’s install the EPEL package:

$ yum install epel-release

Then update the packages in the system to add the new package lists to the package manager:

$ yum update

1. Install and Start Nginx

If you haven’t done so already, install Nginx and start it:

$ yum install nginx

$ service nginx start

You can also set up Nginx to start automatically after the server boots up by running this command:

$ systemctl enable nginx

Now that our Nginx server is running, we can install Certbot.

2. Install Certbot

Now, we will install certbot by running this command:

$ yum install certbot-nginx

The next command will install a Let’s Encrypt SSL certificate using the Nginx plugin. This will automatically modify your Nginx configuration by adding the relevant lines containing the paths to the certificate and private key created by Certbot, before finally reloading Nginx.

$ certbot --nginx

Simply follow the guide that Certbot provides, enter your email, and your server should now have SSL set up!

3. Automating Renewal

A Let’s Encrypt-issued SSL certificate is valid for 90 days. However, we can automate the process of renewing the certificate by adding a cronjob that periodically checks the expiry status of the certificate and renews the certificate if needed.

In the command line, open your crontab file:

$ crontab -e

This will open a text editor where you can add the following:

0 2 * * * /usr/bin/certbot renew --quiet

This line says to run the certbot command at 2:00 am, every day. The –quiet option tells certbot not to produce any output. Save and exit from the editor.

Firewall settings (optional)

CentOS 7 comes with the default firewall program called firewalld. You may choose to completely disable this to guarantee that no connections will be stopped from/to your server. However, if you wish to use it on your system, you need to configure firewalld to allow HTTPS access to your server.

The following command configures firewalld to allow both HTTP and HTTPS connections.

$ firewall-cmd --permanent --add-service=http --add-service=https

Reload the the firewall in order for the changes to take effect:

$ firewall-cmd --reload

That’s all there is to it – you now have your firewall running while still allowing for HTTP and HTTPS requests to come through.

Congratulations! You have successfully set up Let’s Encrypt SSL using Certbot with Nginx support.


While Let’s Encrypt does make their certificate installation pretty straightforward, that’s not all that needs to be done on a website. Our fully managed CentOS support services provide you with complete and comprehensive support and maintenance for your server, including any requests you have for software installation and configuration. We do everything you could ever need for your server’s health and performance.

If this tutorial helped you set up Let’s Encrypt on your CentOS 7 server or VPS, please consider leaving a comment letting us know how it helped, or you can share this post on social media by using our share shortcuts. Thanks.

The post How to Install Let’s Encrypt on CentOS 7 with Nginx appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-on-centos-7-with-nginx/feed/ 2
How to Install and Configure TaskBoard on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-and-configure-taskboard-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-and-configure-taskboard-on-centos-7/#respond Thu, 18 Jun 2020 20:02:29 +0000 https://linuxhostsupport.com/blog/?p=1181 A need for “a simple, visual way to keep track of what needs to get done” is the main reason why the open-source TaskBoard has been developed. With a minimalistic design approach by the developer and contributors, TaskBoard aims to replicate the basics of commonly used Kanban apps like Trello and LeanKit all within a […]

The post How to Install and Configure TaskBoard on CentOS 7 appeared first on LinuxHostSupport.

]]>
A need for “a simple, visual way to keep track of what needs to get done” is the main reason why the open-source TaskBoard has been developed. With a minimalistic design approach by the developer and contributors, TaskBoard aims to replicate the basics of commonly used Kanban apps like Trello and LeanKit all within a very small and light footprint.

Some of TaskBoard’s main key features are the following:

  • Email notifications
  • Unlimited and customizable boards with items
  • Full history logging
  • Robust privilege system
  • Supports file attachments

TaskBoard is licensed under the MIT License and can be self-hosted on a Linux-based server. For this tutorial, we recommend using a public-facing server with a freshly installed CentOS 7 Linux distribution, along with a registered domain name.

If you follow this guide on how to install and configure TaskBoard on CentOS 7 correctly, the install process won’t take more than 10-15 minutes. Let’s get started!

Requirements

The following are the packages and dependencies required by TaskBoard:

  • Apache Web Server
  • PHP 7.2 and extensions
  • SQLite
  • OpenJDK (optional)

Step 1: Installing Updates and Dependencies

Connect to your publicly available server via SSH using the following commands in your preferred terminal program:

ssh [username]@[server_ip_address]

Replace [username] with the account name of a root-enabled user (or the root user itself), and replace [server_ip_address] with your server’s public IP address.

Before proceeding with the installation, it is best to update the packages to their recent stable versions, if there are any:

yum update -y

We also recommend installing EPEL and the basic dependencies of CentOS 7 to avoid missing out on important packages required during installation (these are useful for other projects, too!):

yum install epel-release -y
yum groupinstall -y "Development Tools"

Step 2: Installing the Apache Web Server

Apache is the official web server supported by TaskBoard as it is reliable, robust, and a battle-tested web server. To proceed with the installation, supply the following command:

yum install httpd -y

Once it shows that the installation is complete, enable the Apache service (httpd) to start at boot, and then start the service.

systemctl enable httpd
systemctl start httpd

Verify the status of the Apache service by:

systemctl status httpd

You should see that the service is “active (running)”:

● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2019-07-22 19:59:59 CDT; 3s ago

Step 3: Installing PHP

The TaskBoard back-end is developed using the PHP programming language. According to its developers and contributors, TaskBoard still has support for the lower-end PHP versions (5.5+), although it is recommended to use the latest stable version for bug fixes and performance improvements. Because of this, we’ll be installing PHP 7.2, a modern and reliable version of PHP.

To proceed with the installation, use the following commands:

yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php72
yum update -y
yum install php php-json php-cli php-gd php-sqlite3 libapache2-mod-php -y

These commands will enable the Remi-Release repo first to activate PHP 7.2 repositories then initiate an update. Once updated, we can now install the PHP core package, some extensions, and libapache2-mod, the PHP module for the Apache 2 web server.

Verify if PHP has been successfully installed:

php -v

You should see that the output contains PHP 7.2.x:
PHP 7.2.20 (cli) (built: Jul 2 2019 13:37:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Step 4: Installing a SQLite Database Server

To  achieve the goal of a small footprint application, TaskBoard makes use of SQLite as the platform for its database, which allows all records to be stored in just a single file on the server.

To install, simply enter the command:

yum -y install sqlite

Step 5: Installing TaskBoard

After setting up the software prerequisites, we can now proceed with the download of the TaskBoard files.

First, download and unzip the latest archive file from official TaskBoard Github repository. At the time of this article being written, the latest version of TaskBoard is v.0.3.1. Run these commands to change the directory to the Apache web directory, download the master .zip file, and unzip its contents.

cd /var/www/
wget https://github.com/kiswa/TaskBoard/archive/master.zip
unzip /var/www/master.zip

After unzipping the archive file, it will produce a directory named ‘TaskBoard-master’, which we can rename to something simpler:

mv TaskBoard-master/ taskboard/

Next, it is best to update the PHP Composer which is included in the directory:

cd taskboard/
./build/composer.phar self-update

Once updated, we can now proceed with the initial installation by running this command inside the directory:

./build/composer.phar install

Installation should not take that long. If no issues are encountered, we can now apply the correct permissions to our TaskBoard files.

chown -R apache:apache /var/www/taskboard

Step 6: Setting Up a Virtual Host for TaskBoard

In order for our TaskBoard application to be accessible with a publicly available domain name, we must set up an Apache virtual host. Make sure that the domain points to your server IP address and has propagated already.

To proceed, create the following virtual host file using:

nano /etc/httpd/conf.d/taskboard.conf

Next is to copy and paste the following syntax. Do not forget to modify taskboard.domain.com with your own domain or subdomain:

<VirtualHost *:80> 
ServerName taskboard.domain.com 
DocumentRoot /var/www/taskboard 

<Directory "/var/www/taskboard"> 
Options -Indexes +FollowSymLinks +MultiViews 
AllowOverride All 
Require all granted 
</Directory>

ErrorLog /var/log/httpd/taskboard.domain.com-error.log 
CustomLog /var/log/httpd/taskboard.domain.com-access.log combined 
</VirtualHost>

Save and exit the file. Finally, restart the Apache service for the changes to take effect:

systemctl restart httpd

Step 7: Accessing TaskBoard

Once the virtual host has been set up and the Apache service has been restarted, you can now access your website at http://taskboard.domain.com

At first, you will see a log in screen which looks like this:

 

By default, the username and password are both admin.

Once logged in, you should see the pretty basic and straightforward dashboard of TaskBoard:

 

Also, do not forget to change your Admin account password after logging in.

That’s it! – you now have a working TaskBoard application on your CentOS 7 powered server.


Of course, you don’t have to Install and Configure TaskBoard on CentOS 7 if you are a Managed VPS Support subscriber. In that case, you can simply ask our support team to install and configure TaskBoard on CentOS 7 for you. They are available 24/7, and they will be able to help you with the installation, along with almost anything else that you would ever need for your VPS.

PS. If you enjoyed reading this blog post on how to install and configure TaskBoard on CentOS 7, feel free to share it on social networks by using the shortcuts below, or simply leave a comment in the comments section. Thanks.

The post How to Install and Configure TaskBoard on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-and-configure-taskboard-on-centos-7/feed/ 0
How to Install Cockpit on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-cockpit-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-cockpit-on-centos-7/#respond Wed, 10 Jun 2020 21:20:59 +0000 https://linuxhostsupport.com/blog/?p=1170 In this article, we will show you how to install Cockpit CMS on a CentOS 7 VPS and help install Apache & PHP on it as well. Cockpit is a free, open source and self-hosted content management system (CMS) application written in PHP. It is a simple content platform used by web developers to create […]

The post How to Install Cockpit on CentOS 7 appeared first on LinuxHostSupport.

]]>
In this article, we will show you how to install Cockpit CMS on a CentOS 7 VPS and help install Apache & PHP on it as well.

Cockpit is a free, open source and self-hosted content management system (CMS) application written in PHP. It is a simple content platform used by web developers to create and manage any structured content. Cockpit stores the data in an SQLite database, so you don’t need to install or configure a database server such as MySQL / MariaDB. All of this combined makes for a pleasant CMS experience that allows you to share your ideas and content with the world without needing almost any technical knowledge whatsoever.

Let’s get started with the installation.

Prerequisites

  • A CentOS 7 VPS with root access enabled (or access to a user account with sudo privileges).
  • Apache web server 2.0 or higher compiled with the mod_rewrite Apache module. Alternatively, we can use Nginx as a web server with PHP support.
  • PHP 7.1 or higher (PHP 7.2 is preferred) with the following PHP extensions enabled: PDO, GD graphics library, Zip and mbstring.

Step 1: Connect via SSH and Update the OS Packages

Log in to the server using SSH as root user (or a user with sudo privileges). You can do that by entering this command:

ssh root@IP_Address -p Port_Number

Remember to replace ‘root’ with your username if you are not using the root user. Also, replace IP_ADDRESS and PORT_NUMBER with your server’s respective IP address and SSH port number (the default is 22).

Once you are logged in, you should update all of your OS packages to their latest available versions.

yum clean all
yum update

Step 2: Install Apache and PHP 7.2

Apache is available within CentOS’s default software repositories, so simply run the following command to install Apache web server:

yum install httpd -y

After installing Apache, start the Apache server and enable it to start at boot time:

systemctl start httpd
systemctl enable httpd

CentOS 7 comes with PHP version 5.4. This is a problem because Cockpit CMS requires PHP version 7.1 or higher. For the purposes of this tutorial, we will install PHP version 7.2 using the Webtatic repository. To enable the Webtatic repository, run the following command:

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Then, run the following command to install PHP 7.2 and all necessary PHP extensions:

yum install php72w php72w-cli php72w-mbstring php72w-pdo php72w-sqlite php72w-gd php72w-zip

After installing PHP 7.2, you can check the PHP version installed on the server with the following command:

php -v

The output should be similar to the one below:

PHP 7.2.19 (cli) (built: Jun 2 2019 09:49:05) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Now we can download and install Cockpit.

Step 3: Download Cockpit CMS

Download and extract the latest version of Cockpit in the default web server document root directory (/var/www/html):

cd /var/www/html
wget https://github.com/agentejo/cockpit/archive/master.zip
unzip master.zip
mv cockpit-master cockpit

Then, run the following commands to set the correct permissions for Cockpit CMS (Apache needs to have ownership of the files in order for it to use them correctly):

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

Step 4: Configure the Apache Web Server

In this part of the tutorial, we will show you how to configure Apache to serve your Cockpit CMS web pages.

Create a new Apache configuration file named cockpit.conf in the /etc/httpd/conf.d/ directory on your server:

nano /etc/httpd/conf.d/cockpit.conf

(We’re using ‘nano’ to edit our text, however you can use your preferred text editor instead).

Add the following lines:

<VirtualHost *:80>
    ServerAdmin admin@your_domain.com
    DocumentRoot /var/www/html/cockpit
    ServerName your_domain.com
    ServerAlias www.your_domain.com
    <Directory /var/www/html/cockpit>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    ErrorLog /var/log/httpd/your_domain.com-error_log
    CustomLog /var/log/httpd/your_domain.com-access_log common
</VirtualHost>

Of course, don’t forget to replace your_domain.com with your actual domain name.

Save and close the file, then restart the Apache service for the changes to take effect:

systemctl restart httpd

Step 5: Install Cockpit CMS

Now, you can open your preferred web browser and access http://your_domain.com/install . You should see the Cockpit CMS setup page. Simply follow the onscreen instructions and complete the Cockpit CMS installation.

After that, click on the LOGIN NOW button and provide the default administrator username and password: admin / admin. Once logged in, you should change the default administrator user account password immediately.

 

That’s it. You have successfully installed Cockpit CMS on your CentOS 7 VPS. For more information about how to manage your Cockpit installation, please refer to the official Cockpit documentation.


Of course, you don’t have to Install Cockpit on CentOS 7, if you use one of our Managed VPS Support services, in which case you can simply ask our expert Linux admins to Install Cockpit on CentOS 7 for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to Install Cockpit on CentOS 7, please share it with your friends on the social networks using the share buttons, or simply leave a reply below. Thanks.

The post How to Install Cockpit on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-cockpit-on-centos-7/feed/ 0
How to Install Apache Kafka on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-centos-7/#comments Wed, 29 Apr 2020 19:16:12 +0000 https://linuxhostsupport.com/blog/?p=1139 In this tutorial, we will show you how to install Apache Kafka on CentOS 7. Apache Kafka is an open source messaging system and distributed streaming platform. It’s designed to be scalable, responsive, and provide an excellent experience when dealing with real-time data feeds. It’s great at providing real time analytics and processing of data – […]

The post How to Install Apache Kafka on CentOS 7 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to install Apache Kafka on CentOS 7.

Apache Kafka is an open source messaging system and distributed streaming platform. It’s designed to be scalable, responsive, and provide an excellent experience when dealing with real-time data feeds. It’s great at providing real time analytics and processing of data – and thanks to its rich API support, developers can easily implement Apache Kafka and mold it to their exact needs.

Let’s begin with the installation.

Prerequisites:

Apache Kafka has the following requirements:

  • Java 8 or higher installed on the server
  • ZooKeeper installed and running on the server
  • A server/VPS with a minimum of 4GB RAM.

Step 1. Connect to the Server

Log in to the server via SSH as user root using the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number.

Step 2: Update OS Packages

Once logged in, make sure that your server OS packages are up-to-date by running the following commands:

yum clean all
yum update

Step 3: Install JAVA

Apache Kafka requires Java, so in order to run it on your server, we need to install Java first. We can check if Java is already installed on the server using this command:

which java

If there is no output, it means that Java is not installed on the server yet. We can install Java from a RPM package:

yum install java-1.8.0-openjdk.x86_64

We can check the Java version installed on the server by running the following command:

java -version

The output should be similar to this:

openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

Add the “JAVA_HOME” and “JRE_HOME” environment variables at the end of /etc/bashrc file:

sudo vi /etc/bashrc

Append the following lines to the original content of the file:

export JRE_HOME=/usr/lib/jvm/jre
export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk
PATH=$PATH:$JRE_HOME:$JAVA_HOME

Open the ~/.bashrc file and make sure that the following lines exist:

if [ -f /etc/bashrc ] ; then
  . /etc/bashrc
fi

Run the following command to activate the path settings immediately:

source /etc/bashrc

Step 4: Install Apache Kafka

Create a new system user dedicated for the Kafka service using the following command:

useradd kafka -m

Set a password for the newly created user:

passwd kafka

Use a strong password and enter it twice. Then, run the following command on the server:

sudo usermod -aG wheel kafka

Log in as the newly created user with:

su kafka

Download the latest version of Apache Kafka available at https://kafka.apache.org/downloads and extract it in the home directory of the kafka user account:

cd ~
wget http://apache.osuosl.org/kafka/2.1.0/kafka_2.12-2.1.0.tgz
tar -xvzf kafka_2.12-2.1.0.tgz
mv kafka_2.12-2.1.0/* .
rmdir /home/kafka/kafka_2.12-2.1.0

Apache Kafka uses ZooKeeper to store persistent cluster metadata, so we need to install ZooKeeper. The ZooKeeper files are included with Apache Kafka. ZooKeeper is running on port 2181 and it doesn’t require much maintenance. The ZooKeeper service is responsible for configuration management, leader detection, synchronization, etc.
Create a ZooKeeper systemd unit file so that we can run ZooKeeper as a service:

sudo vi /lib/systemd/system/zookeeper.service
[Unit]
Requires=network.target remote-fs.target
After=network.target remote-fs.target

[Service]
Type=simple
User=kafka
ExecStart=/home/kafka/bin/zookeeper-server-start.sh /home/kafka/config/zookeeper.properties
ExecStop=/home/kafka/bin/zookeeper-server-stop.sh
Restart=on-abnormal

[Install]
WantedBy=multi-user.target

Create a systemd unit file for Apache Kafka:

sudo vi /etc/systemd/system/kafka.service

Add the following lines:

[Unit]
Requires=network.target remote-fs.target zookeeper.service
After=network.target remote-fs.target zookeeper.service

[Service]
Type=simple
User=kafka
ExecStart=/home/kafka/bin/kafka-server-start.sh /home/kafka/config/server.properties
ExecStop=/home/kafka/bin/kafka-server-stop.sh
Restart=on-abnormal

[Install]
WantedBy=multi-user.target

Edit the server.properties file and add/modify the following settings:

vi /home/kafka/config/server.properties
listeners=PLAINTEXT://:9092
log.dirs=/var/log/kafka-logs

After we make changes to a unit file, we should run the ‘systemctl daemon-reload‘ command for the changes to take effect:

systemctl daemon-reload

Create a new directory ‘kafka-logs’ in the ‘/var/log/‘ directory on your server:

sudo mkdir -p /var/log/kafka-logs
chown kafka:kafka -R /var/log/kafka-logs

This can be useful for troubleshooting. Once that’s done, start the ZooKeeper and Apache Kafka services:

sudo systemctl start zookeeper.service
sudo systemctl start kafka.service

Enable the ZooKeeper and Apache Kafka services to automatically start on server boot:

systemctl enable zookeeper.service
systemctl enable kafka.service

In order to check if ZooKeeper and Kafka services are up and running, run the following commands on the VPS:

systemctl status zookeeper.service

We should receive an output similar to this:

zookeeper.service
   Loaded: loaded (/usr/lib/systemd/system/zookeeper.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-01-25 12:42:42 CST; 16s ago
 Main PID: 11682 (java)
   CGroup: /system.slice/zookeeper.service
           └─11682 java -Xmx512M -Xms512M -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.h...
systemctl status kafka.service

The output of this command should be similar to this one:

kafka.service
   Loaded: loaded (/etc/systemd/system/kafka.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-01-25 12:42:50 CST; 42s ago
 Main PID: 11991 (java)
   CGroup: /system.slice/kafka.service
           └─11991 java -Xmx1G -Xms1G -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.headl...

We can also use the netstat command to check if Kafka and ZooKeeper services are listening on ports 9092 and 2181 respectively:

sudo netstat -tunlp | grep -e \:9092 -e \:2181
tcp6       0      0 :::9092                 :::*                    LISTEN      11991/java
tcp6       0      0 :::2181                 :::*                    LISTEN      11682/java

That is it. We successfully installed Apache Kafka.


Of course, you don’t have to install and configure Apache Kafka on CentOS 7, if you use one of our Fully Managed CentOS Support solutions, in which case you can simply ask our expert Linux admins to setup and configure Apache Kafka on CentOS 7 for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to install Apache Kafka on a CentOS 7 VPS, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

The post How to Install Apache Kafka on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-apache-kafka-on-centos-7/feed/ 4
How to Install Jupyter on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-jupyter-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-jupyter-on-centos-7/#comments Thu, 23 Apr 2020 15:27:13 +0000 https://linuxhostsupport.com/blog/?p=1117 In this tutorial, we will go over the steps necessary to install Jupyter Notebook on a CentOS server. Jupyter Notebook is a popular and widely used open-source web-based software that allows users to create and share documents that contain live code, equations, visualizations, and narrative text. Jupyter Notebook can be used for data cleaning and […]

The post How to Install Jupyter on CentOS 7 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will go over the steps necessary to install Jupyter Notebook on a CentOS server.

Jupyter Notebook is a popular and widely used open-source web-based software that allows users to create and share documents that contain live code, equations, visualizations, and narrative text.

Jupyter Notebook can be used for data cleaning and transformation, numerical simulations, statistical modeling, data visualization, machine learning, and much more. It has support for over 40 programming languages, including Python, Scala, R, and Julia. Let’s get started with the installation.

Prerequisites

  • CentOS 7 VPS with 2 GB of memory
  • SSH access with root privileges

Step 1. Log in via SSH and Update the System

Login to your CentOS 7 VPS via SSH as a non-root sudo user:

ssh account@IP_Address -p Port_number

Replace “IP_Address” and “Port_number” with your server’s IP and port number. Also, replace “account” with the account you intend to log in with.

Make sure that all installed packages on the server are updated to the latest available version by running the following command:

sudo yum update

Install the bzip2 package with:

sudo yum install bzip2

Step 2. Install Jupyter Notebook using Anaconda

It is recommended to install Python and Jupyter using the Anaconda Distribution, which includes Python, the Jupyter Notebook, and other machine learning and data science related packages.

At the time of writing this article, the latest version of Anaconda was 5.3.0. Before downloading the installation script, you should check the Anaconda Download page for a new version.

Use the following comamnd to download the latest Anaconda installation script:

wget https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.sh

Once the download is complete, start the Anaconda installation by running the script:

bash Anaconda3-5.3.0-Linux-x86_64.sh
Welcome to Anaconda3 5.3.0

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>

The script will ask you to accept the license. Press ENTER to continue, and then press ENTER to scroll through the license.

Do you accept the license terms? [yes|no]
[no] >>>
Please answer 'yes' or 'no':'

Type ‘yes’ and hit ENTER – you will then be prompted to accept the default Anaconda installation path:

Anaconda3 will now be installed into this location:
/home/rh/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

Press ENTER to confirm, after which the Anaconda installation will begin.

Once the installation is completed, the installer will ask you if you want to prepend the Anaconda install location to the PATH in your ~/.bashrc file.

Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/rh/.bashrc ? [yes|no]

Type ‘yes’ and hit ENTER. This output will follow:

Appending source /home/rh/anaconda3/bin/activate to /home/rh/.bashrc
A backup will be made to: /home/rh/.bashrc-anaconda3.bak


For this change to become active, you have to open a new terminal.

Thank you for installing Anaconda3!

===========================================================================

Anaconda is partnered with Microsoft! Microsoft VSCode is a streamlined
code editor with support for development operations like debugging, task
running and version control.

To install Visual Studio Code, you will need:
  - Administrator Privileges
  - Internet connectivity

Visual Studio Code License: https://code.visualstudio.com/license

Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]

Once the Anaconda installation is completed, the installer will ask you if you want to install Microsoft VSCode. Type ‘no’ and press ENTER. The installer will then quit.

To activate your Anaconda installation, run:

source ~/.bashrc

Verify the Anaconda installation by running the following command:

conda --version
conda 4.5.11

Step 3. Start Jupyter Notebook

Now that you have Anaconda and Jupyter Notebook installed on your CentOS 7 server, you can start the Notebook using the following command:

jupyter notebook

You will see an output similar to the following:

[I 03:24:08.155 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 03:24:08.826 NotebookApp] JupyterLab extension loaded from /home/rh/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 03:24:08.826 NotebookApp] JupyterLab application directory is /home/rh/anaconda3/share/jupyter/lab
[I 03:24:08.837 NotebookApp] Serving notebooks from local directory: /home/rh
[I 03:24:08.839 NotebookApp] The Jupyter Notebook is running at:
[I 03:24:08.839 NotebookApp] http://localhost:8888/?token=5e025ea9fc174fbaaacfb71511152f130cfec017da50d431
[I 03:24:08.839 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 03:24:08.840 NotebookApp] No web browser found: could not locate runnable browser.
[C 03:24:08.840 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=5e025ea9fc174fbaaacfb71511152f130cfec017da50d431

The Jupyter Notebook server by default is listening on localhost port 8888. If this port is not available, you can specify another port using the “–port” flag. If you want to listen on all interfaces use “–ip=’*'”

Jupyter Notebook provides help messages for all available command line arguments. If you need help with using Jupyter, run the following command:

jupyter notebook --help

Open your favorite web browser and navigate to the URL shown above. Once the application is opened, the Notebook Dashboard will be displayed and it will show a list of the notebooks, files, and sub-directories in the directory where you executed the command and the notebook server was started

For detailed information on how to configure and use Jupyter Notebook, please check their documentation.


Of course, you don’t have to Install Jupyter Notetbook on CentOS 7, if you use one of our Fully Managed VPS Support services, in which case you can simply ask our expert Linux admins to install Jupyter Notebook for you, along with anything else that you might need. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on How to Install Jupyter on a CentOS 7, please share it with your friends on the social networks using the share shortcuts, or simply leave a reply in the comments section. Thanks.

The post How to Install Jupyter on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-jupyter-on-centos-7/feed/ 1
How to Set Up and Use Yum Repositories on CentOS 7 https://linuxhostsupport.com/blog/how-to-set-up-and-use-yum-repositories-on-centos-7/ https://linuxhostsupport.com/blog/how-to-set-up-and-use-yum-repositories-on-centos-7/#comments Thu, 19 Mar 2020 22:40:36 +0000 https://linuxhostsupport.com/blog/?p=1085 This tutorial explains how to set up and use Yum repositories on a CentOS 7 VPS. The official CentOS 7 repository has a huge list of packages and it covers almost all bases in terms of software for servers, but sometimes we need some additional packages which are not available in the official repositories. In […]

The post How to Set Up and Use Yum Repositories on CentOS 7 appeared first on LinuxHostSupport.

]]>
This tutorial explains how to set up and use Yum repositories on a CentOS 7 VPS.

The official CentOS 7 repository has a huge list of packages and it covers almost all bases in terms of software for servers, but sometimes we need some additional packages which are not available in the official repositories. In that case, we can simply add new repositories to further expand the catalogue of packages available to us. Let’s begin with the tutorial.

Step 1. Login via SSH

Log in to your CentOS 7 VPS via SSH as the root user, or as an account with sudo privileges:

ssh root@IP_Address -p Port_number

Make sure to replace “IP_Address” and “Port_number” with your server’s IP address and SSH port.

Step 2. Update the OS Packages and Install the yum-utils Package:

Once you are logged in to the server, run the following commands to make sure that all installed packages are up to date:

yum clean all
yum update

Install the yum-utils package using the following command:

yum install yum-utils

We can enable the EPEL (Extra Packages for Enterprise Linux) repository on CentOS 7 / RHEL 7, maintained by a special Fedora Special Interest Group that creates, maintains, and manages high quality additional packages for enterprise Linux versions. This includes Red Hat Enterprise Linux (RHEL), CentOS, Scientific Linux (SL), and Oracle Enterprise Linux (OEL).

Step 3. Install the EPEL repository

To install the EPEL rpm, do so with the following command:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

The output will appear as shown below:

Retrieving https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:epel-release-7-11                ################################# [100%]

Check the newly installed repository. You should be able to find the EPEL repository in the list.

yum repolist

You should receive the following output, or something similar to it:

base                                                                                                            | 3.6 kB  00:00:00
epel/x86_64/metalink                                                                                            |  11 kB  00:00:00
epel                                                                                                            | 3.2 kB  00:00:00
extras                                                                                                          | 3.4 kB  00:00:00
updates                                                                                                         | 3.4 kB  00:00:00
(1/7): base/7/x86_64/group_gz                                                                                   | 166 kB  00:00:00
(2/7): base/7/x86_64/primary_db                                                                                 | 5.9 MB  00:00:00
(3/7): epel/x86_64/group_gz                                                                                     |  88 kB  00:00:00
(4/7): epel/x86_64/updateinfo                                                                                   | 934 kB  00:00:00
(5/7): updates/7/x86_64/primary_db                                                                              | 6.0 MB  00:00:00
(6/7): extras/7/x86_64/primary_db                                                                               | 204 kB  00:00:00
(7/7): epel/x86_64/primary                                                                                      | 3.6 MB  00:00:00
epel                                                                                                                       12739/12739
repo id                                         repo name                                                                      status
base/7/x86_64                                   CentOS-7 - Base                                                                9,901+10
epel/x86_64                                     Extra Packages for Enterprise Linux 7 - x86_64                                   12,739
extras/7/x86_64                                 CentOS-7 - Extras                                                                   432
updates/7/x86_64                                CentOS-7 - Updates                                                             1,543+71
repolist: 24,615

In order to see all of the packages available in the EPEL repository, run the following command:

yum --enablerepo=epel list | less

The output of this command will show you the list of packages.

Note: Other CentOS repositories that can be useful are located in /etc/yum.repos.d directory. When enabling some repository manually by editing the .repo file, make sure that the main version for CentOS is used in the repo file, in this case, it is CentOS 7.

For example, edit the CentOS-Base.repo file and add/modify these lines:

[base]
name=CentOS $releasever – Base
baseurl=http://mirror.centos.org/centos/7/os/$basearch/
gpgcheck=0
enabled=1

[updates]
name=CentOS $releasever – Updates
baseurl=http://mirror.centos.org/centos/7/updates/$basearch/
gpgcheck=0
enabled=1

[extras]
name=CentOS $releasever – Extras
baseurl=http://mirror.centos.org/centos/7/extras/$basearch/
gpgcheck=0
enabled=1

Listing all repositories

To list all repositories, including all enabled and disabled repositories, run:

yum repolist all

Enabling a Yum Repository

To enable a Yum repository, run the following command as root:

yum-config-manager --enable repository <repository name>

Disabling a Yum Repository

To disable a Yum repository, run the following command as root:

yum-config-manager --disable repository <repository name>

Do not forget to replace <repository name> with the actual repo name.

If for some reason we cannot find the software package we need in the official and EPEL repositories, we can extend the capabilities of the server with even more software by adding additional repositories, like the Remi RPM repository, which is not an official repository of CentOS distribution but is well maintained and always up to date.

Remi Collet maintains a large collection of RPM packages, including the latest versions of PHP, etc. Please note that this repo does not always play nicely with other third party CentOS repos, so check the list of repositories using yum repolist and disable additional repositories if there are any package conflicts.

We can install the Remi repository using this next command:

rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

If for example we want to enable PHP 7.2 , we can edit the /etc/yum.repos.d/remi-php72.repo file and change enabled=0 to enabled=1 :

# This repository only provides PHP 7.2 and its extensions
# NOTICE: common dependencies are in "remi-safe"

[remi-php72]
name=Remi's PHP 7.2 RPM repository for Enterprise Linux 7 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/php72/$basearch/
#mirrorlist=https://rpms.remirepo.net/enterprise/7/php72/httpsmirror
mirrorlist=http://cdn.remirepo.net/enterprise/7/php72/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Another good unofficial CentOS repository is the Webtatic Repo. This repository provides updated packages with later versions of PHP, MySQL, and other packages. With this information, you can now install any repository of your choosing and expand the functionality of your server in any way that you need to.


Of course, you don’t have to setup and configure additional repositories on CentOS 7, if you use our Fully Managed VPS Support solutions, in which case you can simply ask our expert Linux admins to configure additional repositories on CentOS 7 for you, along with anything else that you might need. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to set up and use Yum repositories on a CentOS VPS, please share it with your friends on the social networks using the sharing shortcut, or simply leave a reply below. Thanks.

The post How to Set Up and Use Yum Repositories on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-set-up-and-use-yum-repositories-on-centos-7/feed/ 3
How to Run Java Files on CentOS with the JRE https://linuxhostsupport.com/blog/how-to-run-java-files-on-centos-with-the-jre/ https://linuxhostsupport.com/blog/how-to-run-java-files-on-centos-with-the-jre/#comments Wed, 06 Feb 2019 21:31:06 +0000 https://linuxhostsupport.com/blog/?p=757 There is a large amount of useful software for Linux packaged away in jar files, the main reason and benefit being that it allows for platform independence. For example, if you find a java utility that can minify, compress, and concatenate static files like JS and CSS for your website, you can download and use […]

The post How to Run Java Files on CentOS with the JRE appeared first on LinuxHostSupport.

]]>
There is a large amount of useful software for Linux packaged away in jar files, the main reason and benefit being that it allows for platform independence. For example, if you find a java utility that can minify, compress, and concatenate static files like JS and CSS for your website, you can download and use it on your own web server, regardless of the operating system.

But, you can’t run these jar files by default on any given Linux installation. A special interpreter needs to interpret the “bytecode” that they contain, and that is what the Java Runtime Environment (JRE) provides. Most Linux packages can be installed by using either the default repositories or by using the extended ones. (In the case of CentOS, these are the “EPEL” repositories.)

However, Java isn’t one of them. You need to download it from Oracle’s website and consent to a license agreement. In fact, this can be a bit of a problem as shown below.

In this tutorial, we will show you how to install the Java SE JRE on Linux so that we can run these files.

Getting the RPM Packages

If you open your server CLI and type “java”, nothing happens:

To get this command along with its features, navigate to the JRE download page and select the “JRE” download. This will bring you to a page with a list of packages. To find the one we want, we first need to get the architecture of your system – either 32-bit, or 64-bit. Type the following command:

arch

And you should get an output similar to this:

If like on the above system your output is “x86_64”, then you have a 64-bit system. If on the other hand your output is i386, then you have a 32-bit system. In today’s world, most systems are going to be 64-bit unless it’s an older machine.

Downloading the RPM Package

Unfortunately, you can’t just copy the link and download it to your system with wget. If you try, something similar to this will happen when you attempt to execute the rpm file with “yum localinstall”.

You’ll get an error saying “Cannot open” and “Skipping”.

This is because you’ll get a license agreement instead of an RPM file. Oracle really wants to make sure that whoever downloads these files has agreed to their terms and conditions. In fact, the Java cookbook README.md specifies this:

Luckily, there are a couple of methods to agree to this agreement and download the files you need.

Method 1: Download with Browser

The most direct way is to accept the graphical license agreement, and click the appropriate download as shown here:

This will initiate the download onto your desktop via your web browser. It’s a large(ish) file – around 155 MB as of this article. Once it’s done, you will need to transfer the file onto your server either via FTP, or by placing it in a download location that your server can access and obtain with wget.

Method 2: Fooling the JRE Server with the Use of a Cookie

This “hacky” solution will download the file directly onto your server. But the way it’s done means that it might stop working in the future. This method worked at the time of the article being written.

First, get the name of the URL containing the RPM download. Then enter the following command:

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "[DownloadURL]"

Replace [DownloadURL] with the name of the URL on the page. This time, you should obtain the full download instead of only a few KB containing the license agreement.

Installing and Verifying the JRE Environment

Execute the rpm file using this command:

yum localinstall [DownloadedFile]

It should install normally like this:

Once the install is complete, check whether the “java” command is working as it should:

And that’s it! You’ve successfully installed the latest version of the Java JRE on Linux. You can now run all kinds of “jar” files without worrying about compatibility issues.


Of course, you don’t have to do any of this if you use one of our Outsourced server support services, in which case you can simply ask our expert Linux admins to install the JRE for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, please share it with your friends on the social networks using the buttons on the left, or simply leave a reply below. Thanks.

The post How to Run Java Files on CentOS with the JRE appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-run-java-files-on-centos-with-the-jre/feed/ 2
How to Install Seafile on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-seafile-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-seafile-on-centos-7/#respond Thu, 29 Nov 2018 18:56:39 +0000 https://linuxhostsupport.com/blog/?p=737 Seafile is an open source cloud storage system that allows users to easily store and synchronize files between multiple devices using the Seafile client. Using Seafile you can also create groups with file syncing, wikis, and start discussions with your team to enable easy collaboration. In this tutorial, we will guide you through the process […]

The post How to Install Seafile on CentOS 7 appeared first on LinuxHostSupport.

]]>
Seafile is an open source cloud storage system that allows users to easily store and synchronize files between multiple devices using the Seafile client. Using Seafile you can also create groups with file syncing, wikis, and start discussions with your team to enable easy collaboration. In this tutorial, we will guide you through the process of installing Seafile Server on a CentOS 7 VPS and all necessary dependencies.

Seafile offers a number of useful features. Some of them are listed above:
– Cross-Platform File Syncing
– Mobile File Access: iOS and Android apps
– Seafile Drive client
– File Versioning and Snapshot
– Easy File Sharing and Permission Control
– File locking support
– Online editing
– Backup and Data Recovery
and many more…

Prerequisites

– CentOS 7 VPS with full root access
– Python 2.7 with python-setuptools, python-imaging, python-ldap, python-mysqldb, python-urllib3, python-memcache and python-requests
– MySQL/MariaDB database server

Login and update the server

Login to your CentOS 7 VPS via SSH as user root

ssh root@IP_Address -p Port_number

and update all installed packages

yum -y update

Install MariaDB

Some of the Seafile components such as the ccnet server, seafile server and seahub require their own databases. So we will have to install a database server on our VPS. We will install the MariaDB server by executing the following command

yum install mariadb mariadb-server

Once MariaDB is installed, start the database server and enable it to automatically start upon server restart

systemctl start mariadb
systemctl enable mariadb

and execute the ‘mysql_secure_installation’ post-installation script to set a root password for the MySQL root user and additionally strengthen the security of the database server. You can can answer the questions as the following:

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

Next, login to the MariaDB server as user root and create the following databases and a database user with full privileges over the databases

create database `ccnet-db` character set = 'utf8';
create database `seafile-db` character set = 'utf8';
create database `seahub-db` character set = 'utf8';

create user 'seafile'@'localhost' identified by 'PASSWORD';

GRANT ALL PRIVILEGES ON `ccnet-db`.* to `seafile`@localhost;
GRANT ALL PRIVILEGES ON `seafile-db`.* to `seafile`@localhost;
GRANT ALL PRIVILEGES ON `seahub-db`.* to `seafile`@localhost;

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

Install dependencies

Before we start the installation of Seafile, we need to install several dependencies. Some of them are not available in the official CentOS 7 repositories, so we will have to install the EPEL repository

yum -y install epel-release
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro

Once the repository is enabled, run the following command to install the necessary dependencies

yum -y install python-imaging MySQL-python python-distribute python-memcached python-ldap python-urllib3 ffmpeg ffmpeg-devel python-requests
Download and install Seafile

Go to Seafile’s download page and download the installation script for CentOS 7. At the moment of writing this article the latest available version of the application is 6.2.5

wget https://download.seadrive.org/seafile-server_6.2.5_x86-64.tar.gz

Unpack the downloaded tarball

tar -xzvf seafile-server_6.2.5_x86-64.tar.gz

It contains several installation scripts. We will use the ‘setup-seafile-mysql.sh’ script to install and configure Seafile with the MariaDB database server. The script will check your CentOS 7 server and notify you if there is a missing dependency

cd seafile-server-6.2.5
./setup-seafile-mysql.sh

Press the Enter button to start the installation and you will be prompted to enter several details. You can use the following information

server name: servername
server ip/domain: Your_IP_Address
seafile data dir: /opt/seafile-data
fileserver port: 8082
database: use existing
MySQL user: seafile
password: PASSWORD
ccnet database: ccnet-db
seafile database: seafile-db
seahub database: seahub-db
database user: seafile

If the information is correct, press Enter again to continue. After the installation is completed you will get the following output

-----------------------------------------------------------------
Your seafile server configuration has been finished successfully.
-----------------------------------------------------------------

run seafile server:     ./seafile.sh { start | stop | restart }
run seahub  server:     ./seahub.sh  { start  | stop | restart  }

Finally, start the Seafile Server as suggested in the output above

./seafile.sh start

Output:

../common/session.c(132): using config file /opt/conf/ccnet.conf
Starting seafile server, please wait ...
Seafile server started

Done.

Next, start Seahub using the following command

./seahub.sh start

Since this is the first time you start the Seafile File server, you will have to create an administrative account

What is the email for the admin account?
[ admin email ] admin@yourdomain.com

What is the password for the admin account?
[ admin password ] STRONG_PASSWORD

Enter the password again:
[ admin password again ] STRONG_PASSWORD

----------------------------------------
Successfully created seafile admin
----------------------------------------

That’s all. At this point you should be able to access Seafile Server at http://Your_IP:8000

seafile

For more details on how to configure and use Seafile Server please check their official documentation.


Of course, you don’t have to do any of this if you use one of our Outsourced server support services, in which case you can simply ask our expert Linux admins to install Seafile for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

The post How to Install Seafile on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-seafile-on-centos-7/feed/ 0
How to Install Chamilo on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-chamilo-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-chamilo-on-centos-7/#respond Wed, 26 Sep 2018 12:40:22 +0000 https://linuxhostsupport.com/blog/?p=685 Chamilo is a free and open-source, PHP based learning management platform and content management system (CMS). Used by millions of students, organizations, governments, schools, and companies around the world, Chamilo is one of the most popular platforms of this type. In this tutorial, we will present you the steps for installing Chamilo on a CentOS […]

The post How to Install Chamilo on CentOS 7 appeared first on LinuxHostSupport.

]]>
Chamilo is a free and open-source, PHP based learning management platform and content management system (CMS). Used by millions of students, organizations, governments, schools, and companies around the world, Chamilo is one of the most popular platforms of this type. In this tutorial, we will present you the steps for installing Chamilo on a CentOS 7 VPS.

Chamilo comes with a lot of features such as:
– Courses management
– User management, authentication, and enrollment
– 20 pedagogical tools (document management, assignments, announcements, tests, forum, wiki, surveys, etc..)
– Social learning network
– Standards implementations (SCORM 1.2, AICC, IMS/QTI, HotPotatoes, iCal)
– Training sessions management
– Availability timeframe for tests/exams
– CSV/Excel data import/export
and many more…

Prerequisites

– SSH access with root privileges
– CentOS 7 VPS with at least 1GB of RAM
– Apache version 2.2 or newer
– MySQL/MariaDB database server version 5 or newer
– PHP version 5.4 or newer with the following PHP modules:  php-mysqlnd php-zlib php-pcre php-xml php-json php-mcrypt php-iconv php-gd php-intl php-session

In this tutorial we will install all necessary prerequisites, including Apache, PHP version 7 and MariaDB.

Step 1. Login via SSH and update the system

Login to your CentOS 7 VPS via SSH as user root

ssh root@IP_Address -p Port_Number

and run the following command to update all installed packages

yum -y update

Step 2. Install Apache

Apache web server is available in the official CentOS 7 repository and it can be easily installed with the yum package manager

yum -y install httpd

Once the installation is completed, start the web server and enable it to automatically start upon server reboot.

systemctl start httpd
systemctl enable httpd

Install PHP

CentOS 7 is shipped with PHP 5.4 by default. This PHP version has reached the end of life and it is no longer maintained. We will show you how to install PHP 7 instead, from the Webtatic EL yum repository. Add the repository with the following command

yum -y install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Once you add the repository you can proceed with the PHP installation including the extensions required by Chamilo

yum -y install php70w php70w-common php70w-mysqlnd php70w-zlib php70w-pcre php70w-xml php70w-json php70w-mcrypt php70w-iconv php70w-gd php70w-intl php70w-session php70w-cli

verify that PHP 7 is properly installed

php -v
PHP 7.0.31 (cli) (built: Jul 20 2018 08:55:22) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

Step 3. Install MariaDB

Chamilo requires an empty database, so we will have to install a database server. Install MariaDB database server by executing the following command

yum -y install mariadb

Start the server and enable it to start upon reboot

systemctl start mariadb
systemctl enable mariadb

Once the installation of the database server is finished, execute the mysql_secure_installation post-installation script, to set a password for the MySQL root user and implement some additional security recommendations.

Now, login to the MariaDB server and create a new database and user for the Chamilo installation

mysql -u root -p

MariaDB [(none)]> CREATE DATABASE chamilo;
MariaDB [(none)]> CREATE USER 'chamilo'@'localhost' IDENTIFIED BY 'PASSWORD';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON chamilo.* TO 'user'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES
MariaDB [(none)]> exit

Replace PASSWORD with an actual strong password.

Step 4. Download and install Chamilo

Download the latest stable version of Chamilo from their official website, built for PHP version 7.

wget https://github.com/chamilo/chamilo-lms/releases/download/v1.11.8/chamilo-1.11.8-php7.zip

unpack the downloaded archive to the document root directory of your server

unzip chamilo-1.11.8-php7.zip -d /var/www/html/

Rename the directory where all Chamilo files are placed

cd /var/www/html
mv chamilo-1.11.8 chamilo

change the ownership of the Chamilo files

chown -R apache:apache chamilo

Step 5. Create Apache virtual host

If you want to access Chamilo with your domain name, you will have to create Apache virtual host for the domain

vi /etc/httpd/conf.d/invoiceninja.conf

ServerAdmin admin@your-domain.com
DocumentRoot /var/www/html/chamilo
ServerName domain.com
ServerAlias www.domain.com

Options +FollowSymlinks
AllowOverride All

ErrorLog /var/log/httpd/domain.com-error_log
CustomLog /var/log/httpd/domain.com-access_log common

Save the file and restart the web server for the changes to take effect

systemctl restart httpd

If you closely followed the steps in this tutorial, you will be able to navigate your web browser to http://domain.com and follow the installation wizard to complete the Chamilo installation.

For more details on how to use and configure Chamilo, please check their official documentation.


installing chamilo on centos 7 Of course, if you are one of our Linux server management client, you don’t have to Install Chamilo on your CentOS 7 VPS, simply ask our admins, sit back and relax. Our admins will Install Chamilo on CentOS 7 for you immediately.

PS. If you liked this post about How to Install Chamilo on CentOS 7, please share it with your friends on the social networks using the buttons below or simply leave a comment in the comments section. Thanks.

The post How to Install Chamilo on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-chamilo-on-centos-7/feed/ 0
How to Install and Configure Redis on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-and-configure-redis-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-and-configure-redis-on-centos-7/#respond Wed, 08 Aug 2018 12:00:01 +0000 https://linuxhostsupport.com/blog/?p=633 In this tutorial we will show you How to Install and Configure Redis on CentOS 7. Redis is an open-source in-memory database project implementing a distributed, in-memory key-value store with optional durability. Some of Redis features are built-in transactions, replication, and support for a variety of data structures like strings, hashes, lists, sets and so on. […]

The post How to Install and Configure Redis on CentOS 7 appeared first on LinuxHostSupport.

]]>
In this tutorial we will show you How to Install and Configure Redis on CentOS 7. Redis is an open-source in-memory database project implementing a distributed, in-memory key-value store with optional durability. Some of Redis features are built-in transactions, replication, and support for a variety of data structures like strings, hashes, lists, sets and so on. Redis Sentinel makes Redis highly available and it supports automatic partitioning with Redis Cluster.

1. Installing Redis

There are few things that need to be done prior to Redis installing. First, we have to add Extra Packages for Enterprise Linux (EPEL) repository to the server`s package lists. EPEL is a package repository that contains several open-source-add-on software packages and a lot of them are maintained by the Fedora Project.

We can use yum to install EPEL:

sudo yum install epel-release

As soon as we finish installing EPEL, we can use yum once again to install Redis:

sudo yum install redis

After a few minutes  this installation will be completed and then you can start the Redis service:

sudo systemctl start redis.service

There is always the chance for Redis to start on boot, all you have to do is enable it through the enable command:

sudo systemctl enable redis

If you want to check Redis`s status you should run the following:

sudo systemctl status redis.service
Output
● redis.service - Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─limit.conf
Active: active (running) since Thu 2018-07-11 15:50:38 UTC; 7s ago
Main PID: 3962 (redis-server)
CGroup: /system.slice/redis.service
└─3962 /usr/bin/redis-server 127.0.0.1:6379

You can test the setup using this command as soon as you confirm that Redis is indeed running:

redis-cli ping

This should print PONG as the response and once you get that response it means that you have Redis running on your server and its configuration can begin in order to enhance its security.

2. Configuration

Redis listens on port 6379 by default and it needs some additional configuration in order to be sure that it is secured. If Redis is not protected by a firewall, authentication and have it listen only on a private network, then you have to be aware that there is a great risk of leaking sensitive data.

Firstly, you have to make sure that you set Redis to only listen on your private network. Because Redis has not got any kind of encryption built in, it is very important to transfer the data exclusively through private networks or secured tunnels. You can set Redis to listen on the private interface using the following:

nano /etc/redis.conf
...
bind redis_servers_private_IP
...

If you install Redis on a stand-alone web server and it does not need to accept connections from different clients, in that case, Redis can be set to listen on the local socket  instead by commenting out the bind value and setting up a socket by:

mkdir /var/run/redis
chown redis:redis /var/run/redis
nano /etc/redis.conf
...
# bind 127.0.0.1
unixsocket /var/run/redis/redis.sock
unixsocketperm 777

You can also use your OS`s built-in firewall in order to allow in connections from web servers you trust using their internal IP’s, in case you do not have a dedicated firewall. You can find some examples below:

# iptables
nano /etc/sysconfig/iptables
...
-A INPUT -p tcp -m tcp --dport 6379 -s your_server_IP -m comment --comment "redis" -j ACCEPT
service iptables restart

You need to set up authentication, a built-in security feature if you want further Redis protection. If you do this then the clients will be forced to authenticate before they are granted access. If you want to create a security password then you can use a tool such as apg or pwgen. Use the following to set a password within Redis:

nano /etc/redis.conf
...
requirepass your_strong_password_here
...

systemctl restart redis

To make sure that the password works you can do this test :

# This should fail
redis_cli
127.0.0.1:6379> set key1 10
(error) NOAUTH Authentication required.

# This should work
redis-cli
127.0.0.1:6379> auth your_strong_password_here
127.0.0.1:6379> set key1 10
OK
127.0.0.1:6379> get key1
"10"

Another thing we have to so is to secure the file permissions for Redis. You can find the password for Redis in he redis.conf so that file should not be readable by everybody. Furthermore, we also want to lock down the Redis data directory. You can lock down the permissions on Redis with:

chown redis:redis /var/lib/redis
chmod 700 /var/lib/redis
chown redis:redis /etc/redis.conf
chmod 600 /etc/redis.conf
systemctl restart redis

Installing Redis on CentOS 7Of course, you don’t have to install and configure Redis on CentOS 7, if you use one of our outsourced server support services, in which case you can simply ask our expert Linux admins to install and configure Redis on CentOS 7, for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on how to install and configure Redis on CentOS 7, please share it with your friends on the social networks using the buttons below or simply leave a comment in the comments section. Thanks.

The post How to Install and Configure Redis on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-and-configure-redis-on-centos-7/feed/ 0
How To Install GCC on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-gcc-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-gcc-on-centos-7/#comments Wed, 28 Mar 2018 10:44:13 +0000 https://linuxhostsupport.com/blog/?p=502 In this tutorial, we will take a look at how to install GCC on CentOS 7. GCC or GNU Compiler Collection is released by the Free Software Foundation and as the name suggests, it is a very useful collection of programming compilers such as C, C++, Objective-C, Objective-C++, Fortran, Java, Go and Ada. GCC is […]

The post How To Install GCC on CentOS 7 appeared first on LinuxHostSupport.

]]>
yum install gccIn this tutorial, we will take a look at how to install GCC on CentOS 7. GCC or GNU Compiler Collection is released by the Free Software Foundation and as the name suggests, it is a very useful collection of programming compilers such as C, C++, Objective-C, Objective-C++, Fortran, Java, Go and Ada. GCC is an official compiler of the GNU operating system but also it is a standard compiler on many Unix operating systems such as Linux. Installing GCC on CentOS 7, is really an easy task and it shouldn’t take more than 10 minutes.

1. Update the server

First of all log in to your CentOS 7 VPS via SSH as user root

ssh root@IP_Address -p Port_number

and make sure that all installed packages on the server are up to date

yum -y update

2. Install GCC from repository

GCC can be easily installed from the official CentOS repositories. Run the following command to install GCC on your server

yum -y install gcc

Once the installation is completed, you can the version of GCC installed on your server

gcc --version

gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

As might be seen from the output, the GCC version distributed by CentOS 7 is 4.8.5 which is not the latest version of GCC.

You may also want to install gcc-c++. It will automatically include the C++ library and compile files with extensions that indicate they are C source as C++, instead of as C.

yum -y install gcc-c++

3. Install GCC from source

If you need a newer version of GCC than the one distributed by the official CentOS 7 repositories you can install it from source.

It is highly recommended to start a screen session before starting the installation. Run the following command

screen -U -S gcc

Download the tarball of the GCC version you want to install. In our example we will use GCC version 7.3.0

wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-7.3.0/gcc-7.3.0.tar.gz

Unpack the tar archive and change the current working directory

tar zxf gcc-7.3.0.tar.gz
cd gcc-7.3.0

Install bzip2 and run the ‘download_prerequisites’ script to download some prerequisites needed by GCC. You have to run this from the top level of the GCC source tree.

yum -y install bzip2
./contrib/download_prerequisites

Once the prerequisites are downloaded execute the following command to start configuring the GCC build environment

./configure --disable-multilib --enable-languages=c,c++

Once it is completed, run the following command to compile the source code. It may take a few hours for the compilation to complete, so sit back and relax.

make -j 4
make install

4. Verify GCC installation on CentOS 7

After the compilation process is completed. You can check if GCC is properly installed.

gcc --version

gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

install gcc linuxOf course, you don’t have to install GCC on CentOS 7,  if you use one of our outsourced server support services, in which case you can simply ask our expert Linux admins to install GCC on your CentOS 7 server for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on how to install GCC on CentOS 7,  please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

The post How To Install GCC on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-gcc-on-centos-7/feed/ 59
Speed up VestaCP on CentOS 7 https://linuxhostsupport.com/blog/speed-up-vestacp-on-centos-7/ https://linuxhostsupport.com/blog/speed-up-vestacp-on-centos-7/#comments Wed, 15 Nov 2017 13:02:00 +0000 https://linuxhostsupport.com/blog/?p=271 We’ll show you, how to speed up VestaCP on CentOS 7. Vesta Control Panel is a simple and easy to use open source hosting control panel. It has a simple and clean interface and lots of useful features that will help you to host your websites on your VPS. Vesta Control Panel currently can be […]

The post Speed up VestaCP on CentOS 7 appeared first on LinuxHostSupport.

]]>
We’ll show you, how to speed up VestaCP on CentOS 7. Vesta Control Panel is a simple and easy to use open source hosting control panel. It has a simple and clean interface and lots of useful features that will help you to host your websites on your VPS. Vesta Control Panel currently can be installed on RHEL 5, RHEL 6, CentOS 5, CentOS 6, CentOS 7, Debian 7, Debian 8, Ubuntu 12.04, Ubuntu 12.10, Ubuntu 13.04, Ubuntu 13.10, Ubuntu 14.04 and Ubuntu 16.04 operating systems. Today we are going to learn how to speed up VestaCP on a CentOS 7 VPS.

1. Upgrade PHP

First make sure the system is up to date:

# yum update

Now let’s enable the remi-php70 repository so we can upgrade VestaCP to PHP 7:

# yum-config-manager --enable remi-php70

Update the system again, this command should upgrade all PHP packages to PHP 7:

# yum update

And then restart the php-fpm service:

# systemctl restart php-fpm

2. Install Opcache

Installing Opcache is pretty easy, just run the following command:

# yum install php-opcache

Restart the php-fpm service again:

# systemctl restart php-fpm

Restart Nginx as well:

# systemctl restart nginx

Now you should check if Opcache is enabled by running the following command:

php -i | grep opcache.enable

If Opcache is enabled you should see something like the following output:

opcache.enable => On => On

3. Upgrade MariaDB

First make a backup from all of your databases.

Instead of the conventional mysqldump utility you can use the VestaCP CLI to generate a backup for all of the users on your system, if you want to do that just run:

# v-backup-users

In case you need to restore the backup, first obtain the backup file name by typing in:

# v-list-user-backups <username>

And then by executing the following command you can restore all databases for a specific user:

# v-restore-user <username> <backup_name> no no no <username> no no no

Note: Replace <username> for the username you want to restore the databases for and <backup_name> for the name of the backup obtained by the v-list-user-backups command.

Now, let’s get to upgrading MariaDB finally, start by removing the old MariaDB version:

# yum remove mariadb mariadb-server

Add the repository for MariaDB 10 by creating the repo file with nano and then paste the text below:

# nano /etc/yum.repos.d/MariaDB.repo

# Used to install MariaDB 10 instead of default 5.5
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = https://yum.mariadb.org/10.2/centos7-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Now update the system again:

# yum update

And then install MariaDB 10:

# yum install mariadb mariadb-server

After the installation has finished, start MariaDB by running the following command:

# systemctl start mariadb

Then enable the MariaDB service on boot:

# systemctl enable mariadb.service

4. Install Redis

Redis is an in-memory data structure store primarily used as a database and cache.
You can get a huge speed benefit from configuring Redis to cache your pages or to cache your database rows.

You can install Redis by typing in the following command:

# yum install redis

After the yum package manager has finished installing Redis, type in the following command to start Redis:

# systemctl start redis

Now enable the Redis service to start on boot:

# systemctl enable redis.service

5. Configuring WordPress

If you use WordPress for your sites then it would be quite beneficial to install Redis as a caching system for WordPress.
We are going to need the Phpredis extension in order to configure WordPress to use Redis, first install this package:

# yum install php-devel

Then install the Phpredis extension using this command:

# pecl install redis

Press enter when the following message comes up:

enable igbinary serializer support? [no]

After PECL has finished installing Phpredis, open the php.ini file and add the following line at the bottom:

# nano /etc/php.ini

extension=redis.so

Restart php-fpm in order to make the changes effective:

# systemctl restart php-fpm

Now log in to your WordPress backend and install the plugin W3 Total Cache and activate it.In the plugin settings for W3 Total Cache select Redis as page cache and database cache then check the Enable checkbox for both options and click on the Save all settings button.When finished restart Nginx:

# systemctl restart nginx

Then turn on the Redis monitor by typing in the following command:

redis-cli monitor

Now using your browser navigate to your WordPress page, if Redis is working you should see output similar to this:

1510462482.538685 [0 127.0.0.1:48166] "GET" "w3tc_linuxhostsupport.com_0_dbcache_0eacdb46b225fbe864f35d73500d5b5f"
1510462482.539190 [0 127.0.0.1:48166] "SETEX" "w3tc_linuxhostsupport.com_0_dbcache_0eacdb46b225fbe864f35d73500d5b5f" "180" "a:7:{s:10:\"last_error\";s:0:\"\";s:10:\"last_query\";s:205:\"SELECT  wp_comments.comment_ID FROM wp_comments  WHERE ( comment_approved = '1' ) AND comment_post_ID = 1 AND comment_parent IN ( 1 )  ORDER BY wp_comments.comment_date_gmt ASC, wp_comments.comment_ID ASC \";s:11:\"last_result\";a:0:{}s:8:\"col_info\";a:1:{i:0;O:8:\"stdClass\":13:{s:4:\"name\";s:10:\"comment_ID\";s:7:\"orgname\";s:10:\"comment_ID\";s:5:\"table\";s:11:\"wp_comments\";s:8:\"orgtable\";s:11:\"wp_comments\";s:3:\"def\";s:0:\"\";s:2:\"db\";s:14:\"admin_admin_wp\";s:7:\"catalog\";s:3:\"def\";s:10:\"max_length\";i:0;s:6:\"length\";i:20;s:9:\"charsetnr\";i:63;s:5:\"flags\";i:49699;s:4:\"type\";i:8;s:8:\"decimals\";i:0;}}s:8:\"num_rows\";i:0;s:10:\"return_val\";i:0;s:11:\"key_version\";i:1;}"
1510462482.542520 [0 127.0.0.1:48166] "GET" "w3tc_linuxhostsupport.com_0_dbcache_b8bd04fe419b1c9d747a8bccb997d588"
1510462482.543239 [0 127.0.0.1:48166] "GET" "w3tc_linuxhostsupport.com_0_dbcache_a8b6d316b4c822ac63eaf77731ed617b"
1510462482.543760 [0 127.0.0.1:48166] "GET" "w3tc_linuxhostsupport.com_0_dbcache_53058f6b83972cfc3253e30ef06fcaa9"
1510462482.544272 [0 127.0.0.1:48166] "GET" "w3tc_linuxhostsupport.com_0_dbcache_276679217e6dc451b6353e7a1901990c"

Speeding up VestaCP on CentOS 7 is an easy task if you have a Outsourced Hosting Support with us. Feel free to ask our expert Linux Administrators to speed up VestaCP on your CentOS 7 server for you, and it will be taken care of immediately. They are available 24×7, so you can get the help you need at any time.

PS. Feel free to share this blog on how to Speed up VestaCP on CentOS 7 post if you liked it by using the social network shortcuts – you can also leave a comment instead, found under the share buttons.

The post Speed up VestaCP on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/speed-up-vestacp-on-centos-7/feed/ 14
How to install WordPress on a CentOS 7 VPS in less than 2 minutes https://linuxhostsupport.com/blog/how-to-install-wordpress-on-a-centos-7-vps-in-less-than-2-minutes/ https://linuxhostsupport.com/blog/how-to-install-wordpress-on-a-centos-7-vps-in-less-than-2-minutes/#respond Wed, 04 Oct 2017 13:17:34 +0000 https://linuxhostsupport.com/blog/?p=230 This tutorial will show you how to setup and install WordPress on your CentOS 7 VPS in less than 2 minutes. While WordPress is already easy to setup and install, we’re going to make this process even easier. We’ve put together a script containing some commands which will help you set up and install WordPress […]

The post How to install WordPress on a CentOS 7 VPS in less than 2 minutes appeared first on LinuxHostSupport.

]]>
This tutorial will show you how to setup and install WordPress on your CentOS 7 VPS in less than 2 minutes. While WordPress is already easy to setup and install, we’re going to make this process even easier. We’ve put together a script containing some commands which will help you set up and install WordPress on your CentOS 7 machine in no time.  Installing WordPress on a CentOS 7 VPS  is really an easy task and it can be done in less than 2 minutes.
All you have to do is to copy and paste the script into a file, execute it, and answer a few basic questions. But before we begin, you will need to have your MySQL ‘root’ password set. If not, please run:

mysql_secure_installation

Set your MySQL ‘root’ password before executing the script below. If for some reason you don’t remember your MySQL password, then you can easily reset your MySQL ‘root’ password as described here.

NOTE: Keep in mind that you need to have a domain name registered and pointing to your server’s IP address before installing WordPress, or else this script will not work.

This is the script, you will need to open up your favorite text editor, copy and paste this script into your editor, and save it with a name of your choice.

#!/bin/bash
#Install WordPress on a CentOS 7 VPS

#Set variables and create database

clear
echo -n "Enter your MySQL root password: "
read -s rootpass
echo ""
read -p "Database name: " dbname
read -p "Database username: " dbuser
read -p "Enter a password for user $dbuser: " userpass
mysql -uroot -p$rootpass <<MYSQL_SCRIPT
CREATE DATABASE $dbname CHARACTER SET utf8 COLLATE utf8_general_ci;
DELETE FROM mysql.user WHERE user='$dbuser' AND host = 'localhost';
FLUSH PRIVILEGES;
CREATE USER $dbuser@localhost;
GRANT ALL PRIVILEGES ON $dbname.* TO $dbuser@localhost IDENTIFIED BY '$userpass';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
echo "Database created. Starting installation!"
sleep 2

#Download, install, and configuration of WordPress

read -p "Enter your server's public IP address: " address
read -r -p "Enter your WordPress URL [e.g. mydomain.com]: " wordurl
mkdir -p /var/www/html/$wordurl
cd /tmp/
wget -q http://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz -C /var/www/html/
rm -f /tmp/latest.tar.gz
mv /var/www/html/wordpress /var/www/html/$wordurl
cd /var/www/html/$wordurl
sed -e "s/database_name_here/"$dbname"/" -e "s/username_here/"$dbuser"/" -e "s/password_here/"$userpass"/" wp-config-sample.php > wp-config.php
chown apache: -R /var/www/html/$wordurl

#Create a Virtual Host

echo "

<VirtualHost $address:80>
 ServerName www.$wordurl
 DocumentRoot "/var/www/html/$wordurl"
 DirectoryIndex index.php
 Options FollowSymLinks
 ErrorLog logs/$wordurl-error_log
 CustomLog logs/$wordurl-access_log common
</VirtualHost>

" >> /etc/httpd/conf/httpd.conf

#Create .htaccess file

echo "

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

" >> /var/www/html/$wordurl/.htaccess

systemctl restart httpd

echo "Continue your installation at http://www.$wordurl/wp-admin/install.php"

#End of script

Once you have saved this file, now you will need to make this executable by running this command:

chmod +x <name of your file>

Now that you have made your file executable, you can now execute your script and install WordPress:

./<name of your file>

The script will then ask you for information to create a MySQL database for your WordPress installation, after which it then downloads, installs, and configures your installation to work with your database. Finally, it creates a virtual host with which your WordPress installation will be served to a web browser. Altogether, this should take no more than a few minutes to set up and run.

Now that you have successfully installed WordPress on your server, the last thing you’ll need to do is to navigate to http://<yourwebsitehere>.com/wp-admin/install.php and finish configuring your WordPress installation.

Of course, you don’t have to do any of this if you use one of our Linux Host Support services, in which case you can simply ask our expert Linux admins to install this for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, please share it with your friends on the social networks using the buttons below, or simply leave a comment. Thanks.

The post How to install WordPress on a CentOS 7 VPS in less than 2 minutes appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-wordpress-on-a-centos-7-vps-in-less-than-2-minutes/feed/ 0
How to Manage RPM Packages on CentOS https://linuxhostsupport.com/blog/how-to-manage-rpm-packages-on-centos/ https://linuxhostsupport.com/blog/how-to-manage-rpm-packages-on-centos/#respond Tue, 07 Mar 2017 13:32:21 +0000 https://linuxhostsupport.com/blog/?p=38 RPM is short for Red Hat Package Manager. It is the standard package management system for all Red Hat based distros such as CentOS, RHEL and Fedora. RPM is a very powerful utility that allows users to manage, install, uninstall, upgrade, query and verify UNIX system software packages. The default extension for files that can […]

The post How to Manage RPM Packages on CentOS appeared first on LinuxHostSupport.

]]>
RPM is short for Red Hat Package Manager. It is the standard package management system for all Red Hat based distros such as CentOS, RHEL and Fedora. RPM is a very powerful utility that allows users to manage, install, uninstall, upgrade, query and verify UNIX system software packages. The default extension for files that can be managed with this package manager is .rpm

Advantages of RPM include straightforward program installation and uninstallation, automatic installation, ease of updating programs originally installed with RPM, and availability of versions for most Red Hat distributions of Linux.

In this article, we will describe some of the most useful RPM usage scenarios that might be helpful to all users that have a Red Hat-based Linux distro installed on their server.

1. List all installed RPM packages

The following command will print a list of installed RPM packages on your Linux VPS

rpm -qa

npm-3.10.8-1.6.9.1.4.el7.x86_64
bash-4.2.46-21.el7_3.x86_64
grep-2.20-2.el7.x86_64
iptables-1.4.21-17.el7.x86_64
...

2. Install RPM packages

We can easily install an RPM package using the package manager. In this example, we will install the Nano text editor from a downloaded RPM package

rpm -ivh nano-2.3.1-10.el7.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
1:nano-2.3.1-10.el7                ################################# [100%]

You can confirm that Nano is successfully installed by executing the following command

nano --version
GNU nano version 2.3.1 (compiled 04:47:52, Jun 10 2014)
(C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009 Free Software Foundation, Inc.
Email: nano@nano-editor.org    Web: http://www.nano-editor.org/
Compiled options: --enable-color --enable-extra --enable-multibuffer --enable-nanorc --enable-utf8

You can install packages without checking for dependencies using –nodeps

rpm -ivh --nodeps package

3. Upgrade RPM packages

Upgrading an existing package is very simple and it can be done using the -U option.  The package manager checks if there is an older version of the package installed on the server, and in case it is not found, RPM will still install it. For example, if you have an older version of Nano already installed on your server, you can upgrade it using the -U option.

rpm -Uvh nano-2.3.1-10.el7.x86_64.rpm
Preparing...                ########################################### [100%]
1:nano                     ########################################### [100%]

4. Remove RPM packages

If you want to remove an RPM package, you have to use the -e option as shown in the example below

rpm -e nano-2.3.1-10.el7.x86_64

You can also remove an RPM package without checking for dependencies, but please be careful because removing a file without checking the dependencies may break some application.

rpm -e --nodeps package

5. Information about installed RPM packages

If you need more information about some of the installed RPM packages you can run the following command

rpm -qi nano
Name        : nano
Version     : 2.3.1
Release     : 10.el7
Architecture: x86_64
Install Date: Mon 06 Mar 2017 08:42:24 CST
Group       : Applications/Editors
Size        : 1715901
License     : GPLv3+
Signature   : RSA/SHA256, Thu 03 Jul 2014 22:53:43 CDT, Key ID 24c6a8a7f4a80eb5
Source RPM  : nano-2.3.1-10.el7.src.rpm
Build Date  : Mon 09 Jun 2014 23:47:54 CDT
Build Host  : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://www.nano-editor.org
Summary     : A small text editor
Description :
GNU nano is a small and friendly text editor.

Of course, you don’t have to do any of this if you use one of our Server Management Services, in which case you can simply ask our expert Linux admins to help you with your RPM packages. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

The post How to Manage RPM Packages on CentOS appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-manage-rpm-packages-on-centos/feed/ 0