how to | LinuxHostSupport Linux Tutorials and Guides Wed, 07 Aug 2024 10:56:27 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 How to stop Receiving Spam Emails on Linux with SpamAssassin https://linuxhostsupport.com/blog/how-to-stop-receiving-spam-emails-on-linux-with-spamassassin/ https://linuxhostsupport.com/blog/how-to-stop-receiving-spam-emails-on-linux-with-spamassassin/#respond Thu, 15 Aug 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2153 In the ongoing struggle against unwanted communication there are many technologies and strategies on how to stop receiving spam emails. One highly effective way for Linux users is the open-source Apache SpamAssassin project, offering a highly-effective and free anti-spam platform. In this article, we’ll teach you exactly how to stop receiving spam emails on Linux […]

The post How to stop Receiving Spam Emails on Linux with SpamAssassin appeared first on LinuxHostSupport.

]]>
In the ongoing struggle against unwanted communication there are many technologies and strategies on how to stop receiving spam emails. One highly effective way for Linux users is the open-source Apache SpamAssassin project, offering a highly-effective and free anti-spam platform.

In this article, we’ll teach you exactly how to stop receiving spam emails on Linux with SpamAssassin.

What is SpamAssassin and how it works

Spamassassin is a tool that scores spam emails by comparing them against various tests. It uses a header (X-Spam-Status:) marked with a number ranging from 0-5, with a setting of 3.5 being safe enough to reduce false positives and the amount of SPAM that makes it through. A SPAM score is calculated from multiple characteristics, ranging from 0 to 5, and has been effective for years. Spamassassin is a helpful tool for filtering spam emails. In this tutorial, we’ll learn how to integrate this filter into our Postfix server.

Prerequisites

  • An up-to-date Linux system
  • Postfix installed on your system
  • Root access to your server

Installing SpamAssassin

The installation of SpamAssassin service is easy to do. We accomplish it with the following command:

sudo apt-get install spamassassin # Ubuntu
sudo yum install spamassassin # AlmaLinux

After installing the service, we must integrate it with the Postfix mail server. To accomplish that, we’ll follow the next topic.

Configuring Spamassassin with Postfix

The main configuration file from Spamassassin is generally located at /etc/spamassassin/local.cf. There, you’ll find the required_score part, which sets what is spam and what is not. You can keep it as 5 and uncomment the line if it’s commented:

required_score 5.0

If you need to whitelist someone’s domain, you can add the following directive to your local.cf file:

whitelist_from *@sender_domain.com

Also, we need to configure report_safe. This directive will do the handle of the marked spam messages.

report_safe 0 # The incoming SPAM messages will have the header modified with a directive pointing it's spam
report_safe 1 # The incoming messages tagged as SPAM will create a report and attach the original message to it
report_safe 2 # The incoming SPAM will be attached as a new report and sent as plain text

To identify spam messages on the mailbox, we need to remove the rewrite_header Subject comment line so it will identify the spam:

rewrite_header Subject SPAM

And it’s done the configuration. Now, we need to integrate Spamassassin and Postfix.

Integrating Postfix and SpamAssassin

The postfix configuration file is located at /etc/postfix/master.cf. The first change required to be done is related to the SMTP line, so the line would look like:

smtp inet n - - - - smtpd

Then, after our changes, with the integration of SpamAssassin, it would look like this:

smtp inet n - - - - smtpd -o content_filter=spamassassin

At the end of our file, we need to add the following content:

spamassassin
unix – n n – – pipe
flags=R
user=spamd
argv=/usr/bin/spamc
-e /usr/sbin/sendmail
-oi -f ${sender} ${recipient}

That’s it. SpamAssassin is configured on your system and integrated with Postfix. At this point, you can test the email deliverability of your service to see if it’s working as expected. If you’re struggling with this, feel free to contact our Incident Server Support team, and we’ll help you get everything sorted out.

