centos 7 | LinuxHostSupport Linux Tutorials and Guides Thu, 24 Dec 2020 10:22:02 +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 Dotclear on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-dotclear-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-dotclear-on-centos-7/#respond Thu, 12 Sep 2019 13:05:52 +0000 https://linuxhostsupport.com/blog/?p=890 In this tutorial, we will guide you through the steps of installing Dotclear on a CentOS 7 server, with Apache web server, PHP and MySQL. Dotclear is a free and open-source PHP-based web publishing platform. This software allows you to spread your words to the internet easily with an intuitive user-interface and an extensive feature […]

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

]]>
In this tutorial, we will guide you through the steps of installing Dotclear on a CentOS 7 server, with Apache web server, PHP and MySQL.

Dotclear is a free and open-source PHP-based web publishing platform. This software allows you to spread your words to the internet easily with an intuitive user-interface and an extensive feature set. It is very fast, stable, and easy to use. The installation is pretty simple and straightforward.

Dotclear comes with a lot of handy features out of the box, such as:

  • Fast and easy publication system
  • Fully customizable themes, without changing or editing any code
  • User-friendly administrative panel
  • Flexible template system
  • Built-in anti spam system
  • Lots of themes and plugins
  • Complete trackback support
  • SEO friendly
  • and many more… 

Requirements

  • For the purposes of this tutorial you will need a server running CentOS 7.
  • System user with root privileges
  • PHP version 5.6 or newer with mbstring, iconv, simpleXML, SPL PHP extensions enabled
  • MySQL, PostgreSQL or SQLite database server
  • Apache or Nginx web server

Step 1. Log in and Update the System

In order to start installing Dotclear on your CentOS 7 server, you have to login to the server via SSH as user root

ssh root@IP_Address -p Port_Number

Don’t forget to replace ‘IP_Address‘ and ‘Port_Number‘ with your server’s actual IP address and SSH port number.

Once you are in, run the following command to update all installed packages on your server

yum -y update

Step 2. Install the Apache Web Server

A web server is required to serve the Dotclear files, so in the next step we will install Apache web server, which is the most popular web server in the world. It can easily be installed from the official CentOS 7 repositories using the ‘yum’ package manager. Run this command to install Apache:

yum -y install httpd

After the installation is completed, run the following commands to start the Apache web server and enable it to automatically start after a server reboot

systemctl start httpd
systemctl enable httpd

To verify that the installation is OK and that the web server is properly running, issue the following command:

systemctl status httpd

Output

httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-04-25 04:18:22 CDT; 39s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 703 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ââ703 /usr/sbin/httpd -DFOREGROUND
           ââ883 /usr/sbin/httpd -DFOREGROUND
           ââ884 /usr/sbin/httpd -DFOREGROUND

Step 3. Install the MariaDB Database Server

Dotclear uses a databse to store and retrieve the website information. For this purpose we will install and use MariaDB database server which is a drop-in replacement for MySQL. The installation of MariaDB is easy and it can be done using the following commands

yum -y install mariadb mariadb-server

Once the MariaDB database server is installed, start it and enable it to automatically start after a server reboot

systemctl start mariadb
systemctl enable mariadb

Check if MariaDB is up and running:

systemctl status mariadb

The output will look something like this:

mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-04-26 06:09:18 CDT; 33s ago
  Process: 22143 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
  Process: 22110 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
 Main PID: 22141 (mysqld_safe)
   CGroup: /system.slice/mariadb.service
           ââ22141 /bin/sh /usr/bin/mysqld_safe --basedir=/usr

Next, run the mysql_secure_installation post-installation script provided by MariaDB to strengthen the security of the database server and set a root password. You can use the following options:

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

If it at any point asks you to enter the current MySQL/MariaDB root password, just press the [Enter] key, as no password is set by default.

Step 4. Create a MariaDB User and Database

In this step, we will create a new MariaDB user and database which will be used for the Dotclear installation. Log in to the MariaDB server CLI as the root user and issue the following commands

mysql -u root -p

MariaDB [(none)]> CREATE DATABASE dotclear;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON dotclear.* TO dotclearuser@localhost IDENTIFIED BY 'PASSWORD';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

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

Step 5. Download Dotclear

Go to Dotclear’s download page and download the latest stable release of the application. At the moment of writing this article it is version 2.14.3. We’ve included the download link in the command below for you:

wget http://download.dotclear.org/latest.zip

Unpack the downloaded ZIP archive to the document root directory of your web server:

uunzip latest.zip -d /var/www/html/

All Dotclear files will be extracted in a new ‘dotclear’ directory. Make sure that the Apache user has access to the Dotclear files:

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

Step 6. Create an Apache Virtual Host

Next, we will create Apache virtual host directive in order to be able to access Dotclear with a domain name. We will use yourdomain.com as a domain name. You have to replace all occurrences of this domain name in the configuration file.

Create Apache configuration with the following content

nano /etc/httpd/conf.d/dotclear.conf

<VirtualHost *:80>
    ServerAdmin admin@yourdomain.com
    ServerName yourdomain.com ServerAlias www.your_domain.com DocumentRoot /var/www/html/dotclear <Directory /var/www/html/dotclear> Options Indexes FollowSymLinks AllowOverride All </Directory> ErrorLog ${APACHE_LOG_DIR}/yourdomain.com_error.log CustomLog ${APACHE_LOG_DIR}/yourdomain.com_access.log combined </VirtualHost>

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

systemctl restart httpd

Step 7. Complete the Installation

Finally, all the requirements are installed on the server and we can continue with the installation through Dotclear’s web-based installation wizard. Open your preferred web browser, navigate to http://yourdomain.com and follow the on-screen instructions in order to complete the Dotclear installation and configuration. The installation wizard will check if your server meets all the requirements and you will be prompted to enter the details of the MariaDB database we have created earlier in this tutorial.

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


Of course, you don’t have to install Dotclear on CentOS 7 if you use one of our Managed Linux Support services. You can simply ask our support team to install Dotclear on your CentOS 7 server for you. They are available 24/7 and will be able to help you with the installation.

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

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

]]>
https://linuxhostsupport.com/blog/how-to-install-dotclear-on-centos-7/feed/ 0
How to Speed Up a Website on CentOS 7 https://linuxhostsupport.com/blog/how-to-speed-up-a-website-on-centos-7/ https://linuxhostsupport.com/blog/how-to-speed-up-a-website-on-centos-7/#respond Wed, 24 Oct 2018 07:41:12 +0000 https://linuxhostsupport.com/blog/?p=732 Accelerating the website can often be a demanding job requiring detailed planning, knowledge of different areas, with a focus on testing and evaluation. Often, there are several teams working on this segment: web developers, system administrators, network experts, and other professionals. In this article, we will show you how to speed up a website on […]

The post How to Speed Up a Website on CentOS 7 appeared first on LinuxHostSupport.

]]>
Accelerating the website can often be a demanding job requiring detailed planning, knowledge of different areas, with a focus on testing and evaluation. Often, there are several teams working on this segment: web developers, system administrators, network experts, and other professionals. In this article, we will show you how to speed up a website on a CentOS 7 server.

Why is the website speed so important?

The answer is simple – the download speed affects the ranking of your website on search engines. The website’s download speed is included in the search engine ranking factors, and therefore this is an important SEO factor. Slow websites negatively affect the conversion rates that are crucial to the success of every online business.

Use fast and reliable hosting

It’s obvious that you need to use reliable web hosting if you want your website to be loaded fast.

Enable gzip compression

Images are mostly compressed, but textual content leaves plenty of room for “zipping”. The web server can be configured to send compressed content to all web browsers that can accept it. This makes sense to do with all the textual content, such as HTML, JavaScript, CSS, text, and XML files.

speed up a website on CentOS 7Compressed files are much smaller and are downloaded much faster, which in the end greatly reduces the time needed to load those content from the end user. The process of compression (on the server side) and decompression (on the client side) burdens the processor, but modern processors are fast and easy to cope with, while the speed of the Internet connection is still often a bottleneck. So compression contributes to the overall speed of the website, in the vast majority of cases.

All new web browsers allow you to read HTML, CSS and Javascript files in compressed form.

In order to enable GZIP compression, it is necessary to configure the web server so that it compresses all files before sending it compressed in GZIP format. Specific configuration commands depend on the type of the server. On CentOS servers with Apache, the simplest solution is to modify the .htaccess file located in the root directory of your website.

vi .htaccess

If you do not have this file, you need to create it yourself and enter the following code into it:

<IfModule mod_deflate.c>
# Enable HTML, CSS, JavaScript, Text, XML and font compression
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml

#Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>

Configure web browser caching