The post How to stop Receiving Spam Emails on Linux with SpamAssassin appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-stop-receiving-spam-emails-on-linux-with-spamassassin/feed/ 0
How to Fix MySQL Can’t Connect to Server Issues https://linuxhostsupport.com/blog/fix-mysql-cant-connect-to-server-issues/ https://linuxhostsupport.com/blog/fix-mysql-cant-connect-to-server-issues/#respond Mon, 15 Apr 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2070 Last month, we showed you how to resolve the “can’t connect to local server” error, though this won’t help if you’re using a remote MySQL server. As such, we’ve created this guide on “how to fix MySQL can’t connect to server issues”. MySQL is a popular open-source RDBMS, short for Relational Database Management System, widely […]

The post How to Fix MySQL Can’t Connect to Server Issues appeared first on LinuxHostSupport.

]]>
Last month, we showed you how to resolve the “can’t connect to local server” error, though this won’t help if you’re using a remote MySQL server. As such, we’ve created this guide on “how to fix MySQL can’t connect to server issues”.

MySQL is a popular open-source RDBMS, short for Relational Database Management System, widely used for web applications and other data-driven projects. It’s part of the LAMP/LEMP stack, and many popular websites and applications use it as a database system for storing data. However, users occasionally encounter issues where they can’t connect to the MySQL server, which can disrupt normally functioning applications. In this guide on how to fix MySQL can’t connect to server issues, we will explore common reasons for this problem and provide step-by-step solutions to help you resolve MySQL connection issues.

Check MySQL Server Status

Before diving into more complex troubleshooting, start by checking the status of your MySQL server. Ensure that the MySQL service is running and that there are no critical errors or warnings in the server logs. You can use the following command to check the MySQL service status:

# systemctl status mysql

You will receive similar output If the service is not running:

# systemctl status mysql
○ mariadb.service - MariaDB 10.6.12 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor prese>
     Active: inactive (dead) since Fri 2024-01-12 23:41:21 UTC; 1s ago

Start the MySQL service using:

# systemctl start mysql

Verify MySQL Port and Network Configuration

The Default MySQL port for connections is 3306. Ensure that the MySQL server is configured to listen on the correct port and that there are no firewall or network issues preventing connections. Check the MySQL configuration file (usually located at /etc/mysql/my.cnf or /etc/my.cnf) for the following lines:

bind-address = 127.0.0.1
port = 3306

Ensure that the bind-address allows connections from the necessary IP addresses or is set to 0.0.0.0 to allow connections from any IP address. To check connectivity to the MySQL server on port 3306 you can also use the netcat command. You can do that by running the command:

nc -zv 192.168.2.20 3306

Instead of 192.168.2.20, you should use the IP address of the MySQL server. If the connection is successful, you should get similar output:

Connection to 192.168.2.20 3306 port [tcp/mysql] succeeded!

If the connection fails, you will see an output like this:

nc: connect to 192.168.2.20 port 3306 (tcp) failed: Connection refused

Then, you should log in to the MySQL server and check which port is MySQL listening on.

MySQL User Privileges

Incorrect user privileges may prevent successful connections to the MySQL server. Verify that the user attempting to connect has the necessary privileges. You can use the following MySQL command to grant privileges:

GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost' IDENTIFIED BY 'password';

Replace database_name, username, and password with your actual database name, username, and password. Then you can run the command:

FLUSH PRIVILEGES;

Then simply exit the MySQL shell and if the problem was with the MySQL user privileges you should be able to connect now.

Check for Network Issues

Network issues can often be a cause of connection problems. Ensure there are no network interruptions, and the server is accessible from the client machine. Ping the server to check for connectivity:

ping your_mysql_server_ip

If there are issues, check the network configuration, firewall settings, and any security groups or access control lists (ACLs) that may be blocking connections.

Examine MySQL Error Logs

MySQL logs provide valuable information about errors and warnings. Examine the MySQL error logs to identify any issues causing the connection problem. The error logs are typically located in the /var/log/mysql directory (check your MySQL configuration for the exact location) and are named error.log. You can find more information here that might help you identify the issue.

Resolving MySQL connection issues involves systematically identifying and addressing potential problems. By checking your server status, verifying port and network configurations, confirming user privileges, investigating network issues, and examining error logs, you can troubleshoot and fix MySQL can’t connect to server problems effectively. If you cannot solve this issue, you can always contact our Support Team, which will help you solve the problem without worrying too much about making the right changes.

The post How to Fix MySQL Can’t Connect to Server Issues appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/fix-mysql-cant-connect-to-server-issues/feed/ 0
How to install Collabtive 3.1 on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-collabtive-3-1-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-collabtive-3-1-on-ubuntu-16-04/#comments Wed, 10 Jan 2018 08:25:39 +0000 https://linuxhostsupport.com/blog/?p=340 In this tutorial, we will show how to install Collabtive 3.1 on Ubuntu 16.04. Collabtive is an open source web-based project management software written in PHP, that let you keep track of your projects. The main features of Collabtive are: task lists, milestones, time tracking, messaging / instant messaging, file management, role-based user permissions, reporting, […]

The post How to install Collabtive 3.1 on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show how to install Collabtive 3.1 on Ubuntu 16.04. Collabtive is an open source web-based project management software written in PHP, that let you keep track of your projects. The main features of Collabtive are: task lists, milestones, time tracking, messaging / instant messaging, file management, role-based user permissions, reporting, exporting, calendaring and multilingual interface. This tutorial was tested and written for Ubuntu 16.04, but it should work on any Linux distribution. The entire process of installing Collabtive 3.1 on Ubuntu 16.04, should not take more than 10 minutes.

1. Install Apache, PHP and MySQL

This install guide assumes that Apache, PHP and MySQL are already installed and configured on your Collabtive virtual server. At the time of writing this tutorial, the latest stable version of Collabtive 3.1 and it requires:

  • PHP 5.5 or PHP 7 with the mbstring and mysql (or sqlite) PHP extensions enabled.
  • Apache Web Server >= 2.0 compiled with mod_rewrite module and with the following directives allowed: DirectoryIndex, Deny, Allow, Options, Order, AddHandler, RewriteEngine, RewriteBase, RewriteCond and RewriteRule.
  • MySQL, MariaDB or SQLite installed on your server.

2. Install Collabtive

Download the latest version of Collabtive , then extract it using the following commands:

cd /opt
wget https://sourceforge.net/projects/collabtive/files/latest/download -O collabtive.zip
unzip collabtive.zip -d /var/www/html/collabtive/

3. Set up file ownership

The web server user (www-data) needs to be able to write to ‘config.php’ file, ‘files’ and ‘templates_c’ directories. It can easily be accomplished by executing the following commands:

sudo chown www-data:www-data -R /var/www/html/collabtive/
sudo chmod +w  /var/www/html/collabtive/config/standard/config.php
sudo chmod +w  /var/www/html/collabtive/files
sudo chmod +w  /var/www/html/collabtive/templates_c

4. Create virtual host

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

touch /etc/apache2/sites-available/collabtive.conf

5. Create a symbolic link

ln -s /etc/apache2/sites-available/collabtive.conf /etc/apache2/sites-enabled/collabtive.conf

Or, use the a2ensite to enable the ‘collabtive.conf’ configuration in Apache:

sudo a2ensite collabtive.conf

6. Configure collabtive.conf file

Edit the ‘collabtive.conf’ Apache configuration file:

vi /etc/apache2/sites-available/collabtive.conf

add the following lines:

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

7. Restart Apache web server

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

service apache2 restart

8. Create new database and assign user with permissions

Create a new MySQL database for Collabtive to use and assign a user to it with full permissions:

mysql -u root -p
mysql> CREATE DATABASE collabtivedb;
mysql> GRANT ALL PRIVILEGES ON collabtivedb.* TO 'collabtiveuser'@'localhost' IDENTIFIED BY 'your-password' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> quit

9. Continue with the installation via web installer

Open your favorite web browser and navigate to http://your-domain.com/install.php page. Once you do that, you will be taken to the first page of the Collabtive web installer. Choose the installer language, check if all of the system requirements are met, select MySQL as database driver, set MySQL database host, database name, database username and database password, then click to pursue the installation. On the next page, create an administrator user and set its password.