An important setting is “expiration date”, that determines the “shelf life” of a file on the server. If the “expiration date” is not set for the files, they will be loaded directly from the server at each request by the visitor. Otherwise, the web browser will load the same file on the user’s computer, not the server, if it has to load the file on the user’s computer again. The result is clear, saving in loading time and resources is enormous. This setting is recommended mostly for static content on the site, which is rarely being changed. These can be images, Javascript, and even CSS files.

In order to allow caching of such files, it is necessary to re-edit the .htaccess file in the root directory of the website, i.e. add the following code to it:

<ifModule mod_headers.c>
<filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\\.(css)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\\.(js)$">
Header set Cache-Control "max-age=216000, private"
</filesMatch>
<filesMatch "\\.(xml|txt)$">
Header set Cache-Control "max-age=216000, public, must-revalidate"
</filesMatch>
<filesMatch "\\.(html|htm|php)$">
Header set Cache-Control "max-age=1, private, must-revalidate"
</filesMatch>
</ifModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access plus 1 year"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
</IfModule>

By using these simple .htaccess rules for caching, you can dramatically improve the speed of the website.

Use a CDN

Content Delivery Network (CDN) is a collection of web servers distributed across multiple locations in order to provide more efficient content delivery to users. Using this solution can help your website get faster by 20% or more.

Reduce HTTP requests

In order to reduce page loading time, you also need to reduce HTTP requests. This means that you need to:

  • reduce the number of JavaScript files or try combining many JavaScript files into one bigger file,
  • reduce the number of CSS files or try combining many CSS files into one bigger file,
  • reduce the number of images.

That’s it, your website should be faster now. If your website based on WordPress, you can use plugins to do some of the steps mentioned above.


If you use one of our premium server management services our expert system engineers can speed up and optimize your website for blazing fast speeds. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to speed up your website on CentOS 7, please share it with your friends on the social networks using the buttons below or simply leave a reply in the comments sections. Thanks.

The post How to Speed Up a Website on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-speed-up-a-website-on-centos-7/feed/ 0
How to Install Nagios Core on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-nagios-core-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-nagios-core-on-centos-7/#comments Wed, 12 Sep 2018 08:03:31 +0000 https://linuxhostsupport.com/blog/?p=662 Nagios (also known as Nagios Core) is a free and open source application which can be used for monitoring Linux or Windows servers, network infrastructures and applications. When properly configured it will alert you when something on your server goes wrong and then notify you again once the problem has been resolved. In this tutorial, […]

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

]]>
Nagios (also known as Nagios Core) is a free and open source application which can be used for monitoring Linux or Windows servers, network infrastructures and applications. When properly configured it will alert you when something on your server goes wrong and then notify you again once the problem has been resolved. In this tutorial, we will show you how to install and configure the latest Nagios Core version on a CentOS 7 VPS.

Step 1: Connect to your server

Connect to your server via SSH as user root, use the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

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

Once logged in, make sure that your server is up-to-date by running the following command:

yum update

Step 2: Install LAMP

For Nagios Core to work on your server you will also need to set up a LAMP or any other web hosting stack. If you already have working web hosting stack installed on your server you can skip this and go to the next step of this tutorial.

To install a LAMP stack with Apache, MariaDB and PHP 7 on your CentOS server, run the following command:

yum install httpd mariadb-server php php-mysql

When the MariaDB installation is complete, you can also run the following command to secure your MariaDB installation:

mysql_secure_installation

You will also need to enable MariaDB and Apache to start on boot with:

systemctl enable httpd.service
systemctl enable mariadb.service

Step 3: Install the required packages

The following packages are also be required by the Nagios Core software. You can install them with the following command:

yum install gcc glibc glibc-common wget gd gd-devel perl postfix

Step 4: Download and Install Nagios Core

Let’s download the latest stable version of the Nagios Core.

First, navigate to the tmp directory on your server with:

cd /tmp

and run the following command to download the tar archive file:

wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.4.2.tar.gz

Once the download is complete, execute the following command to extract the archive file:

tar xzf nagioscore.tar.gz

Once the archive is extracted, move to the nagioscore-nagios-4.4.2 directory:

cd /tmp/nagioscore-nagios-4.4.2

and run the following command in order to configure the installer and prepare the Nagios Core source code for the compilation process:

./configure

After the configuration is completed, you can now compile Nagios Core by execution the following command:

make all

You also need to run the following commands to create the nagios user and group and add apache to the nagios group:

make install-groups-users
usermod -a -G nagios apache

Now, you can finally run the following command in order to install Nagios Core:

make install

To, install the initialization script which can be used to manage your Nagios service, run the following command:

make install-daemoninit

Next, run the following command to install the Nagios sample configuration files:

make install-config

Run the following command to install and configure the external command file to make Nagios Core to work from the command line:

make install-commandmode

The following command will install the Apache web server configuration files:

make install-webconf

After all the installations are complete, restart your apache service with:

systemctl restart httpd

Step 5: Create nagiosadmin User Account

To be able to log into Nagios, you will need to create an Apache user account.

You need to run the following command to create a new user account called nagiosadmin and assign a password to it:

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

With this step, the main Nagios Core installation is now complete. However, for Nagios Core to operate properly you will also need to install the Nagios Plugins as explained in the next step.

Step 6: Install Nagios Plugins

Before you download and install the Nagios plugins, you need to make sure that the following packages are installed on your CentOS 7 server:

yum install gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils epel-release perl-Net-SNMP

To download and extract the latest version of the Nagios Plugins to the tmp directory on your server, run the following commands:

cd /tmp
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.2.1.tar.gz
tar zxf nagios-plugins.tar.gz

Once the Nagios Plugins archive is extracted, run the following commands to compile and install the Nagios Plugins on your server:

cd /tmp/nagios-plugins-release-2.2.1/
./tools/setup
./configure
make
make install

Step 7: Accessing Nagios Core

After you have successfully installed Nagios Core and the Nagios Plugins your CentOS 7 system, you can use the following command to start the Nagios service:

systemctl start nagios

To access Nagios Core, open your browser and navigate to http://YOUR-IP-ADDRESS/nagios and log in using the nagiosadmin user account which you have created in one of the previous steps in this tutorial.

After you have successfully logged in, you will be presented with the Nagios Core home screen as shown in the image below:

install nagios on centos 7

Congratulations! You have successfully installed Nagios Core on CentOS 7. For more information about how to manage your Nagios Core software, please refer to the official Nagios documentation.


Of course, you don’t have to install Nagios Core on CentOS 7, if you use one of our premium server management services, in which case you can simply ask our expert system administrators to install the latest version of Nagios Core on CentOS 7 for you, using the LAMP stack or any other web hosting stack of your choice. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on how to install Nagios Core 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 Nagios Core on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-nagios-core-on-centos-7/feed/ 3
How to Install ownCloud 10 on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-owncloud-10-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-owncloud-10-on-centos-7/#respond Wed, 04 Apr 2018 07:46:46 +0000 https://linuxhostsupport.com/blog/?p=505 Today we have a tutorial on how to install ownCloud 10 on CentOS 7.  ownCloud is a popular open source web application used for data synchronization, file sharing, collaboration . It is a cross-platform and super easy to use application that that offers a great security and total control of your files.You can use our […]

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

]]>
Today we have a tutorial on how to install ownCloud 10 on CentOS 7.  ownCloud is a popular open source web application used for data synchronization, file sharing, collaboration . It is a cross-platform and super easy to use application that that offers a great security and total control of your files.You can use our Server Support Services, and we will install ownCloud on your private server with easy, and we will do all the configuration and hardening required. We are always available via the Live Chat option in the bottom right corner of our website, where you can ask for more info, about time-frame, pricing, etc.. Let’s get started with installing ownCloud 10.

install owncloud 10 on centos 7

At the time of writing this tutorial, the latest stable version of ownCloud is 10.0.7, and it requires the following:

  • PHP >= 5.6 (PHP 7.0 or above is recommended), with the following PHP extensions enabled: XML (Expat), curl, PDO, Phar, GD Graphics Library version 2.0.x+, DOM, ctype, JSON, iconv, intl, mcrypt, openssl, bz2, Zlib and Zip.
  • Apache Web Server >= 2.0 compiled with mod_rewrite module
  • MySQL >= 5.x (MySQL 5.5 or later is recommended), MariaDB 5.5+, PostgreSQL, or SQLite installed on your Linux virtual server.

Let’s start with the ownCloud installation procedure.

1. Update the OS packages

Make sure the CentOS 7 server packages are fully up-to-date:

yum clean all
yum -y update

2. Install PHP 7.1 and the required PHP extensions

The default PHP version on CentOS 7 is PHP 5.4. In this tutorial, we will install PHP version 7.

Install EPEL and Remi repository packages:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Enable the Remi PHP 7.1 repository:

yum-config-manager --enable remi-php71

and install PHP 7.1 and several PHP extensions required by ownCloud by running the following command:

yum install php php-mysqlnd php-pecl-zip php-xml php-mbstring php-gd php-mcrypt php-pear php-pspell php-pdo php-xml php-intl php-zip php-zlib

Open the PHP configuration file and increase the upload file size. You can find the location of the PHP configuration file by executing the following command:

php -i | grep -i php.ini
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini

Increase the default post_max_size and upload_max_filesize values in the PHP configuration, e.g.:

sed -i "s/post_max_size = 8M/post_max_size = 256M/" /etc/php.ini
sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 256M/" /etc/php.ini

You can set the post_max_size and upload_max_filesize values according to your needs.
Do not forget to restart the Apache service for the changes to take effect:

systemctl restart httpd.service

3. Download and extract ownCloud

Download ownCloud 10.0.7 available at http://download.owncloud.org/ in some directory on the server and extract the downloaded ownCloud archive using the following commands:

cd /opt
wget https://download.owncloud.org/community/owncloud-10.0.7.zip
yum -y install unzip 
unzip -d /var/www/html/ owncloud-10.0.7.zip

Change the permissions on the owncloud directory:

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

4. Create a new MySQL database

Create a new MySQL database for ownCloud on your server:

mysql -u root -p
mysql> CREATE DATABASE ownclouddb;
mysql> GRANT ALL PRIVILEGES ON ownclouddb.* TO 'ownclouduser'@'localhost' IDENTIFIED BY 'Y0ur-pa55w0rD' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> quit

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘owncloud.conf’ on your virtual server:

touch /etc/httpd/conf.d/owncloud.conf
vi /etc/httpd/conf.d/owncloud.conf

Then, add the following lines:

<VirtualHost YOUR_SERVER_IP:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/html/owncloud/"
ServerName yourdomain.com
ServerAlias www.yourdomain.com

ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined

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

Create a new ownCloud data directory outside of the document root directory:

mkdir -p /opt/data
chown apache:apache -R /opt/data/

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

systemctl restart httpd

5. Install a new SSL certificate

Install a new SSL certificate from Let’sEncrypt, or obtain a new SSL certificate from some Certificate Authority.

yum -y install mod_ssl python-certbot-apache
certbot --apache -d yourdomain.com

Replace ‘yourdomain.com’ with the actual domain name you want to use to access the ownCloud installation.

6. Continue the ownCloud installation using a web browser

Open https://yourdomain.com in your favorite web browser, create a new administrator account (set an admin username and password), click on ‘Storage & database’, change the ‘data’ directory to ‘/opt/data’ (do not leave the default setting ‘/var/www/html/owncloud/data’). Click on ‘Configure the database’, select MySQL/MariaDB, enter the database information (MariaDB username, password, database name and localhost:3306 as MariaDB hostname/port) and finally click on the ‘Finish setup’ button.

installing owncloud 10 on centos 7

That is it, the OwnCloud 10 installation on your CentOs 7 server is now complete.

 


Of course, you don’t have to install and configure OwnCloud 10 on a CentOS 7 VPS, if you use one of our Hosting Support Services, in which case our expert Linux admins will to install and configure OwnCloud 10 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 OwnCloud 10 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 ownCloud 10 on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-owncloud-10-on-centos-7/feed/ 0
How to Install LDAP on CentOS 7 https://linuxhostsupport.com/blog/how-to-install-ldap-on-centos-7/ https://linuxhostsupport.com/blog/how-to-install-ldap-on-centos-7/#comments Wed, 07 Mar 2018 08:48:40 +0000 https://linuxhostsupport.com/blog/?p=457 Today, we will show you, How to install LDAP on CentOS 7. LDAP, or Lightweight Directory Access Protocol, is an open, vendor-neutral, industry standard application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network. It can be used to store any kind of information and it is often used […]

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

]]>
Today, we will show you, How to install LDAP on CentOS 7. LDAP, or Lightweight Directory Access Protocol, is an open, vendor-neutral, industry standard application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network. It can be used to store any kind of information and it is often used as one component of a centralized authentication system. Installing and configuring an OpenLDAP server on CentOS 7, it’s fairly easy task, just carefully follow the tutorial below and you should have it installed in less than 10 minutes.

Update the system

As usual before installing new software, update all your system packages to the newest available version first:

# yum update

Install OpenLDAP

We are going to begin by installing the packages required for OpenLDAP functionality:

# yum -y install openldap compat-openldap openldap-clients openldap-servers openldap-servers-sql openldap-devel

We will also start the LDAP daemon and enable it on boot:

# systemctl start slapd.service
# systemctl enable slapd.service

Run the slappasswd command to set a LDAP root password and save the output because we are going to need it to configure OpenLDAP:

# slappasswd

We’ll configure the OpenLDAP server now. We’ll create a few LDIF files and then we will use the ldapmodify command to deploy the configuration to the server. The files will be stored in ‘/etc/openldap/slapd.d’ and they shouldn’t be edited manually.

The ‘db.ldif’ file will update the olcSuffix variable which will add the distinguished name to queries that will be passed to the backend database, it will configure the domain name for which your LDAP server will provide account information, and it will update the olcRootDN variable which specifies the root distinguished name user that will have administrator access to the LDAP server.

Our domain is field.linuxhostsupport.com, and written inside the ‘db.ldif’ file it looks like this ‘dc=field,dc=linuxhostsupport,dc=com’ and our root distinguished name is ‘cn=ldapadm,dc=field,dc=linuxhostsupport,dc=com’.

Configure OpenLDAP

Create the db.ldif file using nano or an editor of your preference and paste the following content in:

# nano db.ldif

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=field,dc=linuxhostsupport,dc=com
 
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=ldapadm,dc=field,dc=linuxhostsupport,dc=com
 
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: hashed_output_from_the_slappasswd_command

Deploy the configuration using ldapmodify:

# ldapmodify -Y EXTERNAL -H ldapi:/// -f db.ldif

Now restrict monitor access only to the ldapadm user:

# nano monitor.ldif

dn: olcDatabase={1}monitor,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external, cn=auth" read by dn.base="cn=ldapadm,dc=field,dc=linuxhostsupport,dc=com" read by * none

Deploy the configuration change again:

# ldapmodify -Y EXTERNAL -H ldapi:/// -f monitor.ldif

Now we will generate a certificate and a private key so we can communicate securely with the OpenLDAP server. We will use the command below to do that:

openssl req -new -x509 -nodes -out \
/etc/openldap/certs/myldap.field.linuxhostsupport.com.cert \
-keyout /etc/openldap/certs/myldap.field.linuxhostsupport.com.key \
-days 365

Change the owner and group permissions so OpenLDAP can read the files:

# chown -R ldap:ldap /etc/openldap/certs

Now create certs.ldif to configure OpenLDAP to use the LDAPS protocol:

# nano certs.ldif

dn: cn=config
changetype: modify
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/openldap/certs/myldap.field.linuxhostsupport.com.cert

dn: cn=config
changetype: modify
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/openldap/certs/myldap.field.linuxhostsupport.com.key

We can then deploy the configuration again:

# ldapmodify -Y EXTERNAL -H ldapi:/// -f certs.ldif

Now test the configuration using the following command:

# slaptest -u

Setting up the OpenLDAP database

Now we can set up the LDAP database, start by copying the sample database configuration file to ‘/var/lib/ldap’ and change the file permissions:

# cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
# chown -R ldap:ldap /var/lib/ldap

Add the LDAP schemas:

# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/cosine.ldif
# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/nis.ldif
# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/inetorgperson.ldif

And now create a base.ldif file for your domain:

# nano base.ldif

dn: dc=field,dc=linuxhostsupport,dc=com
dc: field
objectClass: top
objectClass: domain

dn: cn=ldapadm,dc=field,dc=linuxhostsupport,dc=com
objectClass: organizationalRole
cn: ldapadm
description: LDAP Manager

dn: ou=People,dc=field,dc=linuxhostsupport,dc=com
objectClass: organizationalUnit
ou: People

dn: ou=Group,dc=field,dc=linuxhostsupport,dc=com
objectClass: organizationalUnit
ou: Group

We will deploy these configuration changes to the OpenLDAP server using the ldapadm user:

# ldapadd -x -W -D "cn=ldapadm,dc=field,dc=linuxhostsupport,dc=com" -f base.ldif

Enter the root password when prompted.

If you need to add users it’s easier to add them with a GUI, we recommend using Apache Directory Studio or JXplorer for this.

That’s it you should now have successfully installed LDAP on CentOS 7.

 