For security reason, it is recommended to delete ‘install.php’ and ‘update.php’ files from the server:

rm /var/www/html/collabtive/install.php
rm /var/www/html/collabtive/update.php

That is it. The Collabtive installation is now complete.

Log in to the Administrator back-end area at http://your-domain.com to configure Collabtive according to your needs, extend the functionality of your installation with plugins etc.

installing Collabtive 3.1 on Ubuntu 16.04

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

]]>
https://linuxhostsupport.com/blog/how-to-install-collabtive-3-1-on-ubuntu-16-04/feed/ 5
How To Set Up SSH Keys https://linuxhostsupport.com/blog/how-to-set-up-ssh-keys/ https://linuxhostsupport.com/blog/how-to-set-up-ssh-keys/#respond Wed, 06 Dec 2017 12:30:27 +0000 https://linuxhostsupport.com/blog/?p=290 In this tutorial, we will show you how to login to your Linux VPS using SSH keys. We will generate a key pair (private and public key), place the private key on your server and then use your locally stored private key to gain access to your server. This method provides a more secure way […]

The post How To Set Up SSH Keys appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to login to your Linux VPS using SSH keys. We will generate a key pair (private and public key), place the private key on your server and then use your locally stored private key to gain access to your server. This method provides a more secure way of connecting to your server, instead of just using a password. To set up SSH keys, carefully follow the steps below carefully.

We will split this guide into two sections and explain how to generate an SSH key pair on both Linux and Windows operating system.

1. Generating SSH keys on Linux

In this section, we will go through how to generate an SSH key pair on a Linux or any other Unix-like operating system.

To generate the SSH keys, simply run the following command from your local computer:

ssh-keygen

You can just press Enter to leave the default values of all the questions. Optionally, you can also set a passphrase for your key, or just press Enter again if you don’t want to.

Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:BKK3yDVgXXIs3mdeb/XjJtVtLlbdM8AFnaMPdvqcTNg root@localhost
The key's randomart image is:
+---[RSA 2048]----+
| o.oo+       .o .|
| . oo+..       = |
|  ..+o .    . o .|
| . +.o..o .  *.. |
|  o .  +S. ...O.=|
|        .   oo EO|
|           .  B+=|
|             .oB.|
|             .o. |
+----[SHA256]-----+

This will create a 2048 bit private and public key (id_rsa and id_rsa.pub) in the /root/.ssh/ directory on your local system.

Next, you will need to upload the generated public key to your remote server.

First,  create a new .ssh directory on the remote server with the following command:

ssh root@remote_server mkdir -p .ssh

Next, you need to copy the public key into the authorized_keys file on the remote server, with the following command:

cat /root/.ssh/id_rsa.pub | ssh root@remote_server 'cat >> /root/.ssh/authorized_keys'

Change the permissions of both the .ssh directory and the public key.

ssh root@remote_server chmod 700 .ssh
ssh root@remote_server chmod 600 .ssh/authorized_keys

Now, login to your server and open the SSH configuration file:

nano /etc/ssh/sshd_config

Make sure the following lines exist and are not commented:

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys

Save the changes and restart the SSH service:

service sshd restart

That’s it. From now on, you will be using the SSH keys every time you try to connect to your remote server.

2. Generating SSH keys on Windows

If you are using the Windows operating system on your local machine, then you will need PuTTY for connecting to your server via SSH and PuTTYgen to generate your SSH keys. You can download the latest versions over here.

To generate the SSH keys, go ahead and start PuTTYgen on your computer.

At the bottom, you can choose the number of bits for your generated key. Type in 4096 and then click on “Generate”. Start moving your mouse around over the blank area in the PuTTYgen screen in order to generate a unique key based on your mouse movement input.

When the green progress bar fills in, the public key will be generated. You can copy they key and save it inside a .txt file on your computer.

To save the private key, you will need to click on the “Save private key” button. Additionally you can also set a “Key Passphrase” for your private key that you will need to use everytime you log in to your server using your key.