Of course you don’t have to install LDAP on CentOS 7, if you use one of our Linux server support services, in which case you can simply ask our expert Linux admins to configure this 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 LDAP 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 LDAP on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-ldap-on-centos-7/feed/ 54
How to install Let’s Encrypt on CentOS 7 with Apache https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-on-centos-7-with-apache/ https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-on-centos-7-with-apache/#comments Wed, 31 Jan 2018 08:51:55 +0000 https://linuxhostsupport.com/blog/?p=426 Today, we will show you, How to install Let’s Encrypt on CentOS 7 with Apache. Let’s Encrypt is a completely free and automated, new certificate authority developed by the Internet Security Research Group (ISRG) and recognized by all major browsers. They make it a breeze to set up TLS certificates for your web server. And […]

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

]]>
Today, we will show you, How to install Let’s Encrypt on CentOS 7 with Apache. Let’s Encrypt is a completely free and automated, new certificate authority developed by the Internet Security Research Group (ISRG) and recognized by all major browsers. They make it a breeze to set up TLS certificates for your web server. And for free! Let’s Encrypt is supported by major players like Mozilla, Akamai, Cisco, the EFF and managed by the Linux Foundation. Let’s Encrypt provides free, automatic and secure certificates. The website owners can easily obtain security certificates within minutes, enabling a safer web experience for all.In today’s tutorial we are going to learn how to install a Let’s Encrypt SSL certificate on CentOS 7 with Apache, and configure the certbot for automatic renewal.

1. Update the system

As usual make sure the system is fully up to date before installing any packages:

# yum -y update

2. Install Apache

We are going to use Apache as our web server, install it using this command:

# yum -y install httpd

3. Install mod_ssl

Install mod_ssl as well as we are going to need it to configure our Let’s Encrypt SSL certificate:

# yum -y install mod_ssl

4. Configure Apache

Create a document root folder for your site:

# mkdir /var/www/test

Create a virtual host config file for your site by opening it with nano and then pasting the following contents inside:

# nano /etc/httpd/conf.d/test-site.conf

<VirtualHost *:80>
    ServerAdmin admin@test.com
    DocumentRoot "/var/www/test"
    ServerName test.com
    ServerAlias www.test.com
    ErrorLog "/var/log/httpd/test.error_log"
    CustomLog "/var/log/httpd/test.access_log" common
</VirtualHost>

Add a index.html file for testing purposes later with the following contents:

# nano /var/www/test/index.html

It works!

Change owner of the “/var/www/test” directory to the apache user so Apache can read the directory:

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

Remember to change “test” for your site’s name.
Now that we have Apache installed we can continue by installing certbot.

5. Install certbot

To install certbot first we need to make sure we have the EPEL repository enabled, to do that execute the following command:

# yum -y install epel-release

Make sure yum-utils is installed:

# yum -y install yum-utils

Then install certbot for Apache:

# yum -y install certbot-apache

Now that we have certbot installed, run certbot with the following command:

# certbot --apache

Certbot will ask you for the names you would like to activate HTTPS for:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org

Which names would you like to activate HTTPS for?
-------------------------------------------------------------------------------
1: test.com
2: www.test.com
-------------------------------------------------------------------------------
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):

Press enter to continue and then optionally if you want you can redirect your sites to HTTPS:

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):

If everything goes well you should see the following output:

-------------------------------------------------------------------------------
Congratulations! You have successfully enabled
https://test.com and https://www.test.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=test.com
https://www.ssllabs.com/ssltest/analyze.html?d=www.test.com
-------------------------------------------------------------------------------

6. Configure automatic renewal

Now we are going to add a cronjob so our Let’s Encrypt SSL certificates can be renewed automatically.

First run the following command so we can have nano as the default editor:

# export EDITOR=/bin/nano

Then execute the following command to edit the crontab:

# crontab -e

Let’s Encrypt recommends the automatic renew cronjob to run twice a day, to do that add the following line and then save and exit the crontab:

* */12 * * * /usr/bin/certbot renew >/dev/null 2>&1

Now you should have successfully installed and configured Let’s Encrypt with Apache.

install Let’s Encrypt on CentOS 7 with Apache

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

PS. If you liked this post, on how to install Let’s Encrypt on CentOS 7 with Apache, 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 Let’s Encrypt on CentOS 7 with Apache appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-on-centos-7-with-apache/feed/ 5
Install Anchor CMS on CentOS 7 https://linuxhostsupport.com/blog/install-anchor-cms-on-centos-7/ https://linuxhostsupport.com/blog/install-anchor-cms-on-centos-7/#respond Wed, 01 Nov 2017 12:30:11 +0000 https://linuxhostsupport.com/blog/?p=256 We’ll show you, how to Install Anchor CMS on CentOS 7. Anchor CMS is an open-source, lighter-weight and ultra-simple blogging system.It’s written in PHP and comes with markdown support, custom fields, themes, i18n compatibility and many more. In this tutorial, we gonna show you How to install Anchor CMS on CentOS 7. In order to run […]