Now you can open PuTTY and assign the location of your private key. Click on “SSH” under the “Connection” menu and then click on “Auth”. Click on the “Browse” button and enter the location of your saved private key file.

Next, you will need to upload the public key to your server. To do this, click on “Session”, enter your IP address and the SSH port number of your server, select SSH for Connection type and click on “Open”.

You will be asked for your username and password. You can log in as user root, using your root password.

Once logged in to your server as user root, you will first need to create the .ssh directory:

mkdir /root/.ssh

Then create the “authorized_keys” file inside the .ssh directory and add the contents of your public key inside this file:

nano /root/.ssh/authorized_keys

Make sure you save the file. Additionally, run the following commands to update the permissions:

chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys

You can also open the SSH configuration file on your server with:

nano /etc/ssh/sshd_config

and make sure that the following lines exist and are not commented:

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys

If any changes have been made, you will need to restart the SSH service with:

service sshd restart

With this, the SSH keys have been successfully configured. You can now disconnect from your server and exit PuTTY. The next time you try to connect to your server, PuTTY will use the public key that you have set up in order to establish the connection.

 

Of course, you don’t have to set up ssh key by yourself  if you use one of our outsourced server support services, in which case you can simply ask our expert Linux admins to help you set up the SSH keys for your server. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to set up SSH keys, 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 Set Up SSH Keys appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-set-up-ssh-keys/feed/ 0
How to Install Redmine on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-and-configure-redmine-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-and-configure-redmine-on-ubuntu-16-04/#respond Wed, 22 Nov 2017 13:00:43 +0000 https://linuxhostsupport.com/blog/?p=277 We will show you, how to install and configure Redmine on Ubuntu 16.04, with Nginx and MySQL. Redmine is completely free and open source issue tracking, and project management system designed to help teams to achieve their desired project goals. It allows users to configure it according to their needs and suit their business needs. […]

The post How to Install Redmine on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
We will show you, how to install and configure Redmine on Ubuntu 16.04, with Nginx and MySQL. Redmine is completely free and open source issue tracking, and project management system designed to help teams to achieve their desired project goals. It allows users to configure it according to their needs and suit their business needs. Redmine comes with a lot of useful features and plugins that can help you with the project management and all related processes. IInstalling Redmine on Ubuntu 16.04 is an easy task, just follow the steps below carefully.

1. Install dependencies

Login to your Ubuntu VPS via SSH as user root

ssh root@IP_Address -p Port_number

update all packages installed on your VPS to the latest version

apt-get update && apt-get upgrade

Run the following command to install all necessary dependencies

apt-get install python-software-properties curl autoconf subversion bison software-properties-common imagemagick libmagickwand-dev build-essential libssl-dev libreadline-dev libyaml-dev zlib1g-dev git libcurl4-openssl-dev

2. Install MySQL server

Redmin requires an empty MySQL database, so we will install MySQL server

apt-get install mysql-server mysql-client

Once the installation is completed run the mysql_secure_installation post installation script and follow the on-screen instructions to secure the installation and set your MySQL root password.

Next, login to the MySQL server as user root and create a new MySQL user and database

mysql -u root -p

CREATE DATABASE redmin
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'PASSWORD';
FLUSH PRIVILEGES;
\q

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

3. Install Ruby and Ruby Version Manager (RVM)

Install the latest version of Ruby with the following command

gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
curl -L https://get.rvm.io | bash -s stable --ruby=2.4.1

Run the following commands to load RVM

source /usr/local/rvm/scripts/rvm
echo '[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"' >> ~/.bashrc

4. Install and configure Nginx and Phusion Passenger

Passenger is feature-rich web app server that integrates with Apache and Nginx. We will install it and integrate it with Nginx

gem install passenger --no-ri --no-rdoc
passenger-install-nginx-module

You will be prompted to select a language that will be supported, select Ruby. On the next step select the ‘Yes: download, compile and install Nginx for me. (recommended)’ option. The command will compile and install all necessary modules, including Nginx on your server and it may take some time.

Next, open the Nginx configuration file and update the server section as described below:

nano /opt/nginx/conf/nginx.conf

server {
        listen       80;
        server_name  yourdomain.com;

        root /var/www/html/redmine/public;
        passenger_enabled on;
        client_max_body_size      10m; # Max attachment size

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

5. Configure Nginx to start as a service

To configure Nginx to start as a service, create a nginx.service file with the following content

nano /lib/systemd/system/nginx.service

[Unit]
Description=NGINX server
After=syslog.target network.target remote-fs.target nss-lookup.target
 
[Service]
Type=forking
PIDFile=/opt/nginx/logs/nginx.pid
ExecStartPre=/opt/nginx/sbin/nginx -t
ExecStart=/opt/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
 
[Install]
WantedBy=multi-user.target

Reload the systemd services and start Nginx

systemctl daemon-reload
systemctl start nginx

6.Install and configure Redmine

Download the latest version of Redmine (at the moment of writing this article it is version 3.4) using the svn command

cd /var/www/html
svn co http://svn.redmine.org/redmine/branches/3.4-stable redmine

Change the current working directory and the example configuration files

cd redmine
cp config/configuration.yml.example config/configuration.yml
cp config/database.yml.example config/database.yml

Make the following changes to the database.yml file

nano config/database.yml

production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: PASSWORD
  encoding: utf8

Install the Ruby dependencies and migrate the database

gem install bundler --no-ri --no-rdoc
bundle install
bundle exec rake db:migrate
bundle exec rake redmine:plugins

Generate the secret token using the following command

bundle exec rake generate_secret_token

7. Restart the webserver

Restart the web server for the changes to take effect

systemctl restart nginx

That’s all. If you closely followed the steps in this tutorial, you should be able to access Redmine on your Ubuntu 16.04 server  at http://yourdomain.com using the default credentials (admin/admin).

For more information on how to configure and use Redmine, pleae check their official guide.


Of course, you don’t have to install Redmine on Ubuntu 16.04, if you use one of our Linux Server Support Services, in which case you can simply ask our expert Linux admins to install Redmine on Ubuntu 16.04 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 Redmine on Ubuntu 16.04, 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 Redmine on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-and-configure-redmine-on-ubuntu-16-04/feed/ 0
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
How to Upgrade MariaDB on Centos 7 https://linuxhostsupport.com/blog/how-to-upgrade-mariadb-on-centos-7/ https://linuxhostsupport.com/blog/how-to-upgrade-mariadb-on-centos-7/#comments Wed, 18 Oct 2017 13:05:56 +0000 https://linuxhostsupport.com/blog/?p=244 In this tutorial we are going to provide you with step-by-step instructions on how to upgrade MariaDB on a CentOS 7 VPS. MariaDB is an open source, community-developed fork of the MySQL relational database management system. MariaDB is highly compatible with MySQL, ensuring exact matching with MySQL commands and APIs. The upgrade process should take […]

The post How to Upgrade MariaDB on Centos 7 appeared first on LinuxHostSupport.

]]>
In this tutorial we are going to provide you with step-by-step instructions on how to upgrade MariaDB on a CentOS 7 VPS. MariaDB is an open source, community-developed fork of the MySQL relational database management system. MariaDB is highly compatible with MySQL, ensuring exact matching with MySQL commands and APIs.

The upgrade process should take about 10 minutes if you follow the easy steps described below.

In order to check the current MariaDB version installed on your server, run the following command:

mysql -V
mysql  Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1

Upgrade MariaDB from 5.5.x version to 10.2.x version

Before starting with the upgrade procedure, create a backup of your MariaDB databases:

mysqldump -uroot -p --all-databases > /opt/database-dump.sql

Stop the MariaDB service with the following command:

systemctl stop mariadb

Remove MariaDB 5.5.x packages:

yum remove mariadb mariadb-server mariadb-libs
Removing:
 mariadb                                                x86_64                                         1:5.5.56-2.el7                                          @base                                          49 M
 mariadb-libs                                           x86_64                                         1:5.5.56-2.el7                                          @base                                         4.4 M
 mariadb-server                                         x86_64                                         1:5.5.56-2.el7                                          @base                                          58 M
Removing for dependencies:
 net-snmp                                               x86_64                                         1:5.7.2-28.el7                                          @base                                         850 k
 perl-DBD-MySQL                                         x86_64                                         4.023-5.el7                                             @base                                         323 k
 php-mysql                                              x86_64                                         5.4.16-42.el7                                           @base                                         232 k
 postfix                                                x86_64                                         2:2.10.1-6.el7                                          @base                                          12 M

Transaction Summary
===================================================================================================================================================================================================================
Remove  3 Packages (+4 Dependent packages)

Installed size: 125 M
Is this ok [y/N]: y

...

Removed:
  mariadb.x86_64 1:5.5.56-2.el7                                     mariadb-libs.x86_64 1:5.5.56-2.el7                                     mariadb-server.x86_64 1:5.5.56-2.el7

Dependency Removed:
  net-snmp.x86_64 1:5.7.2-28.el7                     perl-DBD-MySQL.x86_64 0:4.023-5.el7                     php-mysql.x86_64 0:5.4.16-42.el7                     postfix.x86_64 2:2.10.1-6.el7

Complete!

Add a new MariaDB repository:

vi /etc/yum.repos.d/mariadb.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Clean the repository cache on your server with:

yum clean all

Install MariaDB 10.2

Install MariaDB 10.2.x version using the following command:

yum install MariaDB-client MariaDB-server
Installing:
 MariaDB-server                                           x86_64                                    10.2.9-1.el7.centos                                           mariadb                                    108 M
Installing for dependencies:
 MariaDB-client                                           x86_64                                    10.2.9-1.el7.centos                                           mariadb                                     48 M
 MariaDB-common                                           x86_64                                    10.2.9-1.el7.centos                                           mariadb                                    155 k
 MariaDB-compat                                           x86_64                                    10.2.9-1.el7.centos                                           mariadb                                    2.8 M
 boost-program-options                                    x86_64                                    1.53.0-27.el7                                                 base                                       156 k
 galera                                                   x86_64                                    25.3.20-1.rhel7.el7.centos                                    mariadb                                    8.0 M

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package (+5 Dependent packages)

Total download size: 167 M
Installed size: 708 M
Is this ok [y/d/N]: y

...

Installed:
  MariaDB-server.x86_64 0:10.2.9-1.el7.centos

Dependency Installed:
  MariaDB-client.x86_64 0:10.2.9-1.el7.centos         MariaDB-common.x86_64 0:10.2.9-1.el7.centos         MariaDB-compat.x86_64 0:10.2.9-1.el7.centos         boost-program-options.x86_64 0:1.53.0-27.el7
  galera.x86_64 0:25.3.20-1.rhel7.el7.centos

Complete!

Please note, you need to install Postfix and php-mysql packages if you used them prior this upgrade, so run:

yum install postfix php-mysql

Enable MariaDB service to automatically start on server boot:

systemctl enable mariadb

Start the MariaDB service:

systemctl start mariadb

Run the mysql_upgrade command-line command to examine all tables in all MariaDB databases for incompatibilities with the currently installed version of the MariaDB server:

mysql_upgrade

If everything is OK, check the currently installed MariaDB version with:

mysql -V

mysql  Ver 15.1 Distrib 10.2.9-MariaDB, for Linux (x86_64) using readline 5.1

Set the MariaDB root user password and secure MariaDB

There is no MariaDB root user password set by default. Use the following command to set a new MariaDB root user password, remove the anonymous users, secure MariaDB by restricting the remote login for root user and remove the test database.

mysql_secure_installation

That is it. MariaDB has been successfully installed on your server.

If you use one of our Linux Host Support  services, you  can simply ask our expert Linux admins to upgrade MariaDB 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 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 Upgrade MariaDB on Centos 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-upgrade-mariadb-on-centos-7/feed/ 4