The post Install Anchor CMS on CentOS 7 appeared first on LinuxHostSupport.

]]>
We’ll show you, how to Install Anchor CMS on CentOS 7. Anchor CMS is an open-source, lighter-weight and ultra-simple blogging system.It’s written in PHP and comes with markdown support, custom fields, themes, i18n compatibility and many more. In this tutorial, we gonna show you How to install Anchor CMS on CentOS 7.

In order to run Anchor CMS on your VPS, the following requirements have to be installed:

  • MySQL
  • PHP
  • Apache 2.4 with mod_php module

In this tutorial, we will install the latest version of Anchor CMS on CentOS 7, with MySQL, PHP and Apache.

1. Update the system

First of all login to your CentOS 7 VPS via SSH as user root:

ssh root@IP_Address

and make sure that it is fully up to date:

yum -y update

2. Install MySQL server

Anchor CMS requires an empty database, so we will install MySQL server:

wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum localinstall mysql57-community-release-el7-7.noarch.rpm
yum install mysql-community-server

Once it is installed, start MySQL and enable it to start on boot:

systemctl start mysqld
systemctl enable mysqld

and run the mysql_secure_installation post-installation script to finish the MySQL set-up:

mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No:y
There are three levels of password validation policy:
LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
Please set the password for root here.
New password: Set New MySQL Password
Re-enter new password: Re-enter New MySQL Password
Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.
- Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
All done!

Once MySQL is installed, login to the database server as user root, and create database and user for Anchor CMS:

mysql -u root -p

mysql> CREATE DATABASE anchor;
mysql> GRANT ALL PRIVILEGES ON anchor.* TO 'anchoruser'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
mysql> FLUSH PRIVILEGES;
mysql> \q

3. Install Apache Web Server

Next, we will install Apache web server:

yum install httpd -y

start Apache and make it start on boot:

systemctl start httpd.service
systemctl enable httpd.service

4. Install PHP 7.1

The default PHP version on CentOS 7 is PHP 5.4. In this tutorial, we will install PHP version 7.1.

Install Remi and EPEL repository packages:

rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Enable Remi PHP 7.1 repo:

yum-config-manager --enable remi-php71

and install PHP 7.1 and several PHP modules required by Anchor CMS by executing the following command:

yum -y install php php-mysql php-pecl-zip php-xml php-mbstring php-gd

Next, open the PHP configuration file and increase the upload file size. You can find the location of the PHP configuration file by executing the following command:

php --ini |grep Loaded
Loaded Configuration File:         /etc/php.ini

In our case, we have to make changes to the /etc/php.ini file. We will increase the default upload limit to 100 MB. You can set the values according to your needs. Run the following commands:

sed -i "s/post_max_size = 8M/post_max_size = 100M/" /etc/php.ini
sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 100M/" /etc/php.ini

and restart the web server:

systemctl restart httpd

5. Install Anchor CMS

Go to Anchor’s official website and download the latest stable release of the application

wget https://github.com/anchorcms/anchor-cms/archive/0.12.3a.zip

unpack the downloaded zip archive to the document root directory on your server

unzip 0.12.3a.zip -d /var/www/html/
mv /var/www/html/anchor-cms-0.12.3a /var/www/html/anchor

Set the Apache user to be owner of the Anchor CMS files

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

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘anchor.conf’ on your virtual server:

touch /etc/httpd/conf.d/anchor.conf
nano /etc/httpd/conf.d/anchor.conf

Then, add the following lines:

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

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

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

systemctl restart httpd

Install Composer

Composer is a dependency manager for PHP with which you can install packages. Composer will pull in all the required libraries and dependencies you need for your project.

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

Now go to the Anchor CMS directory and run the following command:

cd /var/www/html/anchor
composer install

Finally, open your favorite web browser, navigate to http://your-domain.com/ and if you configured everything correctly the Anchor CMS installer should be starting. You should follow the easy instructions on the install screen inserting the necessary information as requested.

That is it. The Anchor CMS installation is now complete.


Of course, you don’t have to install Anchor CMS on CentOS 7 if you use one of our Hosting and Server Support services, in which case you can simply ask our expert Linux admins to install Anchor CMS on CentOS 7 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 Install Anchor CMS on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/install-anchor-cms-on-centos-7/feed/ 0