Linux host support | 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 fix “405 error” https://linuxhostsupport.com/blog/how-to-fix-405-error/ https://linuxhostsupport.com/blog/how-to-fix-405-error/#respond Sat, 15 Jun 2024 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=2101 In this tutorial, we will explain more about the 405 website error and how to fix it. A 405 error is an HTTP not allowed error that prevents visitors from accessing the content of your website. The result of this error is a blank page and can be caused due to several reasons. If not […]

The post How to fix “405 error” appeared first on LinuxHostSupport.

]]>
In this tutorial, we will explain more about the 405 website error and how to fix it.

A 405 error is an HTTP not allowed error that prevents visitors from accessing the content of your website. The result of this error is a blank page and can be caused due to several reasons. If not resolved on time this can cause visitors to leave. Inevitably this damages your website reputation which may lead to a loss of sales.

In the next paragraphs, we will explain the reasons and possible solutions for fixing this error.

The 405 Not Allowed error can be tricky to identify quickly. Typically there’s only a blank page with the message at the top. We need to go through some checks which may take ten minutes to get our website up and running again.

Wrong URL

It’s easy to enter a long URL incorrectly which may lead to a 405 Not Allowed error. Try accessing the website homepage first. See if it is accessible and if so try to access the specific page you need. Checking the URL is so simple that sometimes we forget to do it, but it can solve our issue immediately.

Database Changes

If you use CMS websites with plugins such as WordPress, Drupal, or Joomla plugin updates can change your database. Before updating, it is necessary to have a database dump. In most cases, the database tables are changed by some plugins with full access to our database. Even if you uninstall the plugins, the database changes would not be reverted. One possible solution would be for the developer to modify them manually. It is recommended to have a database backup before doing anything to prevent such a scenario.

Web server configuration

If are using Apache as a web server, check the configuration of .htaaccess. We should consider the rewriting rules, limited directives, and who can access the website. If you are using Nginx, the configuration is in the Nginx virtual host file. You should check the Nginx location blocks, and the error page directives. This way you can make the changes, restart the web services, and see if that will fix the issue.

Files and Folder permissions

Uploading files in your website’s root directory with the root user can cause it to be inaccessible due to permissions. Always upload files and folders with the user who is the owner of the website’s root directory. However, if there are incorrect files and folder permissions we can fix them with the following commands:

chown www-data:www-data  -R .         # If the Apache or Nginx are owners
find . -type d -exec chmod 755 {} \;  # Directory Permissions
find . -type f -exec chmod 644 {} \;  # Files Permissions

Check the Code

You have to check if there are any hard-coded lines in your code. In addition, you should check your submitting forms, the GET, and the POST requests. Finally, check if some of the libraries in the website framework are using inconsistent methods rejected by the server. The developer should enable the debug mode and perform unit tests to find the issue.

Rollback any Updates

If your website was accessible before any plugin updates, the 405 Not Allowed method may be caused by the update. You should roll back the plugin update and see if that will fix the issue. If the issue is due to changed code, simply revert the lines of the changes and restart your web service.

Restore the whole Website

Finally, you can restore the website from our daily, weekly, or the whole backup made before any minor changes. This way we are sure that we will not lose time for debugging, and will fix the issue immediately. If your hosting provider offers managed services, contact their support to restore the website from a backup. If you have a bare-metal unmanaged server, you can always contact our technical support. We will help you with any aspect of your website. We are available 24/7.

These were some basic steps to solve the 405 Not Allowed error. If you liked this post on how to fix the 405 error, please share it with your friends. You can also leave a comment below.

The post How to fix “405 error” appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-fix-405-error/feed/ 0
5 most Used dig Commands in Linux With Examples  https://linuxhostsupport.com/blog/5-most-used-dig-commands-in-linux-with-examples/ https://linuxhostsupport.com/blog/5-most-used-dig-commands-in-linux-with-examples/#respond Wed, 15 Feb 2023 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1761 The DIG command offers a vast amount of functionalities and different options. In this guide, we’ll learn more about some of the most important functionalities for DNS troubleshooting. What is the DIG command? DIG command (Domain Information Groper command) is a tool with a basic command-line interface that serves for making different DNS (domain name […]

The post 5 most Used dig Commands in Linux With Examples  appeared first on LinuxHostSupport.

]]>
The DIG command offers a vast amount of functionalities and different options. In this guide, we’ll learn more about some of the most important functionalities for DNS troubleshooting.

What is the DIG command?

DIG command (Domain Information Groper command) is a tool with a basic command-line interface that serves for making different DNS (domain name system) queries. You can use the DIG command to:

– Check all of the available DNS records or individual DNS records
– Diagnose the name servers of your domain.
– Trace IP addresses.
– See the hostnames that correspond to an IP address.

And many other aspects that you can read directly on their manual. You can find the DIG command pre-installed on most Linux distros. Also, you can easily install it on macOS, too with brew, and get the DIG command on Windows 10 with bind9.

Top 5 most used DIG commands:

Here you have five examples of DIG command. We will use rosehostingtest.com as a hostname and 1.1.1.1. as an IP address. Feel free to try these commands with the domain and IP address you want by simply changing the text before you try.

Once you are on your terminal, we can proceed with the following commands:

1. Finding the website IP address

To do that function, everything you need to do is simply use the dig command with the domain name after it, for example:

dig rosehostingtest.com

This will return you the A record of your hostname but with a lot of details together, here is an example:

➜  ~ dig rosehostingtest.com

; <<>> DiG 9.10.6 <<>> rosehostingtest.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40154
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;rosehostingtest.com. IN A

;; ANSWER SECTION:
rosehostingtest.com. 300 IN A 104.21.51.178
rosehostingtest.com. 300 IN A 172.67.183.57

;; Query time: 53 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Dec 20 12:23:50 -03 2022
;; MSG SIZE  rcvd: 80

If you want an answer with fewer details, you can add +short to your command, no matter if it’s before or after the hostname, you can use it together with your domain and it will return only the IP address:

➜  ~ dig rosehostingtest.com +short
104.21.51.178

From now on, in this guide, we’ll use the +short option so it’s less information making it more friendly to be readen.

2. Getting the NameServers from the domain.

For that usage, instead of only using the dig command, we had to add the option NS to our command. So, to get the nameservers of your domain name, you can use the following command:

➜  ~ dig rosehostingtest.com NS +short
aragorn.ns.cloudflare.com.
coco.ns.cloudflare.com.

Here you can see to which DNS the domain you are checking is pointing to.

3. Check the path of your DNS.

This option will show you the path from the root servers to the DNS zone of the hostname that you are querying. To use the trace option, you should run:

➜  ~ dig rosehostingtest.com +trace +short
NS h.root-servers.net. from server 8.8.8.8 in 44 ms.
NS b.root-servers.net. from server 8.8.8.8 in 44 ms.
NS k.root-servers.net. from server 8.8.8.8 in 44 ms.
NS m.root-servers.net. from server 8.8.8.8 in 44 ms.
NS c.root-servers.net. from server 8.8.8.8 in 44 ms.
NS a.root-servers.net. from server 8.8.8.8 in 44 ms.
NS f.root-servers.net. from server 8.8.8.8 in 44 ms.
NS j.root-servers.net. from server 8.8.8.8 in 44 ms.
NS d.root-servers.net. from server 8.8.8.8 in 44 ms.
NS i.root-servers.net. from server 8.8.8.8 in 44 ms.
NS g.root-servers.net. from server 8.8.8.8 in 44 ms.
NS e.root-servers.net. from server 8.8.8.8 in 44 ms.
NS l.root-servers.net. from server 8.8.8.8 in 44 ms.
RRSIG NS 8 0 518400 20230102050000 20221220040000 18733 . Ban8EH/5IIhAO5yzTrFjKFL/ZblByKCk1ln3kXGqwwusnoBTY6fpXY/4 bQztpIpYGEE0O0Nh6afh6O2Uk/BtFvZf1YT6t1xRFZOJJ2fQGntqnvYt VX0HLYwrGmWZiaTcRWVWezLDJ/xQrxab1FGH/09qn9UQjfkswN372vb3 feGu2vbti9I63rzKTl2wJFn95jwkTRwkgrXUfP10znzJpCj3B8ZCPtN+ cvwWWrUFu1Yj5DuOS3c0SRDrcF4YFkRQTc3Fy/kMlqAvbuDuKKmGuo+f E0+oBXFWroFPLf7wB6dbHOGxoppNokqjDN1VyAHQx0uMWnfRksMpq3RC 8u3GIw== from server 8.8.8.8 in 44 ms.
A 104.21.51.178 from server 2a06:98c1:50::ac40:2143 in 37 ms.
A 172.67.183.57 from server 2a06:98c1:50::ac40:2143 in 37 ms.
RRSIG A 13 2 300 20221221162911 20221219142911 34505 rosehostingtest.com. Nn6Pr3DT0JjfqH2yV1HlMPMIbfsFYr4Voyvb5kR6aV70cTGdrItRmi6E cIKc6eDoPWJUdoIpIuDUuDwj3wcpyA== from server 2a06:98c1:50::ac40:2143 in 37 ms.

The output will show you the route of your DNS query goes. You can check if the connection is hoping somewhere to troubleshoot your DNS problems, so you can get exactly when it’s lost.

4. Checking the entries responsible for mails.

All emails to be received by the recipient, requires the domain to have their MX records properly setup, you can check yours by using the following command:

➜  ~ dig rosehostingtest.com MX +short
31 route2.mx.cloudflare.net.
42 route1.mx.cloudflare.net.
66 route3.mx.cloudflare.net.

So in our example case, the email from the test domain is handled by Cloudflare, and any email issues or problems need to be checked directly with them.

5. Check the RDNS of an IP address.

You can easily get a reverse DNS from one ip address (this means the hostname that is associated with the ip address basically) using this dig command:

➜  ~ dig -x 1.1.1.1 +short
one.one.one.one

The hostname of the queried IP address will be available on the output.

Those are the most useful commands from the dig, but you can use more options that are available in their own manual. You can run:

man dig

dig -h

This will show ALL The options available so you can do different queries. Of course, if you have an active server and need assistance in troubleshooting your DNS servers, do not hesitate to contact us. We are available 24/7/365 to help you.

The post 5 most Used dig Commands in Linux With Examples  appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/5-most-used-dig-commands-in-linux-with-examples/feed/ 0
10 Useful cron Commands in Linux With Examples https://linuxhostsupport.com/blog/10-useful-cron-commands-in-linux-with-examples/ https://linuxhostsupport.com/blog/10-useful-cron-commands-in-linux-with-examples/#respond Tue, 15 Nov 2022 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1730 In this tutorial, we will explain ten useful cron commands in Linux with examples. The cron command is used for scheduling tasks to be executed in a specific period, like a month, day, hour, minute, or even seconds. The cron uses a table of tabs called crontabs which have a list of commands that need […]

The post 10 Useful cron Commands in Linux With Examples appeared first on LinuxHostSupport.

]]>
In this tutorial, we will explain ten useful cron commands in Linux with examples.

The cron command is used for scheduling tasks to be executed in a specific period, like a month, day, hour, minute, or even seconds. The cron uses a table of tabs called crontabs which have a list of commands that need to be executed with their times respectively. These cron commands are used by system administrators mostly, to make their work easier and be sure not to forget to execute something during a specific period of their work.

In this tutorial, we are going to use Ubuntu 20.04, but you can choose any Linux distro you want. Let’s get started!

Prerequisites

  • Fresh install of Ubuntu 20.04 OS
  • User privileges: root or non-root user with sudo privileges

Update the System

Before we start with the ten useful cron commands, we need to update the system packages to the latest versions available.

sudo apt update -y && sudo apt upgrade -y

Once the system is updated, we are ready to show you the basic cron commands in Linux.

1. Manage crond service

To check the status of the crond service, execute the following command:

systemctl status cron.service

You should receive the following output:

root@host:~# systemctl status cron.service
● cron.service - Regular background program processing daemon
     Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-08-08 23:57:40 CEST; 1 weeks 3 days ago
       Docs: man:cron(8)
   Main PID: 583 (cron)
      Tasks: 1 (limit: 4611)
     Memory: 11.7M
     CGroup: /system.slice/cron.service
             └─583 /usr/sbin/cron -f

For starting, stopping, and restarting the cron service, you can use the following commands respectively:

systemctl start cron.service

systemctl stop cron.service

systemctl restart cron.service

2. List the jobs

To list the jobs for the current user, execute the following command:

crontab -l

The output should look similar to this because we do not have cron jobs set yet:

root@host:/var/www/html# crontab -l
no crontab for root

3. Create your first cron job

To create your first cron job execute the following command:

crontab -e

After executing this command, the file will be opened, and you can paste the following lines of code:

1 0 * * *   root cd /var/www/html && /usr/bin/sh script.sh

Save the file and close it. If you execute the command crontab -l, you will get this:

root@host:/var/www/html# crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
1 0 * * *   cd /var/www/html && /usr/bin/sh script.sh

4. Schedule a job every 10 minutes

To schedule a job to run every 10 minutes, add the following lines with the crontab -e command:

*/10 * * * * root cd /var/www/html && /usr/bin/sh script.sh

This cron will call the script every 10 minutes.

5. Schedule a job every hour

To schedule a cron job to run every hour, add the following lines with the crontab -e command:

0 * * * * root cd /var/www/html && /usr/bin/sh script.sh

6. Schedule a job every day at 10:00 AM

Now, we will show you a different way to schedule a cron job. Open the file /etc/crontab. You should see the following lines of code:

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

Now to add the cron job to execute every day at 10:00 AM, just add the following line at the bottom of the file, save it and close it.

0 0 * * * root cd /var/www/html && /usr/bin/sh script.sh

7. Schedule a job At 12:00 AM, only on Friday

To schedule this job, open the /etc/crontab file and paste the following command:

0 0 * * FRI root cd /var/www/html && /usr/bin/sh script.sh

8. Schedule a job for a daily backup

To schedule a daily backup, for example, with some script that will execute commands to generate a daily backup, you do not have to specify intervals. You just need to place the script to the /etc/cron.daily directory on your server:

9. Understanding the cron directories

In the previous example, we explained how to enable daily backup by putting some script into it. What if we want our script to be executed hourly, weekly, or monthly? Do not worry about that. Just execute ls -al /etc/cron and hit tab in your terminal server:

root@host:/var/www/html# ll /etc/cron
cron.d/       cron.daily/   cron.hourly/  cron.monthly/ crontab       cron.weekly/

As you can see, there are directories for different periods where you can place your scripts, which will be executed automatically.

10. Man command for cron

If you want to learn more about the cron, you must execute man cron in your terminal. You should receive complete documentation about the cron command:

CRON(8)                                                               System Manager's Manual                                                               CRON(8)

NAME
       cron - daemon to execute scheduled commands (Vixie Cron)

SYNOPSIS
       cron [-f] [-l] [-L loglevel]

DESCRIPTION
       cron is started automatically from /etc/init.d on entering multi-user runlevels.

OPTIONS
       -f      Stay in foreground mode, don't daemonize.

       -l      Enable  LSB  compliant  names  for  /etc/cron.d  files.   This  setting,  however,  does  not  affect  the  parsing of files under /etc/cron.hourly,
               /etc/cron.daily, /etc/cron.weekly or /etc/cron.monthly.

       -n      Include the FQDN in the subject when sending mails.  By default, cron will abbreviate the hostname.

       -L loglevel
               Tell cron what to log about jobs (errors are logged regardless of this value) as the sum of the following values:

That’s it. You just learned how to set up cron jobs on your own in different ways. If you find this difficult and you want some specific cron at a specific time, just contact our technical support, and they will do the rest. We are available 24/7.

If you liked this post about ten useful cron commands in Linux with examples, please share it with your friends on social networks or simply leave a reply below.

The post 10 Useful cron Commands in Linux With Examples appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/10-useful-cron-commands-in-linux-with-examples/feed/ 0
5 Most Used Touch Commands in Linux With Examples https://linuxhostsupport.com/blog/5-most-used-touch-commands-in-linux-with-examples/ https://linuxhostsupport.com/blog/5-most-used-touch-commands-in-linux-with-examples/#comments Sat, 15 Oct 2022 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1720 In this tutorial, we are going to show you the most used touch commands in Linux with examples. The touch command is a standard command in Linux operating system used on daily basis by the system administrators, developers, and other users familiar with the Linux command line. With the touch command, we can easily create […]

The post 5 Most Used Touch Commands in Linux With Examples appeared first on LinuxHostSupport.

]]>
In this tutorial, we are going to show you the most used touch commands in Linux with examples.

The touch command is a standard command in Linux operating system used on daily basis by the system administrators, developers, and other users familiar with the Linux command line. With the touch command, we can easily create files, empty files, modify files, timestamps and etc.

In this tutorial, we will execute the touch commands on Ubuntu 20.04 OS, but you can choose any Linux distro. Le’ts get started!

Prerequisites

  • A server with Ubuntu 20.04 OS
  • User privileges: root or non-root user with sudo privileges

Update the System

If you have a fresh installation of Ubuntu 20.04, it is recommended to update the system packages to the latest versions available.

sudo apt update -y && sudo apt upgrade -y

Once the system is updated, we are ready to show you the basic touch commands in Linux.

1. Create a File

To create an empty zero byte file, execute the following command:

touch file.txt

You can check the size of the file:

-rw-r--r--  1 root root 0 Aug 14 22:58 file.txt

2. Change only the access time

To change only the access time to the file, you need to execute the following command:

touch -a file.txt

This command will update the last access modification time and will create the file if it does not exists.

3. Use the timestamp of another file

Sometimes we need to set the same timestamp to a file from another file. To do that, execute the following command:

touch -r file1.txt file2.txt

This command will update the timestamp of file2.txt with the timestamp of file file1.txt.

4. Create a file with a specific timestamp

To create a file and specify the time, you need to execute the following command:

touch -t 202208181118.34 file-time

The command above will create the file-time with a timestamp on August 18, 2022, at 11:18:34 AM.

5. Creating Multiple files

In the above examples, we were creating only a single file. Sometimes we need multiple files to be created. To do that, we can simply use the touch command with multiple file names:

touch file1.txt file2.txt file3.txt

This command will create three files at once:

-rw-r--r--  1 root root    0 Aug 15 11:51 file1.txt
-rw-r--r--  1 root root    0 Aug 15 11:51 file2.txt
-rw-r--r--  1 root root    0 Aug 15 11:51 file3.txt

Learn more about the touch command

In the previous paragraphs, we covered the most used touch commands. There is a brief explanation of the touch command along with options in Linux. To learn more about the touch command, execute the man touch command in your terminal.

man touch

You should get the following output:

TOUCH(1)                                                                   User Commands                                                                   TOUCH(1)

NAME
       touch - change file timestamps

SYNOPSIS
       touch [OPTION]... FILE...

DESCRIPTION
       Update the access and modification times of each FILE to the current time.

       A FILE argument that does not exist is created empty, unless -c or -h is supplied.

       A FILE argument string of - is handled specially and causes touch to change the times of the file associated with standard output.

       Mandatory arguments to long options are mandatory for short options too.

       -a     change only the access time

       -c, --no-create
              do not create any files

       -d, --date=STRING
              parse STRING and use it instead of current time

       -f     (ignored)

       -h, --no-dereference
              affect each symbolic link instead of any referenced file (useful only on systems that can change the timestamps of a symlink)

       -m     change only the modification time

       -r, --reference=FILE
              use this file's times instead of current time

       -t STAMP
              use [[CC]YY]MMDDhhmm[.ss] instead of current time

       --time=WORD
              change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m

       --help display this help and exit

Congratulations! You learned the basic touch commands with examples applicable to every Linux distribution.

You learned how to create one file or multiple files with specific timestamps. If you find it challenging to understand the touch command and you are not able to manage the files on your server, you can simply contact our epic technical support, and they will do the rest. You only need to sign up for one of our NVMe VPS plans and submit a support ticket. We are available 24/7.

If you liked this post about the five most used touch commands in Linux, please share it with your friends on social networks or simply leave a reply below. Thanks.

The post 5 Most Used Touch Commands in Linux With Examples appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/5-most-used-touch-commands-in-linux-with-examples/feed/ 1
How to Check MySQL Database Size https://linuxhostsupport.com/blog/mysql-database-size/ https://linuxhostsupport.com/blog/mysql-database-size/#respond Wed, 24 Jan 2018 08:17:14 +0000 https://linuxhostsupport.com/blog/?p=368 MySQL is the most popular open-source database in the world, powering small blogs, high-volume websites, business applications and more. MySQL is used by some of the world’s most popular websites such as Facebook, Twitter, Youtube, Wikipedia ..etc. In this blog post, we will show you how to check the size of the MySQL databases and tables […]

The post How to Check MySQL Database Size appeared first on LinuxHostSupport.

]]>
MySQL is the most popular open-source database in the world, powering small blogs, high-volume websites, business applications and more. MySQL is used by some of the world’s most popular websites such as Facebook, Twitter, Youtube, Wikipedia ..etc. In this blog post, we will show you how to check the size of the MySQL databases and tables trough the MySQL shell. This post is written for MySQL but the exact same commands are also applicable for MariaDB.

Check the size of all MySQL databases

To check the size of MySQL databases and tables we can use the virtual database called information_schema which provides access to database metadata, including the size of the databases and tables.

Enter the MySQL shell as user root by executing the following command:


mysql -u root -p

To print the size of all your databases run the following command:


SELECT 
    table_schema "Database Name",
    ROUND(SUM( data_length + index_length ) / 1024 / 1024, 2) AS "Database Size in MB"
FROM 
    information_schema.TABLES
GROUP BY table_schema ; 

The output should be similar to the following:


+-----------------------+---------------------+
| Database Name         | Database Size in MB |
+-----------------------+---------------------+
| admin_110             |              251.28 |
| admin_120             |               18.99 |
| admin_25              |               11.86 |
| admin_562             |               28.45 |
| admin_877             |                4.20 |
| information_schema    |                0.14 |
| mysql                 |                0.69 |
| performance_schema    |                0.00 |
| user_174              |               23.72 |
| user_379              |                0.26 |
| user_604              |                0.64 |
| user_625              |                1.22 |
| user_820              |                0.73 |
| user_854              |                2.25 |
| user_901              |                1.10 |
| user_961              |                1.60 |
+-----------------------+---------------------+

Check the size of all Tables in a specific MySQL database

To print the size of all tables in a specific MySQL database, same as before we will use the information from the virtual database information_schema:


SELECT 
    table_name as "Table Name",
    ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Table Size in MB"
FROM 
    information_schema.TABLES 
where 
    table_schema = 'admin_562';

The output should be similar to the following:


+-----------------------+------------------+
| Table Name            | Table Size in MB |
+-----------------------+------------------+
| wp_commentmeta        |             0.05 |
| wp_comments           |            12.42 |
| wp_links              |             0.03 |
| wp_options            |             1.98 |
| wp_postmeta           |             0.19 |
| wp_posts              |             1.75 |
| wp_term_relationships |             0.06 |
| wp_term_taxonomy      |             0.05 |
| wp_termmeta           |             0.05 |
| wp_terms              |             0.05 |
| wp_usermeta           |             0.05 |
| wp_users              |             0.06 |
| wp_wfBadLeechers      |             0.02 |
| wp_wfBlockedIPLog     |             0.06 |
| wp_wfBlocks           |             0.03 |
| wp_wfBlocksAdv        |             0.02 |
| wp_wfConfig           |             3.28 |
| wp_wfCrawlers         |             0.02 |
| wp_wfFileMods         |             1.52 |
| wp_wfHits             |             2.20 |
| wp_wfHoover           |             0.03 |
| wp_wfIssues           |             2.52 |
| wp_wfKnownFileList    |             0.20 |
| wp_wfLeechers         |             0.05 |
| wp_wfLockedOut        |             0.02 |
| wp_wfLocs             |             0.02 |
| wp_wfLogins           |             0.08 |
| wp_wfNet404s          |             0.03 |
| wp_wfNotifications    |             0.02 |
| wp_wfPendingIssues    |             0.31 |
| wp_wfReverseCache     |             0.02 |
| wp_wfSNIPCache        |             0.06 |
| wp_wfScanners         |             0.02 |
| wp_wfStatus           |             1.17 |
| wp_wfThrottleLog      |             0.03 |
| wp_wfVulnScanners     |             0.02 |
+-----------------------+------------------+

Check the size of a specific Table in a specific MySQL database

In the last example we will show you how to check the of a specific table size by the database name and the table name, also by querying the virtual database information_schema :


SELECT 
    table_name as "Table Name",
    ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Table Size in MB"
FROM 
    information_schema.TABLES 
where 
   table_schema = 'admin_877' and table_name = 'wp_wfConfig';

The output should be similar to the following:


+-------------+------------------+
| Table Name  | Table Size in MB |
+-------------+------------------+
| wp_wfConfig |             3.28 |
+-------------+------------------+


MySQL Database Size

If you use one of our Outsourced Linux Server Support Services, you can simply ask our expert Linux admins to check the size of your MySQL databases and tables for

 

you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on how to check the size of MySQL databases and tables, 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 Check MySQL Database Size appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/mysql-database-size/feed/ 0
How to Install LiteCart on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-litecart-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-litecart-on-ubuntu-16-04/#respond Wed, 17 Jan 2018 08:49:20 +0000 https://linuxhostsupport.com/blog/?p=353 Today we’ll show you, how to install LiteCart on Ubuntu 16.04. LiteCart is a free and open source e-commerce platform which is developed in PHP, jQuery and HTML 5. In this tutorial, we will show how to install LiteCart on Ubuntu 16.04 VPS and setup a LAMP stack (Linux, Apache, MySQL, PHP) if you already […]

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

]]>
Today we’ll show you, how to install LiteCart on Ubuntu 16.04. LiteCart is a free and open source e-commerce platform which is developed in PHP, jQuery and HTML 5. In this tutorial, we will show how to install LiteCart on Ubuntu 16.04 VPS and setup a LAMP stack (Linux, Apache, MySQL, PHP) if you already haven’t. Installing LiteCart on Ubuntu 16.04 is fairly easy task and should take less than 15 minutes.

1. Getting Started

First, you will need to login to your server via SSH as user root:

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, let’s make sure that your Ubuntu 16.04 server is up-to-date by running the following commands:

apt-get update
apt-get upgrade

2. Install Apache Web Server

To install the Apache web server, run the following command:

apt-get install apache2

After the installation is completed, you can enable the service to be started automatically upon system boot with:

systemctl enable apache2

To verify that the Apache server is running, you can run the following command:

systemctl status apache2

3. Install PHP 7.0

Next, let’s install PHP 7 with some additional PHP modules:

apt-get install php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-readline php7.0-gd php7.0-mcrypt php7.0-intl php7.0-curl php7.0-zip

4. Install MySQL Database Server

The next step is to install the MySQL database server. To do this, run the following command:

apt-get install mysql-server

After the installation is completed, you can start the database server and enable it to automatically start upon boot, with:

systemctl start mysql
systemctl enable mysql

You can also run the mysql_secure_installation script to harden the security of your MySQL database server:

mysql_secure_installation

After you have answered all the questions you can now go ahead and login to MySQL as root using your root password, with the following command:

mysql -u root -p

To create a new database for your LiteCart installation, run the following commands:

CREATE DATABASE litecart_db;
GRANT ALL PRIVILEGES ON litecart_db.* TO 'litecart_user'@'localhost' IDENTIFIED BY 'PASSWORD';
FLUSH PRIVILEGES;
exit;

Make sure to replace “PASSWORD” with an actual, strong password.

5. Install LiteCart on Ubuntu 16.04

Now that our LAMP server is ready, we can finally install LiteCart.

First, let’s create a new directory for our LiteCart installation inside the Apache document root directory on your server:

mkdir /var/www/html/litecart

Next, download the latest LiteCart version from the official site and place it inside the newly created directory. Then you can extract the downloaded zip archive with the following command:

unzip litecart-2.0.2.zip

Change the ownership of the litecart directory:

chown -R www-data:www-data /var/www/html/litecart

6. Set up Apache Virtual Host

If you want to access your LiteCart installation using your own domain name, you will also need to create an Apache virtual host file:

nano /etc/apache2/sites-available/litecart.conf

And enter the following content inside this file:

<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
DocumentRoot /var/www/html/litecart
ServerName yourdomain.com
ServerAlias www.yourdomain.com

<Directory /var/www/html/litecart>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/apache2/litecart-error_log
CustomLog /var/log/apache2/litecart-access_log common
</VirtualHost>

7. Enable the Virtual Host File

Enable the virtual host file with:

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

8. Restart Apache

Restart your Apache with:

systemctl restart apache2

9. Complete the LiteCart Installation via Web Browser

That’s it. You can now go to http://yourdomain.com (or http://YOUR_IP_ADDRESS) and follow the on-screen instructions to complete the LiteCart installation.

 

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

]]>
https://linuxhostsupport.com/blog/how-to-install-litecart-on-ubuntu-16-04/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
Speed Up SSH Connections in Linux https://linuxhostsupport.com/blog/speed-up-ssh-connections-in-linux/ https://linuxhostsupport.com/blog/speed-up-ssh-connections-in-linux/#respond Wed, 03 Jan 2018 08:16:10 +0000 https://linuxhostsupport.com/blog/?p=318 We’ll show you, how to speed up SSH connections in Linux. SSH is a very secure method for managing Linux servers. Sometimes it can be very slow especially if you need to open multiple SSH connections to your server. One such scenario would be if you use Git for your development work, as Git uses […]

The post Speed Up SSH Connections in Linux appeared first on LinuxHostSupport.

]]>
We’ll show you, how to speed up SSH connections in Linux. SSH is a very secure method for managing Linux servers. Sometimes it can be very slow especially if you need to open multiple SSH connections to your server. One such scenario would be if you use Git for your development work, as Git uses multiple SSH connections to transfer files and if your server is not configured correctly it will add unnecessary overhead by re-establishing a connection for every file transferred. In today’s tutorial we are going to learn how to speed up SSH connections in Linux. Let’s get started!

1. Disable DNS lookup on the server

The OpenSSH server has DNS lookups enabled by default, this means that the OpenSSH server will first look up the host name of the connecting host and then will check if the resolved host name’s IP address is the same as the connecting IP address.To disable DNS lookups, add the ‘UseDNS’ directive at the end of the ‘/etc/ssh/sshd_config’ file and set the value to ‘no’:

# nano /etc/ssh/sshd_config

# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

# Disable DNS lookups
UseDNS no

2. Re-use existing SSH connection

If you open multiple SSH connections to your server frequently, it would be best to configure your SSH client to use the existing connection when creating a new SSH session.This can speed up the sessions opened after the initial connection as it avoids the overhead of establishing a new connection.

Open the ‘~/.ssh/config’ file with nano and add the following lines in it:

# nano ~/.ssh/config

Host *
ControlMaster auto
ControlPath  ~/.ssh/sockets/%r@%h-%p
ControlPersist 600

The ‘Host *’ directive above tells the SSH client to re-use the initial connection for all remote servers.

3. Setting up a password-less SSH login

Setting up a password-less SSH login is pretty easy and saves you time because you don’t have to enter a password when you open a new SSH connection.This can be done in three easy steps.

1.Generate the public/private key pair using this command:

# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): Press Enter.
Enter passphrase (empty for no passphrase): Press Enter.
Enter same passphrase again: Press Enter.
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:/LEFoGKAt/qC9NeEfIfWm988IUqJaAuYBDvuDuu/jk8 root@test
The key's randomart image is:
+---[RSA 2048]----+
| ..     .        |
|o ..   . .       |
|.o .o .   .      |
|o... . .   .     |
|ooo . o S o .    |
|.= . = * * = .   |
|=..Eo * o * . .  |
|+o+. o . +  o.   |
|+=+=o     .. o.  |
+----[SHA256]-----+

2.Copy the public key to the remote server using this command:

# ssh-copy-id -i ~/.ssh/id_rsa.pub remote-server
root@remote-server's password:
Now try logging into the machine, with "ssh 'remote-server'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

3.Log in to the remote server to check if the password-less login is working:

# ssh remote-server

Last login: Thu Dec 28 20:10:38 2017 from 10.20.30.4


root@remote-server$

If everything goes well you should see the output displayed above.

4. Changing the encryption used by the OpenSSH server

Changing the default cipher order for the SSHv2 protocol on the OpenSSH server can further speed up SSH connections as some ciphers can encrypt data faster than others.
For Ubuntu 16.04 the default order according to ‘man ssh_config’ is:

The default is:

	chacha20-poly1305@openssh.com,
	aes128-ctr,aes192-ctr,aes256-ctr,
	aes128-gcm@openssh.com,aes256-gcm@openssh.com,
	aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc

If you do have a server which supports the new AES-NI instructions it would be better to change this order and add it to the end of the ‘/etc/ssh/sshd_config’ file like this:

# nano /etc/ssh/sshd_config

# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

# Disable DNS lookups
UseDNS no

# Change the order of the ciphers used
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,chacha20-poly1305@openssh.com,3des-cbc

According to several benchmarks available online, aes128-ctr is twice as fast as chacha20-poly1305 on processors that support the AES-NI instructions so if you have a high-bandwidth connection to your server the file transfer speed should increase significantly after making the change.

That’s it, now your SSH connections should be a lot faster.

Of course, you don’t have to Speed Up SSH Connections in Linux, all by yourself, if you use one of our outsourced linux support services, in which case you can simply ask our expert Linux admins to speed up the SSH connections on your Linux server for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to speed up SSH connections in Linux, please share it with your friends on the social networks using the buttons on the right or simply leave a reply below. Thanks.

The post Speed Up SSH Connections in Linux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/speed-up-ssh-connections-in-linux/feed/ 0
How to Install Cacti SNMP Monitoring Tool on Debian 9 https://linuxhostsupport.com/blog/how-to-install-cacti-snmp-monitoring-tool-on-debian-9/ https://linuxhostsupport.com/blog/how-to-install-cacti-snmp-monitoring-tool-on-debian-9/#comments Wed, 27 Dec 2017 08:33:15 +0000 https://linuxhostsupport.com/blog/?p=308 In today’s tutorial, we will show you how to install and Cacti on a Debian 9 server. Cacti is an open-source, web-based network graphing solution written in PHP and build on top of the industry-standard data logging tool RRDtool. Cacti stores all of the necessary information in a MySQL database and allows a user to poll […]

The post How to Install Cacti SNMP Monitoring Tool on Debian 9 appeared first on LinuxHostSupport.

]]>
In today’s tutorial, we will show you how to install and Cacti on a Debian 9 server. Cacti is an open-source, web-based network graphing solution written in PHP and build on top of the industry-standard data logging tool RRDtool. Cacti stores all of the necessary information in a MySQL database and allows a user to poll services at predetermined intervals and graph the resulting data using RRDtool. This guide should work on other Linux VPS systems as well, but was tested and written for a Debian 9 VPS.

1. Login to your VPS via SSH

ssh user@vps_IP

2. Update the system

sudo apt update && sudo apt -y upgrade

3. Install MariaDB Server

We will the install MariaDB 10.1 server from the official Debian repositories, you can skip this step if MariaDB/MySQL server is already installed on your machine.
To install the MariaDB server , run the following commands:

sudo apt install mariadb-server mariadb-client

4. Secure MariaDB Installation

Once the MariaDB installation is complete, run the following command to secure your installation:

mysql_secure_installation

5. Enable large Varchar Indexes

Edit your MariaDB/MySQL configuration and enable large varchar indexes:

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
[mysqld]
innodb_file_format = Barracuda
innodb_file_per_table = 1
innodb_large_prefix

character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
skip-character-set-client-handshake

6. Restart MariaDB

Restart the mariadb service for changes to take effect:

sudo systemctl restart mariadb

7. Install Apache2, PHP and required PHP modules

Chances are that you already have Apache and PHP installed on your machine, if not execute the following command:

sudo apt install apache2 php php-mysql php-snmp

8. Install Cacti

Once Apache, PHP, and MariaDB are installed, we can proceed with the Cacti installation. The easiest way to install Cacti on Debian 9 is to use the Cacti deb package from the Debian’s apt repository.

The following command will install Cacti and all the necessary requirements including the rrdtool tool:

sudo apt install cacti snmpd

The installation will now prompt you to answer a series of questions.

Configure database for cacti with dbconfig-common?

Select Yes and click [enter]

 Please provide a password for cacti to register with the database server. If left blank, a random password will be generated.
 MySQL application password for cacti:

Leave it empty and click [enter]

 Please select the web server for which Cacti should be automatically configured
Select "None" if you would like to configure the web server manually.

Select Apache2 and click [enter]

9. Set Admin Password

Once the installation is completed, set the admin password using the following command:

mysql -u root -p -D cacti -e "update user_auth set password=md5('your_new_admin_password') where username='admin';"

That’s it. You have successfully installed Cacti on your Debian 9 VPS.  Now you can login to the Cacti web interface at http://YOUR_IP/cacti using username admin and password your_new_admin_password.

For more information about how to configure and manage your Cacti installation, please refer to the official Cacti documentation.


Of course, you don’t have to install Cacti SNMP Monitoring Tool on Debian 9, if you use one of our outsourced server support services, in which case you can simply ask our expert Linux admins to install Cacti SNMP Monitoring Tool on Debian 9r. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to install Cacti SNMP Monitoring Tool on Debian 9,  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 Cacti SNMP Monitoring Tool on Debian 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-cacti-snmp-monitoring-tool-on-debian-9/feed/ 2
How to Setup Reverse SSH Tunnel on Linux https://linuxhostsupport.com/blog/how-to-setup-reverse-ssh-tunnel-on-linux/ https://linuxhostsupport.com/blog/how-to-setup-reverse-ssh-tunnel-on-linux/#respond Wed, 20 Dec 2017 14:44:33 +0000 https://linuxhostsupport.com/blog/?p=302 We’ll explain to you, how to set up reverse SSH tunnel on Linux. Let’s say you have a Linux machine behind NAT and a VPS.You want to SSH to the Linux machine behind NAT from your VPS but you don’t want to bother with port forwarding or your machine behind NAT doesn’t have a static […]

The post How to Setup Reverse SSH Tunnel on Linux appeared first on LinuxHostSupport.

]]>
We’ll explain to you, how to set up reverse SSH tunnel on Linux. Let’s say you have a Linux machine behind NAT and a VPS.You want to SSH to the Linux machine behind NAT from your VPS but you don’t want to bother with port forwarding or your machine behind NAT doesn’t have a static IP address. We have an easy solution, in today’s tutorial we are going to learn how to set up a reverse SSH tunnel on Linux.

1. Setting up a reverse SSH tunnel

We’ll start by setting up the reverse SSH tunnel on the machine that is behind NAT, do that by typing in the following command:

ssh -R 24553:localhost:22 user@111.111.111.111

Note: Make sure to substitute the SSH user and IP address in the command above to your own SSH user and IP address.

The port used for the reverse tunnel in the command above is 24553, feel free to use whatever port you like and make sure this port is open on the VPS you want to connect the reverse tunnel to.You can check iptables if the port is open by executing the following command:

iptables -L -vn

If the output has a DROP all line at the bottom like the following example:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80
 3214 3919K ACCEPT     all  --  *      *       10.20.30.1           0.0.0.0/0
    0     0 ACCEPT     all  --  *      *       10.20.31.2           0.0.0.0/0
 631K  855M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
 329K   17M DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0

Or an INPUT policy set to DROP like the following example:

Chain INPUT (policy DROP 329K packets, 17M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80
 3214 3919K ACCEPT     all  --  *      *       10.20.30.1           0.0.0.0/0
    0     0 ACCEPT     all  --  *      *       10.20.31.2           0.0.0.0/0
 631K  855M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

Then you will need to open the port in iptables by executing the command:

iptables -I INPUT 1 -p tcp --dport 24553 -j ACCEPT

Of course, make sure to replace the value in “–dport” for your preferred port number.

2. Connecting to the SSH tunnel

This is really easy and is done by executing the following command on the VPS:

ssh localhost -p 24553

You can also SSH from other machines to the NAT’ed machine, you can do that by first logging into your VPS:

ssh user@111.111.111.111

And then logging in to the machine from your VPS:

ssh localhost -p 24553

3. Creating a persistent SSH tunnel

The tunnel we created above won’t be persistent and will be dropped if the connection on the Linux machine behind NAT drops, if we want to make our reverse SSH tunnel persistent we need to install autossh.
For Ubuntu/Debian execute the following command to install autossh:

apt-get install autossh

For RHEL/CentOS execute the following command to install autossh:

yum install autossh

Now we need to create the reverse SSH tunnel on the machine behind NAT, execute the following command:

autossh -M 20110 -o ServerAliveInterval=20 -R 24553:localhost:22 user@111.111.111.111 & >/dev/null 2>&1

And then log in to the machine behind NAT by executing the following command on your VPS:

ssh localhost -p 24553

That’s it, now you have successfully set up a reverse SSH tunnel on Linux.

Of course, if you use one of our Linux support services, you can always contact and ask our expert Linux admins (via chat or ticket) to set up a reverse SSH tunnel on your Linux VPS for you. They are available 24×7 and will provide information or assistance immediately.

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

The post How to Setup Reverse SSH Tunnel on Linux appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-setup-reverse-ssh-tunnel-on-linux/feed/ 0
How to Install Let’s Encrypt with Apache on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-with-apache-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-with-apache-on-ubuntu-16-04/#comments Wed, 13 Dec 2017 12:00:45 +0000 https://linuxhostsupport.com/blog/?p=295 In this tutorial we are going to show you, with step-by-step instructions on how to install Let’s Encrypt with Apache on Ubuntu 16.04. Let’s Encrypt is an open SSL Certificate Authority (CA) that offers free domain-validated (DV) certificates for your websites. SSL Certificates are used to establish a secure encrypted connection between a web server […]

The post How to Install Let’s Encrypt with Apache on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
In this tutorial we are going to show you, with step-by-step instructions on how to install Let’s Encrypt with Apache on Ubuntu 16.04. Let’s Encrypt is an open SSL Certificate Authority (CA) that offers free domain-validated (DV) certificates for your websites. SSL Certificates are used to establish a secure encrypted connection between a web server and a user’s web browser. The SSL certificates that have been issued by Let’s Encrypt are valid for 90 days and are trusted by most web browsers today.

1. Requirements

In order to start with the installation procedure, you need to have Apache or Nginx installed on your server. If there is no web server installed on your virtual server, please follow this tutorial to install Apache.
Also, you need a registered domain name with its A record pointing to your server’s IP address.  For the purposes of this tutorial, we will use ‘yourdomain.com’.

2. Install CertBot

Run the following commands:

sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache

3. Install Let’s Encrypt SSL

Install Let’s Encrypt SSL certificate on your domain (do not forget to replace ‘yourdomain.com’ with your actual domain):

sudo certbot --apache -d yourdomain.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): admin@yourdomain.com 

-------------------------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: A

-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: N

Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for linuxhostsupport.com
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/000-default-le-ssl.conf
Deploying Certificate for yourdomain.com to VirtualHost /etc/apache2/sites-available/000-default-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/000-default-le-ssl.conf

4. Redirect HTTP traffic 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): 2
Redirecting vhost in /etc/apache2/sites-enabled/000-default.conf to ssl vhost in /etc/apache2/sites-available/000-default-le-ssl.conf

-------------------------------------------------------------------------------
Congratulations! You have successfully enabled https://yourdomain.com

5. Renew the SSL certificate with a cron job

Create a cron job so the SSL certificate is renewed automatically. Run:

crontab -e

and add the following line:

0 0 1 * * /usr/bin/letsencrypt renew >> /var/log/letsencrypt-renew.log

Save and close that file and restart cron service for the changes to take effect:

service cron restart

Open https://yourdomain.com in your favorite web browser, and check whether Let’s Encrypt SSL is installed properly:

Install-Lets-Encrypt-on-Ubuntu-16.04

That is it. Let’s Encrypt SSL certificate has been successfully installed on your website.

Of course you don’t have to Install Let’s Encrypt with Apache 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 Let’s Encrypt SSL certificate 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 Let’s Encrypt with Apache on Ubuntu 16, 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 with Apache on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-lets-encrypt-with-apache-on-ubuntu-16-04/feed/ 10
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 Use the Linux Fuser Command https://linuxhostsupport.com/blog/how-to-use-the-linux-fuser-command/ https://linuxhostsupport.com/blog/how-to-use-the-linux-fuser-command/#respond Wed, 29 Nov 2017 13:00:43 +0000 https://linuxhostsupport.com/blog/?p=283 We’ll show you, How To Use the Linux Fuser Command. The fuser command is used to identify which processes are using a specific file, unix socket or file system. In this tutorial we are going to show you few examples on how to use the fuser command on a Linux VPS. To be able to […]

The post How To Use the Linux Fuser Command appeared first on LinuxHostSupport.

]]>
We’ll show you, How To Use the Linux Fuser Command. The fuser command is used to identify which processes are using a specific file, unix socket or file system. In this tutorial we are going to show you few examples on how to use the fuser command on a Linux VPS.

To be able to use fuser command you need to have SSH access to the server. Connect to your server via SSH and run fuser.

# fuser
No process specification given
Usage: fuser [-fMuvw] [-a|-s] [-4|-6] [-c|-m|-n SPACE] [-k [-i] [-SIGNAL]] NAME...
       fuser -l
       fuser -V
Show which processes use the named files, sockets, or filesystems.

  -a,--all              display unused files too
  -i,--interactive      ask before killing (ignored without -k)
  -k,--kill             kill processes accessing the named file
  -l,--list-signals     list available signal names
  -m,--mount            show all processes using the named filesystems or block device
  -M,--ismountpoint     fulfill request only if NAME is a mount point
  -n,--namespace SPACE  search in this name space (file, udp, or tcp)
  -s,--silent           silent operation
  -SIGNAL               send this signal instead of SIGKILL
  -u,--user             display user IDs
  -v,--verbose          verbose output
  -w,--writeonly        kill only processes with write access
  -V,--version          display version information
  -4,--ipv4             search IPv4 sockets only
  -6,--ipv6             search IPv6 sockets only
  -                     reset options

  udp/tcp names: [local_port][,[rmt_host][,[rmt_port]]]

The output will notify you that no process specification is given and will show you some basic usage examples and options.

The -v or --verbose provides verbose output and it is commonly used. One example is to list all the processes that are using the current directory.

fuser -v .

If your current directory is the root directory, the output should be similar to this one:

# fuser -v .
                     USER        PID ACCESS COMMAND
                     ...
                     root         37 .rc.. bash
                     root         64 .rc.. systemd-journal
                     root         65 .rc.. systemd-udevd
                     root        193 .rc.. rpcbind
                     root        197 .rc.. systemd-logind
                     root        199 .r... cron
                     messagebus  200 .rc.. dbus-daemon
                     syslog      211 .rc.. rsyslogd
                     root        296 .r... saslauthd
                     root        297 .r... saslauthd
                     root        299 .rc.. sshd
                     bind        304 .r... named
                     root        321 .r... dovecot
                     root        329 .r... log
                     root        334 .r... config
                     mysql       336 .r... mysqld
                     root        370 .rc.. agetty
                     root        371 .rc.. agetty
                     root        396 .rc.. xinetd
                     root        429 .r... sendmail-mta
                     root        449 .rc.. apache2
                     www-data    455 .rc.. apache2
                     www-data    456 .rc.. apache2
                     www-data    457 .rc.. apache2
                     www-data    458 .rc.. apache2
                     www-data    459 .rc.. apache2
                     ...

The above output shows information like the USER, PID, ACCESS and the COMMAND used to start the process. ACCESS shows letters denoting the type of access and there are several:

c - current directory
e - executable being run
r - root directory 
f - open file (omitted in default display mode)
F - open file for writing (omitted in default display mode) 
m - mmap’ed file or shared library

Another common usage of fuser is to list the processes using the UDP and TCP sockets on your Linux VPS. For example to list the processes using the TCP port 80 you can use the following command:

fuser -v -n tcp 80

If you have Apache installed and running on your server, the output should be similar to the following one:

# fuser -v -n tcp 80
                     USER        PID ACCESS COMMAND
80/tcp:              root        449 F.... apache2
                     www-data    455 F.... apache2
                     www-data    456 F.... apache2
                     www-data    457 F.... apache2
                     www-data    458 F.... apache2
                     www-data    459 F.... apache2
                     www-data    511 F.... apache2
                     www-data    512 F.... apache2
                     www-data    513 F.... apache2

Fuser can be used to kill specific processes too. For example, to kill the processes which are using TCP port 80, you can use the following command:

fuser -k 80/tcp

Please note, this will kill your Apache service if it is running at the moment.

Another example is to kill all processes accessing the /home directory in any way:

fuser -km /home

For more options and usage examples you can refer to the fuser man page.

man fuser

If you are one of our Linux Server Support services, you can always talk with one of our Linux Experts about Linux Fuser Command and how you can benefit from it.

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 Use the Linux Fuser Command appeared first on LinuxHostSupport.

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

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

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

1. Upgrade PHP

First make sure the system is up to date:

# yum update

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

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

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

# yum update

And then restart the php-fpm service:

# systemctl restart php-fpm

2. Install Opcache

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

# yum install php-opcache

Restart the php-fpm service again:

# systemctl restart php-fpm

Restart Nginx as well:

# systemctl restart nginx

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

php -i | grep opcache.enable

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

opcache.enable => On => On

3. Upgrade MariaDB

First make a backup from all of your databases.

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

# v-backup-users

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

# v-list-user-backups <username>

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

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

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

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

# yum remove mariadb mariadb-server

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

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

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

Now update the system again:

# yum update

And then install MariaDB 10:

# yum install mariadb mariadb-server

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

# systemctl start mariadb

Then enable the MariaDB service on boot:

# systemctl enable mariadb.service

4. Install Redis

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

You can install Redis by typing in the following command:

# yum install redis

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

# systemctl start redis

Now enable the Redis service to start on boot:

# systemctl enable redis.service

5. Configuring WordPress

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

# yum install php-devel

Then install the Phpredis extension using this command:

# pecl install redis

Press enter when the following message comes up:

enable igbinary serializer support? [no]

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

# nano /etc/php.ini

extension=redis.so

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

# systemctl restart php-fpm

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

# systemctl restart nginx

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

redis-cli monitor

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

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

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

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

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

]]>
https://linuxhostsupport.com/blog/speed-up-vestacp-on-centos-7/feed/ 14
How to deploy a LEMP Stack with PHP-7.1 on CentOS 7 https://linuxhostsupport.com/blog/how-to-deploy-a-lemp-stack-with-php-7-1-on-centos-7/ https://linuxhostsupport.com/blog/how-to-deploy-a-lemp-stack-with-php-7-1-on-centos-7/#comments Wed, 08 Nov 2017 13:00:46 +0000 https://linuxhostsupport.com/blog/?p=264 In this tutorial we will walk you through the steps on how to deploy a LEMP (Linux, Nginx, MySQL and PHP-FPM) stack with PHP-7.1 on a CentOS 7. A LEMP stack is a synonym of LEMP server or LEMP web server. It refers to a set-up which includes Linux, Nginx, MySQL (MariaDB) and PHP. 1. […]

The post How to deploy a LEMP Stack with PHP-7.1 on CentOS 7 appeared first on LinuxHostSupport.

]]>
In this tutorial we will walk you through the steps on how to deploy a LEMP (Linux, Nginx, MySQL and PHP-FPM) stack with PHP-7.1 on a CentOS 7.
A LEMP stack is a synonym of LEMP server or LEMP web server. It refers to a set-up which includes Linux, Nginx, MySQL (MariaDB) and PHP.

1. Update the system

As usual before beginning a new installation on your VPS, update the system first:

# yum update

2. Install MariaDB(MySQL)

MariaDB is a drop-in replacement for MySQL and is the default database server used in CentOS 7 (RHEL7). Install it using yum like this:

# yum -y install mariadb mariadb-server

To stop intruders from trying to access our MariaDB server while we’re setting it up, open the “/etc/my.cnf.d/server.cnf” file for editing and add the “bind-address” directive to have it listen only on the localhost IP address:

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

[mysqld]
bind-address = 127.0.0.1

Now, restart the MariaDB server and enable it on startup with the following commands:

# systemctl start mariadb
# systemctl enable mariadb

You can also run the mysql_secure_installation script to improve MariaDB (MySQL) security:

# mysql_secure_installation

Enter current password for root (enter for none): ENTER
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

3. Install Nginx

We are going to install Nginx as it is a key component of our LEMP stack and will serve our website to the users.
Nginx is not available in the official CentOS repository so we need to install the EPEL repository first:

# yum install epel-release

Type in the following command to install Nginx:

# yum -y install nginx

Once Nginx is installed, run these two commands to start the web server and enable it on boot:

# systemctl start nginx
# systemctl enable nginx

Now, check if Nginx is running by executing this command:

# systemctl status nginx

The output of the command above should be similar to this:

● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running)
 Main PID: 10092 (nginx)
   CGroup: /system.slice/nginx.service
           ├─10092 nginx: master process /usr/sbin/nginx
           ├─10093 nginx: worker process
           └─10094 nginx: worker process

You can also check if Nginx is running by going to http://YOUR_IP in your web browser.

4. Install PHP7.1-FPM

Now we are going to install PHP7.1-FPM as we will need it to process the PHP files our website contains.
Because PHP-7.1 is not available in the official CentOS repository we need to install the Remi repository first:

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

The following command installs PHP7.1-FPM and enables the remi-safe repository which gives priority to the distribution and EPEL repository packages, meaning it won’t conflict with any of these packages if you upgrade your system:

# yum --enablerepo=remi-safe -y install php71-php-fpm

Once PHP7.1-FPM is installed, run these commands to start PHP7.1-FPM and enable it on boot:

# systemctl start php71-php-fpm
# systemctl enable php71-php-fpm

Now, check if PHP7.1-FPM is running by executing this command:

# systemctl status php71-php-fpm

The output of the command above should be similar to this:

● php71-php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php71-php-fpm.service; enabled; vendor preset: disabled)
   Active: active (running)
 Main PID: 10792 (php-fpm)
   Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec"
   CGroup: /system.slice/php71-php-fpm.service
           ├─10792 php-fpm: master process (/etc/opt/remi/php71/php-fpm.conf)
           ├─10793 php-fpm: pool www
           ├─10794 php-fpm: pool www
           ├─10795 php-fpm: pool www
           ├─10796 php-fpm: pool www
           └─10797 php-fpm: pool www

Note: The configuration files for the PHP-7.1 Remi repository package are located in the “/etc/opt/remi/php71” directory.

Next, change the configuration of the default PHP7.1-FPM pool to listen on a unix socket and use Nginx’s user and group:

# nano /etc/opt/remi/php71/php-fpm.d/www.conf

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
; RPM: apache user chosen to provide access to the same directories as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
;                            a specific port;
;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
;                            a specific port;
;   'port'                 - to listen on a TCP socket to all addresses
;                            (IPv6 and IPv4-mapped) on a specific port;
;   '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /run/php/php7.1-fpm.sock

Save the changes and restart the PHP7.1-FPM service:

# systemctl restart php71-php-fpm

5. Configuring Nginx

Now that you have everything up and running we will create a document root directory and a server block for our site in Nginx, start by typing in the following command:

# mkdir -p /var/www/example.com

We will create the Nginx server block for our domain and configure it to use PHP-7.1:

# nano /etc/nginx/conf.d/example.com.conf

server {
        listen 80;
        
        root /var/www/example.com;

        # Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;

        server_name example.com;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

        # pass the PHP scripts to FastCGI server using the /run/php/php7.1-fpm.sock socket
        #
        location ~ \.php$ {
                include fastcgi.conf;
                fastcgi_pass unix:/run/php/php7.1-fpm.sock;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
                deny all;
        }
}

Save the changes and test the configuration:

# nginx -t

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

If there are no errors copy your website’s contents to the “/var/www/example.com” directory, change the owner of the directory and restart Nginx with the following commands:

# chown -R nginx:nginx /var/www/example.com
# systemctl restart nginx

And now you should see your site up and running when you access http://example.com in your web browser.
Note: Remember to replace example.com with your own domain name.

Of course, you don’t have to install a LEMP Stack with PHP-7.1 on CentOS 7, if you use one of our Linux Support Services, in which case you can simply ask our expert Linux admins to install LEMP with PHP-7.1 on a CentOS 7 server for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to deploy a LEMP Stack with PHP-7.1 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 deploy a LEMP Stack with PHP-7.1 on CentOS 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-deploy-a-lemp-stack-with-php-7-1-on-centos-7/feed/ 8
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 Restore a Full cPanel Backup to VPS https://linuxhostsupport.com/blog/how-to-restore-a-full-cpanel-backup-to-vps/ https://linuxhostsupport.com/blog/how-to-restore-a-full-cpanel-backup-to-vps/#respond Wed, 25 Oct 2017 13:00:46 +0000 https://linuxhostsupport.com/blog/?p=249 Backup restoration is one of the essential tasks every server administrator must know how to perform. Under cPanel it is really simple to restore full backup of one account. In this tutorial we are going to show you two very easy methods about how to restore a full cPanel backup to a Linux VPS. Restore […]

The post How to Restore a Full cPanel Backup to VPS appeared first on LinuxHostSupport.

]]>
Backup restoration is one of the essential tasks every server administrator must know how to perform. Under cPanel it is really simple to restore full backup of one account. In this tutorial we are going to show you two very easy methods about how to restore a full cPanel backup to a Linux VPS.

Restore Full cPanel Backup via WHM

The first method is to restore the full cPanel backup via WHM. Of course, in order to be able to restore the backup using this method you need to have root access to WHM which is listening on port 2087. So if your domain is example.com, you can access WHM via web browser at https://example.com:2087.

Once you log in to WHM, navigate to Backups and then select Restore a Full Backup/cpmove File. This WHM feature will allow you to restore specific backup by choosing one of the two possible methods, Restore with Username or Restore with File.

To restore with username, you must upload the full cPanel backup file to one of the following directories:

/home
/home2
/home3
/root
/usr
/usr/home
/web

Additionally, the filename of the full cPanel backup must use one of the following formats:

cpmove-{USER}
cpmove-{USER}.tar
cpmove-{USER}.tar.gz
{USER}.tar
{USER}.tar.gz
backup-{BACKUP-DATE_TIME}_{USER}.tar
backup-{BACKUP-DATE_TIME}_{USER}.tar.gz

For example, if the username for the account you want to restore is example_user you should select the username from the drop down list. See the screenshot below for more details.

How to Restore a Full cPanel Backup to VPS

If there is no full cPanel backup uploaded in one of the above directories for that username, it will not be available for selection. Therefore, make sure that the full cPanel backup is properly uploaded on your cPanel server.

Once you are ready to restore the backup, hit the Restore button and let cPanel do its work.

In case you want to restore a full cPanel backup using a file, select Restore with File, then click on Choose file and select the backup file from your local filesystem. The backup file will be uploaded on the server and restored.

Restore Full cPanel Backup via command line

Yes, this is another method which some server admins find much easier than the first one. For this method you need to have SSH access to the server. Connect to your Linux server via SSH and run the following command as root:

/scripts/restorepkg example_user

Of course, you need to replace example_user with the actual username for the account you want to restore. Also, make sure that the full cPanel backup is properly uploaded in the /home directory on your server before starting the restoration process.

For more information we recommend you to refer to the WHM/cPanel documentation. The article describing the full cPanel backup restoration process is available at https://documentation.cpanel.net/display/ALD/Restore+a+Full+Backup+cpmove+File.

Restoring full cPanel backup on a Linux VPS is an easy task if you use one of our Linux Host Support Services. Simply ask our expert Linux Administrators to help you restore the full cPanel backup on your server for you, and it will be taken care of immediately. They are available 24×7, so you can get the help you need at any time.

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

The post How to Restore a Full cPanel Backup to VPS appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-restore-a-full-cpanel-backup-to-vps/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
How to Set Up a TeamSpeak Server on CentOS 7 https://linuxhostsupport.com/blog/how-to-set-up-a-teamspeak-server-on-centos-7/ https://linuxhostsupport.com/blog/how-to-set-up-a-teamspeak-server-on-centos-7/#comments Wed, 11 Oct 2017 12:00:50 +0000 https://linuxhostsupport.com/blog/?p=235 TeamSpeak 3 is voice-over-internet protocol (VOIP) software. It provides audio communication features, that can be used online gaming, educational training, internal business communication, and staying in touch with friends and family. TeamSpeak is easy to use and offers high security standards, excellent audio quality, and low system and bandwidth usage. Featuring a client-server architecture, TeamSpeak […]

The post How to Set Up a TeamSpeak Server on CentOS 7 appeared first on LinuxHostSupport.

]]>
TeamSpeak 3 is voice-over-internet protocol (VOIP) software. It provides audio communication features, that can be used online gaming, educational training, internal business communication, and staying in touch with friends and family. TeamSpeak is easy to use and offers high security standards, excellent audio quality, and low system and bandwidth usage. Featuring a client-server architecture, TeamSpeak 3 is literally capable of handling up to thousands of simultaneous users.

Listed below are some of the key TeamSpeak features:

  • Superior Voice Quality
  • High Scalability
  • Powerful File Transfer
  • Text Chat
  • 3D Sound Effects
  • Decentralized Infrastructure
  • Robust Permission System
  • Mobile applications for Android and iOS
  • In-Game Overlay
  • Limitless Customization

and many more…

In this tutorial we will guide you through the steps of installing TeamSpeak 3 Server on a CentOS 7 VPS.

Update the system

First thing you need to do is to log in to your CentOS 7 VPS via SSH as user root.

ssh root@IP_Address -p Port_Number

Before installing TeamSpeak Server it is recommended to update all packages installed on your server.

yum -y update

Install TeamSpeak Server

It is not recommended to run TeamSpeak as user root, so we will create a new system user by running the following command

adduser --shell /bin/false teamspeak -d /opt/teamspeak3 -M

Download TeamSpeak 3 Server for Linux from their official website

wget http://dl.4players.de/ts/releases/3.0.13.8/teamspeak3-server_linux_amd64-3.0.13.8.tar.bz2

unpack the downloaded archive, rename the directory and remove the downloaded archive

tar -jxvf teamspeak3-server_linux_amd64-3.0.13.8.tar.bz2
mv teamspeak3-server_linux_amd64 teamspeak3
rm -f teamspeak3-server_linux_amd64-3.0.13.8.tar.bz2

To start the TeamSpeak server switch the user

su teamspeak

and execute the following command

cd /opt/teamspeak
./ts3server_startscript.sh start

You should get the following output

Starting the TeamSpeak 3 server
TeamSpeak 3 server started, for details please view the log file
root@linuxhostsupporttest [/opt/teamspeak3]#
------------------------------------------------------------------
I M P O R T A N T
------------------------------------------------------------------
Server Query Admin Account created
loginname= "serveradmin", password= "KffDEVoW"
------------------------------------------------------------------

------------------------------------------------------------------
I M P O R T A N T
------------------------------------------------------------------
ServerAdmin privilege key created, please use it to gain
serveradmin rights for your virtualserver. please
also check the doc/privilegekey_guide.txt for details.

token=X3wT1SSVrW9VmwRkpNC32ezYhaSJ7bp8WOwBWOnB
------------------------------------------------------------------

If you want to stop the TeamSpeak server use the following command

./ts3server_startscript.sh stop

You can also create a systemd service to easily start/stop/restart TeamSpeak and start the service automatically on server boot. To do that, create a ‘teamspeak.service’ file with the following content

vim /lib/systemd/system/teamspeak.service

[Unit]
Description=TeamSpeak 3 Server Server
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/teamspeak3/
ExecStart=/opt/teamspeak3/ts3server_startscript.sh start inifile=ts3server.ini
ExecStop=/opt/teamspeak3/ts3server_startscript.sh stop
User=teamspeak
Group=teamspeak
PIDFile=/opt/teamspeak3/ts3server.pid
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=teamspeak

[Install]
WantedBy=multi-user.target

Save the file and execute the following commands to enable and start the service

systemctl --system daemon-reload
systemctl enable teamspeak3.service
systemctl start teamspeak3.service

Installing TeamSpeak on a CentOS 7 server  is an easy task if you are using one of  our Linux Host Support Services. Feel free to ask our expert Linux Administrators to install TeamSpeak on a CentOS 7 these for you, and it will be taken care of immediately. They are available 24×7, so you can get the help you need at any time.

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

The post How to Set Up a TeamSpeak Server on CentOS 7 appeared first on LinuxHostSupport.

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

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

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

mysql_secure_installation

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

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

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

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

#Set variables and create database

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

#Download, install, and configuration of WordPress

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

#Create a Virtual Host

echo "

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

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

#Create .htaccess file

echo "

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

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

systemctl restart httpd

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

#End of script

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

chmod +x <name of your file>

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

./<name of your file>

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

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

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

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

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

]]>
https://linuxhostsupport.com/blog/how-to-install-wordpress-on-a-centos-7-vps-in-less-than-2-minutes/feed/ 0
How to Migrate Odoo from one Server to Another https://linuxhostsupport.com/blog/how-to-migrate-odoo-from-one-server-to-another/ https://linuxhostsupport.com/blog/how-to-migrate-odoo-from-one-server-to-another/#comments Wed, 27 Sep 2017 08:54:11 +0000 https://linuxhostsupport.com/blog/?p=225 In this tutorial, we will show you how to completely migrate your Odoo installation, from one server to another. In this tutorial, an Ubuntu 16.04 server is used as both source and destination server. The migration is also possible between different Linux distributions. If this is the case, you can use one of our Linux […]

The post How to Migrate Odoo from one Server to Another appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to completely migrate your Odoo installation, from one server to another. In this tutorial, an Ubuntu 16.04 server is used as both source and destination server. The migration is also possible between different Linux distributions. If this is the case, you can use one of our Linux Host Support Services, and simply ask our expert Linux admins to do the migration for you.

Requirements:

  • SSH access on both, the source and destination server is required
  • Python, PostgreSQL and any additional dependencies like wkhtmltopdf, should already be installed on the destination server before initiating the transfer

 

1. Creating a backup on the source server

First, we will need a backup of your PostgreSQL database on your source server.

Log in via SSH as the odoo user on your server:

su odoo_user

Now, navigate to your Odoo directory:

cd /path/to/odoo

You can list the databases you have stored with the following command:

psql -l

You can export your odoo database by using the pg_dump command:

pg_dump dbname > db_backup.sql

Where “db_name” is the name of the database you need to export and “db_backup.sql” will be the name of the exported database.

Alternatively, if you don’t want to export your database through the command line interface, you can use some web-based GUI administration tools like phpPgAdmin or Adminer.

You can also export your database through your Odoo Database Manager directly from your browser by opening the following URL:

http://your-odoo-domain/web/database/manager

where “your-odoo-domain” is the name of your actual domain or your server IP address.

You also need to copy your odoo init and configuration file to the current directory.  For example:

cp /etc/init.d/odoo-server .
cp /etc/odoo-server.conf .

You can also open the odoo-server.conf file and check for any alternative custom addons location outside the odoo root directory. If there is, you should copy these addons as well to our current directory:

cp /path/to/odoo/addons .

Now, that we have everything we need in one place (make sure again that you are inside your Odoo directory on your server), we can create an archive of all these files with the following command:

tar -czf odoo_backup.tgz *

2. Transfer the backup

Before you transfer the backup we have made, first, you must log to your destination server and create a new user there:

adduser odoo_user

Now you can copy the backup archive from your source server to the destination with the rsync command (execute this command on the source server):

rsync -avz --progress -e "ssh -p 22" odoo_backup.tgz odoo_user@destination-ip-address:/home/odoo-user/

If SSH listens on a different port on the destination server, change the ssh port number accordingly.

You can extract the archive with the following command:

tar -zxf odoo_backup.tgz

You also need to copy your odoo-server.conf  and init file to the appropriate location;

cp odoo-server.conf /etc/
cp odoo-server /etc/init.d/

Depending on where you have placed your odoo directory, you will need to change the path to your addons directory accordingly inside the odoo-server.conf file:

nano /etc/odoo-server.conf

and edit the path for the addons_path if necessary.

Switch back to user root, and create the appropriate log file at the location specified in the configuration file. For example:

touch /var/log/odoo-server.log

3. Restoring the Database

To restore the database, create a new postgresql user with the following commands:

su postgres
createuser odoo_user

Create an empty database by executing:

createdb odoo_db

Give a password to the user:

psql
psql=# alter user odoo_user with encrypted password 'strong-password';

And grant all privileges on the database with:

grant all privileges on database odoo_db to odoo_user ;

Now, you can import your database from the source server into the newly created empty database by executing the following command:

psql odoo_db < /path/to/db_backup.sql

Again, you can use the alternative tools we have mentioned before to do this, or you can directly export it from your browser using the Odoo Database Manager.

You should also assign your odoo_user as the owner of all the files in your current odoo directory:

chown -R odoo_user: /path/to/your/odoo/directory

With this, the migration of your Odoo should be completed.

 

4. Start your Odoo Server

You can now start your Odoo on the new server with the following command:

service odoo-server start

You can also try to open your Odoo inside your browser and test if everything is working properly. Congratulations!

 

If you are one of our Linux Host Support customers, you don’t have to do any of this, simply ask our admins, sit back and relax. Our admins will migrate your Odoo from one server to another for you 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 Migrate Odoo from one Server to Another appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-migrate-odoo-from-one-server-to-another/feed/ 7
Install Sentora on Ubuntu https://linuxhostsupport.com/blog/install-sentora-on-an-ubuntu-vps/ https://linuxhostsupport.com/blog/install-sentora-on-an-ubuntu-vps/#respond Wed, 13 Sep 2017 16:02:15 +0000 https://linuxhostsupport.com/blog/?p=213 We’ll show you, how to install Sentora on Ubuntu. Sentora is completely free web hosting control panel for Linux, UNIX and BSD based servers written in PHP. It is fully featured and easy to use hosting control panel that can help users to manage their servers with ease through the user interface. Its installation is […]

The post Install Sentora on Ubuntu appeared first on LinuxHostSupport.

]]>
We’ll show you, how to install Sentora on Ubuntu. Sentora is completely free web hosting control panel for Linux, UNIX and BSD based servers written in PHP. It is fully featured and easy to use hosting control panel that can help users to manage their servers with ease through the user interface. Its installation is pretty easy and fast and includes all the software you will need to manage multiple websites and clients on a single server. In this tutorial we will guide you through the steps of installing Sentora control panel on Ubuntu.

Sentora comes with the following services installed out of the box:

  • Apache HTTPd
  • PHP
  • MySQL/MariaDB
  • ProFTPd
  • Postfix
  • Dovecot

It comes with a lot of handy features such as:

  • Quota management
  • Multi-client environment
  • Custom Themes
  • API integration
  • Language translation packs
    and many more…

1. Login to your server via SSH

Login to your Ubuntu server via SSH as user root

ssh root@IP_Address -p Port_Number

2. Update the installed packages

and make sure that all installed packages are updated by running the following command

apt-get update && apt-get upgrade

3. Download Sentora installation script

Download the Sentora installation script to your server

wget http://sentora.org/install

4. Make the script executable

Once downloaded, make the script executable

chmod +x install

4. Run the script

and run the script to start Sentora’s installation

./install

Please note that there can be no other services such as Apache, Nginx, MySQL, PHP, FTP and mail server, etc… installed on your Ubuntu VPS prior to installing Sentora. If you already have some of these service installed, you will have to remove them in order to start the Sentora installation.

In our case, MySQL server is already installed on the VPS:

Welcome to the Official Sentora Installer 1.0.3  #
##################################################

Checking that minimal requirements are ok
Detected : Ubuntu  14.04  x86_64
Ok.
It appears that package mysql-server is already installed. This installer
is designed to install and configure Sentora on a clean OS installation only!

Please re-install your OS before attempting to install using this script.

5. Remove MySQL

So we have to remove it

apt-get remove mysql-server
apt-get purge mysql-server

6. Execute the installation script again

and execute the installation script again to start up the installer

./install

You will be prompted to select your geographic area and then the city or region the server timezone should be set in. After that you will have to enter your domain and IP address to access your control panel. You should use a subdomain to access the control panel, for example: sentora.yourdomain.com

After everything is successfully installed, you will get the following output:

########################################################
Congratulations Sentora has now been installed on your
server. Please review the log file left in /root/ for
any errors encountered during installation.

Login to Sentora at http://http://sentora.yourdomain.com
Sentora Username  : admin
Sentora Password  : YOURPASSWORD

MySQL Root Password      : ROOTPASSWORD
MySQL Postfix Password   : POSTFIXPASSWORD
MySQL ProFTPd Password   : PROFTPDPASSWORD
MySQL Roundcube Password : ROUNDCUBEPASSWORD
(theses passwords are saved in /root/passwords.txt)
########################################################

7. Access Sentora control panel via web browser

Once the installation is completed, open you favorite web browser and point it to http://sentora.yourdomain.com to access Sentora control panel.

For more information on how to install, configure and use Sentora control panel, please visit the official documentation.


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

PS. If you liked this post, on how to Install Sentora on an Ubuntu, 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 Sentora on Ubuntu appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/install-sentora-on-an-ubuntu-vps/feed/ 0
Install Gogs on Ubuntu 16.04 https://linuxhostsupport.com/blog/install-gogs-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/install-gogs-on-ubuntu-16-04/#respond Wed, 06 Sep 2017 11:08:18 +0000 https://linuxhostsupport.com/blog/?p=200 We’ll explain to you, How to install Gogs on Ubuntu 16.04. Gogs is a free and open source self-hosted Git service, written in the Go programming language. It is very similar to GitLab and aims to be the easiest and most painless way to set up self-hosted Git service in your development environment. Its installation […]

The post Install Gogs on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
We’ll explain to you, How to install Gogs on Ubuntu 16.04. Gogs is a free and open source self-hosted Git service, written in the Go programming language. It is very similar to GitLab and aims to be the easiest and most painless way to set up self-hosted Git service in your development environment. Its installation is pretty fast and simple

In this tutorial, we will learn how to install Gogs with Apache as a reverse proxy on Ubuntu 16.04 server.

Prerequisites

Gogs has several prerequisites that you have to install in order to run Gogs on your Ubuntu server.

  • SSH server
  • Database server:
    – MySQL: Version 5.5.3 or newer
    – PostgreSQL
    – MSSQL
    – TiDB
    – SQLite3
  • Git version 1.7.1 or newer

Update the system

Login to your Ubuntu 16.04 server via SSH as user root:

ssh root@IP_Address

Make sure that all your system packages are up-to-date:

apt-get update && apt-get upgrade

Install MySQL server and create database

run the following command to install MySQL server on your server.

apt-get install mysql-server

Once installed, execute the mysql_secure_installation script to secure the MySQL server and set password for the root user.

mysql_secure_installation

Remove anonymous users? (Press y|Y for Yes, any other key for No) :
Disallow root login remotely? (Press y|Y for Yes, any other key for No) :
Remove test database and access to it? (Press y|Y for Yes, any other key for No) :
Reload privilege tables now? (Press y|Y for Yes, any other key for No) :

After that, login to the MySQL server as user root and create a database for Gogs

CREATE DATABASE gogs;
GRANT ALL PRIVILEGES ON gogs.* TO 'gogs'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD';
FLUSH PRIVILEGES;
\q

Install and configure Gogs

Create a new system user that will run Gogs

useradd --system --create-home git

Switch the user

su git
cd ~

Download the latest Gogs version which match your system (32bit or 64bit)

wget https://dl.gogs.io/0.11.29/linux_amd64.zip

Unpack the downloaded zip archive

apt-get install unzip
unzip linux_amd64.zip

Run the following command to start Gogs

cd gogs && ./gogs web &

Gogs by default is running on port 3000. So, open your favorite web browser and navigate it to http://IP_Address:3000 . Gogs will automatically detect that this is the first run and redirect to the setup screen.

Use the following information to configure Gogs:

Database Settings:

  • Database Type: MySQL
  • Host: 127.0.0.1:3306
  • User: gogs
  • Password: YOUR_PASSWORD
  • Database Name: gogs

Application General Settings:

  • Application Name: Gogs
  • Repository Root Path: /home/git/gogs-repositories
  • Run User: git
  • Domain: domain.com
  • SSH Port: 22 // use your SSH port number
  • HTTP Port: 3000
  • Application URL: http://domain.com

And click the ‘Install Gogs’ button to complete the installation. If everything is properly configured, you will be redirected to Gogs login screen where you can create your first account and start using this useful application. After signing in, you will be able to create, clone, push, repositories and use Gogs for your needs.

For more information on how to use Gogs and its features, please check their official documentation.


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

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

The post Install Gogs on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/install-gogs-on-ubuntu-16-04/feed/ 0
How to backup a WordPress site on your VPS https://linuxhostsupport.com/blog/how-to-backup-a-wordpress-site-on-your-vps/ https://linuxhostsupport.com/blog/how-to-backup-a-wordpress-site-on-your-vps/#comments Fri, 01 Sep 2017 09:19:16 +0000 https://linuxhostsupport.com/blog/?p=195 In this tutorial, we will show you how to manually backup your WordPress site on your VPS. It is highly recommended that you make regular backups of your WordPress site so you can easily restore it if something unexpected happens, for example, if your site breaks because of a faulty plugin, it gets infected with […]

The post How to backup a WordPress site on your VPS appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to manually backup your WordPress site on your VPS. It is highly recommended that you make regular backups of your WordPress site so you can easily restore it if something unexpected happens, for example, if your site breaks because of a faulty plugin, it gets infected with malicious files, you accidentally delete the contents of our database and so on. In order to fully make a backup of your WordPress site, we will need to make a backup of your WordPress files and your WordPress database.

WordPress Files

First, we will make a backup of all of your WordPress site files.

To do so, you need to log in to your VPS via SSH.

Once logged in, you will need to navigate to your WordPress root directory. Depending on your server configuration this can be at a different location, for example, /var/www/html/wordpress/.

Your WordPress site consists of the following:

  • the WordPress core installation files (stored in the wp-admin directory).
  • the WordPress Themes and Plugins (stored in the wp-content directory).
  • libraries and third-party components (stored in the wp-includes directory).
  • Images and Files
  • JavaScript and PHP scripts
  • Additional files and static web pages

All of these together will generate your WordPress site, so it would be best to backup all of these files and directories.

It is usually enough to only copy your wp-content directory, as the contents of wp-admin and wp-includes are usually never modified, and you can always retrieve them from the original WordPress installer.

But, just so you can have a full working copy of our site, it would be a good idea to make a backup of all the WordPress files together.

So, if your WordPress root directory is located in /var/www/html/wordpress/, you can do this with the following command:

tar -cpzf wp-backup.tar.gz /var/www/html/wordpress/

This will create an archive file of all the WordPress files which generate your website.

WordPress Database

Your WordPress files alone are not enough if we want a complete backup of your website. All the information of your website, including your posts, comments, site configurations, user accounts and so on, is stored in your database.

You can make a full backup of your WordPress database with the following command:

mysqldump -u wp_user -p wp_database > wp_database_backup.sql

where “wp_user” is the name of the user of your WordPress database, and “wp_database” is the name of your database.

If you are not sure of the user, database name and password, you can find that information in the wp-config.php file inside your WordPress directory.

With this, you now have everything you need to successfully restore your WordPress site.

After you have successfully made a backup of both your WordPress files and database you can easily transfer them to your local computer via FTP or the other way around when you need to restore your website.

 

Of course, if you are one of our Linux Host Support customers, you don’t have to do any of this, simply ask our admins, sit back and relax. Our admins will make a backup of your WordPress site for you immediately.

PS. If you liked this post, on How to install Monica on Ubuntu 16.04, 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 backup a WordPress site on your VPS appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-backup-a-wordpress-site-on-your-vps/feed/ 3
Install OpenLiteSpeed on Ubuntu 16.04 https://linuxhostsupport.com/blog/install-openlitespeed-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/install-openlitespeed-on-ubuntu-16-04/#comments Wed, 23 Aug 2017 08:51:32 +0000 https://linuxhostsupport.com/blog/?p=184 Today we will show you, how to install and configure OpenLiteSpeed on your Ubuntu 16.04 VPS. OpenLiteSpeed is a lightweight, open source HTTP server developed and copyrighted by LiteSpeed Technologies, Inc. It provides a user friendly web interface and supports various operating systems, including Linux, Mac OS, SunOS and FreeBSD. It is fairly easy to […]

The post Install OpenLiteSpeed on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
Today we will show you, how to install and configure OpenLiteSpeed on your Ubuntu 16.04 VPS. OpenLiteSpeed is a lightweight, open source HTTP server developed and copyrighted by LiteSpeed Technologies, Inc. It provides a user friendly web interface and supports various operating systems, including Linux, Mac OS, SunOS and FreeBSD. It is fairly easy to install OpenLiteSpeed on an Ubuntu 16.04 VPS. The installation process should take about 10-15 minutes, if you follow the very easy steps described below.

INSTRUCTIONS:

First of all login to your Ubuntu 16.04 VPS via SSH as user root

ssh root@IP_address

At the very beginning, it is best to start a screen session by executing the following command

screen -U -S openlitespeed

Update the system:

apt-get update && apt-get -y upgrade

Make sure to always keep your server up to date.

Install necessary packages:

apt-get install build-essential libexpat1-dev libgeoip-dev libpcre3-dev zlib1g-dev libssl-dev libxml2-dev rcs libpng-dev

Download and extract the latest stable version of OpenLiteSpeed on your server. At the time of this writing, the latest stable version of OpenLiteSpeed is 1.4.26.

cd /opt && wget http://open.litespeedtech.com/packages/openlitespeed-1.4.26.tgz
tar -xvzf openlitespeed-1.4.24.tgz
cd openlitespeed-1.4.24

Then use the following command to configure the software and to compile it, This will install the entire OpenLiteSpeed system under the /usr/local/lsws location:

./configure
make
make install

Install MariaDB

To install MariaDB, run the following command:

apt-get install -y mariadb-server

When the installation is complete, run the following command to secure your installation:

mysql_secure_installation

Configure it like this:

Enter current password for root (enter for none): Enter
Set root password? [Y/n]: Y
New password: 
Re-enter new password: 
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

Configure an administrative username and password for the OpenLiteSpeed’s web interface by running the following command:

/usr/local/lsws/admin/misc/admpass.sh

You will be asked to provide a username for the administrative user. If you just press ENTER, the username “admin” will be selected. Afterwards, you will be asked to select and confirm a new password for the account.

After setting up the username and the password use the following command to start the web server:

/etc/init.d/lsws start

Access OpenLiteSpeed

OpenLiteSpeed will be available on HTTP port 8080 by default and admin login using port 7080. Open your web browser and navigate to http://1your-domain-name.com:8080, you will see the default OpenLiteSpeed web page.

You can also access the administrative interface by navigating to http://your-domain-name.com:7080 on your web browser. You will be asked to enter the administrative username and password. After successful authentication, you will be redirected to the admin area.

That is it. The OpenLiteSpeed installation is now complete.

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

]]>
https://linuxhostsupport.com/blog/install-openlitespeed-on-ubuntu-16-04/feed/ 1
How to install Monica on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-monica-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-monica-on-ubuntu-16-04/#respond Wed, 16 Aug 2017 17:03:27 +0000 https://linuxhostsupport.com/blog/?p=178 We’ll show you, How to install Monica on Ubuntu 16.04. Monica is a Personal Relationship Management (PRM) system written in Laravel framework. It is designed and built to help you have more meaningful relationships with your friends and family, and keep track of all important details about your friends and family. In this tutorial we […]

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

]]>
We’ll show you, How to install Monica on Ubuntu 16.04. Monica is a Personal Relationship Management (PRM) system written in Laravel framework. It is designed and built to help you have more meaningful relationships with your friends and family, and keep track of all important details about your friends and family. In this tutorial we will install Monica on an Ubuntu 16.04 VPS

Monica has several requirements:

  • PHP 7.0+
  • MySQL, SQLite or Postgre
  • Git
  • Composer

First of all, login to your server via SSH as user root

ssh root@IP_ADDRESS -p PORT_NUMBER

Update the system and install necessary packages

apt-get update && apt-get upgrade
apt install apache2 php7.0 php7.0-mysql php7.0-xml php7.0-intl php7.0-mbstring git curl

Install PHP among with some dependencies

apt-get install php7.0 php7.0-intl php7.0-curl php7.0-zip

Install MySQL server on your VPS

apt-get install mysql-server

once the installation is completed, run the mysql_secure_installation script to secure your MySQL server

mysql_secure_installation

Enter current password for root (enter for none): ENTER
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

Create a new MySQL user and database for Monica

mysql -u root -p

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

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

Clone the Monica git repository

mkdir /var/www/html/monica
git clone https://github.com/monicahq/monica.git /var/www/html/monica/

Change the permissions of the Monica directory

chown -R www-data:www-data /var/www/html/monica

Install nodejs (this is needed for npm)

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
apt-get install -y nodejs

Install composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Once installed, run composer in the directory the repository has been cloned, to install Monica’s dependencies

cd /var/www/html/monica
composer install

Create .env file using the example provided and update it with your information.

cp .env.example .env

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=monica
DB_USERNAME=monicauser
DB_PASSWORD=YOURPASSWORD
DB_TEST_DATABASE=monica_test
DB_TEST_USERNAME=monicauser
DB_TEST_PASSWORD=YOURPASSWORD

Run the following command to generate an application key. It will set APP_KEY with the right value automatically.

php artisan key:generate
Application key [base64:j8RgNwHGsqir1ovhDWXYlEa6P2ODNBwRGMaQTm4ZBTs=] set successfully.

Run all migrations executing the following command

php artisan migrate

Enable avatar uploads for the contacts created in Monica

php artisan storage:link
The [public/storage] directory has been linked.

Populate the activity types and countries table

php artisan db:seed --class ActivityTypesTableSeeder
php artisan db:seed --class CountriesSeederTable

In order for the reminders to work properly, we have to set a cronjob that runs every minute with the following command

php artisan schedule:run

Once Monica is successfully installed on your server, you can access it at http://yourIPaddress/monica


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

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

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

]]>
https://linuxhostsupport.com/blog/how-to-install-monica-on-ubuntu-16-04/feed/ 0
10 Questions to Ask When Choosing a Hosting Service https://linuxhostsupport.com/blog/10-questions-to-ask-when-choosing-a-hosting-service/ https://linuxhostsupport.com/blog/10-questions-to-ask-when-choosing-a-hosting-service/#comments Fri, 11 Aug 2017 14:07:07 +0000 https://linuxhostsupport.com/blog/?p=170 When creating a blog or a website, it goes without saying that you will want to choose a high-quality web hosting service provider; you want a reliable host that will be able to not only give you enough features, but also offer quality support when needed. Here are some questions that will help you find […]

The post 10 Questions to Ask When Choosing a Hosting Service appeared first on LinuxHostSupport.

]]>
When creating a blog or a website, it goes without saying that you will want to choose a high-quality web hosting service provider; you want a reliable host that will be able to not only give you enough features, but also offer quality support when needed. Here are some questions that will help you find and determine, if a specific web hosting service is the right one for you. Let’s get started.


1. Do you have a security policy, and if so, what does it include?

Shared hosting is one of the most affordable options for web hosting, and if you are going for a shared host, you would want to know if there are security policies in place. You need to know whether your information and files will be properly protected; even with the more expensive dedicated or cloud hosting services, you want to work with a host that will conjoin with your efforts for security. Good web hosts perform virus and malware scans daily or every other day. If you choose a VPS, you are completely in charge of your virtual server, even though you are not the only client on the host server; you are fully isolated from other people’s virtual servers, just as how their virtual servers are fully isolated from yours. If you opt for dedicated hosting, all security is once again run by you, with the difference between this and virtual servers being that you are the only client on the entire server.

2. Do you offer TLS?

SSL, short for Secure Sockets Layer, is a protocol for the encryption of information sent over the Internet. It is a most popular choice for web encryption, making it the best choice for maintaining privacy of your information. If you are building an e-commerce site or anything that requires and processes sensitive information, you will want to work with a web host that can provide you with a good SSL certificate. Before signing up for the service, make sure the web host offers SSL, which will cover all your bases when it comes to security. In the case that your web host does not offer this, you can always get a third-party SSL provider for your website.

3. What kind of uptime can I expect from your servers?

Server uptime is essential to all users of a server, especially if you are running a website or service that caters to thousands or tens of thousands of clients every minute. Normally uptime percentages are referred to with ‘nines’ – three nines being 99.9% uptime, four being 99.99%, and so on. Anything above 99% should be plenty for almost all cases. Check the uptime guarantee of the web host before signing up, and ask if they also have a response time guarantee in the case of an emergency,

4. Do you perform backups?

Ideally, backing up data should be done as often as possible. If backups are made less often, you run a greater risk of losing critical data due to the most recent backup being older than the data that you lost. Avoid signing up with a web host that cannot perform backups of your files at least once a day.

5. What can you do when there is an outage?

A good web host will take responsibility for downtimes and outages, even when the circumstances are out of their control. You also need to know if they can help you recover your data in uncontrollable events such as power outages or weather disturbances. Some web hosts suspend their charges during emergencies to ensure that their customers are not being unfairly charged for service that is out-of-order.

6. Can I easily scale up when I need to?

In the event that you require more bandwidth, storage, RAM, or CPU power, a good web host should be able to easily accommodate your needs. However, some web hosts can trap their customers in some pretty inflexible contracts, so it’s good practice to check if the hosting company allows for upscaling in resources such as bandwidth and storage space.

7. Are your customer service and tech support teams helpful?

Good web hosts maintain equally good customer service and tech support teams that can respond quickly and diligently to your queries and difficulties.

8. Can you accommodate my needs, especially if they change over time?

A good web host should be able to easily accommodate you and your needs as they change over the course of your contract with them.

9. Do you monitor security?

Good web hosts have the ability to catch if a site is compromised as soon as it happens. Make sure that your web host has security measures in place, such as malware/virus scanners as well as firewalls.

10. What if I’m not satisfied with your service?

Web hosting companies that are confident in providing good service to their customers are not afraid to make guarantees or offer refunds in the event that there is a lapse in their service.

If you search for a web hosting provider by using the questions above, it’s more than likely that you will find a provider that will be able to provide you with excellent service and support, that also allows you to expand and upgrade your service with ease.

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

The post 10 Questions to Ask When Choosing a Hosting Service appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/10-questions-to-ask-when-choosing-a-hosting-service/feed/ 6
How to Install Nextcloud 12 on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-nextcloud-12-on-an-ubuntu-16-04-vps/ https://linuxhostsupport.com/blog/how-to-install-nextcloud-12-on-an-ubuntu-16-04-vps/#comments Wed, 02 Aug 2017 20:49:19 +0000 https://linuxhostsupport.com/blog/?p=158 Today we will show you how to install Nextcloud on  Ubuntu 16.04, using Apache web-server and MySQL database. Nextcloud is open source self-hosted file sync and share application forked from ownCloud. It has a lot of extra Calendar, Sync and Contacts features, apart from their file hosting features and it is a great free alternative to […]

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

]]>
Today we will show you how to install Nextcloud on  Ubuntu 16.04, using Apache web-server and MySQL database.

Nextcloud is open source self-hosted file sync and share application forked from ownCloud. It has a lot of extra Calendar, Sync and Contacts features, apart from their file hosting features and it is a great free alternative to some popular services such as Google Drive, Dropbox, Box, etc.

It is fairly easy to install Nextcloud on an Ubuntu 16.04 VPS. The installation process should take about 5-10 minutes if you follow the very easy steps described below.

At the time of writing this tutorial, Nextcloud 12.0.0 is the latest stable version available and it requires:

– Apache web server;
– PHP (5.6 or higher) along with the mbstring, curl, zip, xml, tidy, gd and mcrypt extensions. They are most generally active by default on a standard php installation.
– MySQL(version 5.5 or higher) installed on your Linux VPS;

 

1. Getting Started

First of all login to your Ubuntu 16.04 VPS via SSH as user root

ssh root@IP_address

At the very beginning, it is best to start a screen session by executing the following command

screen -U -S nextcloud

Update the system:

apt-get update && apt-get -y upgrade

Make sure to always keep your server up to date.

2. Install MariaDB 10.0

To install MariaDB, run the following command:

apt-get install -y mariadb-server

Next, we need to create a database for our Nextcloud installation.

mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE nextcloud;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'your-password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Do not forget to replace ‘your-password’ with a strong password.

3. Install Apache2 web server

[user]$ sudo apt-get install apache2

4. Install PHP and required PHP modules

To install the latest stable version of PHP version 7 and all necessary modules, run:

[user]$ sudo apt-get install php7.0 libapache2-mod-php7.0 php7.0-mbstring php7.0-curl php7.0-zip php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-bcmath php7.0-xml php7.0-json php7.0-tidy

5. Configure Apache Web Server

Enable the Apache2 rewrite module if it is not already done:

[user]$ sudo a2enmod rewrite

6. Restart Apache Web Server

In order to activate the new configuration, restart the Apache web server using the following command:

[user]$ sudo service apache2 restart

7. Download and Extract Nextcloud

Download and extract the latest version of Nextcloud on your server:

[user]$ sudo cd /opt && wget wget https://download.nextcloud.com/server/releases/nextcloud-12.0.0.zip
[user]$ sudo unzip nextcloud-12.0.0.zip
[user]$ sudo mv nextcloud/ /var/www/html/

8. Configure File Ownership

All files have to be readable by the web server, so we need to set a proper ownership

[user]$ sudo chown www-data:www-data -R /var/www/html/nextcloud/

9. Create Virtual Host in Apache

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

[user]$ sudo touch /etc/apache2/sites-available/nextcloud.conf
[user]$ sudo ln -s /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-enabled/nextcloud.conf
[user]$ sudo nano /etc/apache2/sites-available/nextcloud.conf

Then, add the following lines:

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

10. Restart Apache Web Server

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

[user]$ sudo service apache2 restart

11. Complete the Nextcloud Installation via Web Browser

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

That is it. The Nextcloud installation on Ubuntu 16.04, is now complete.

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

]]>
https://linuxhostsupport.com/blog/how-to-install-nextcloud-12-on-an-ubuntu-16-04-vps/feed/ 4
How to Install WordPress with PHP 7.1 and Nginx on Debian 9 https://linuxhostsupport.com/blog/how-to-install-wordpress-with-php-7-1-and-nginx-on-a-debian-9-vps/ https://linuxhostsupport.com/blog/how-to-install-wordpress-with-php-7-1-and-nginx-on-a-debian-9-vps/#comments Wed, 26 Jul 2017 12:28:04 +0000 https://linuxhostsupport.com/blog/?p=153 In this guide, we will walk you through the basic installation process of WordPress on a Debian 9 VPS with Nginx, MariaDB and PHP 7.1. WordPress is the most popular CMS in the world with unlimited customization options. This should work on other Linux VPS systems as well but was tested and written for Debian […]

The post How to Install WordPress with PHP 7.1 and Nginx on Debian 9 appeared first on LinuxHostSupport.

]]>
In this guide, we will walk you through the basic installation process of WordPress on a Debian 9 VPS with Nginx, MariaDB and PHP 7.1. WordPress is the most popular CMS in the world with unlimited customization options. This should work on other Linux VPS systems as well but was tested and written for Debian 9.

1. Update the system and install necessary packages.

apt -y update && sudo apt -y upgrade
sudo apt install apt-transport-https lsb-release ca-certificates wget

2. Install MariaDB 10.1

sudo apt-get install mariadb-server

When the installation complete, run the following command to secure your installation:

mysql_secure_installation

Next, we need to create a database for our WordPress instance.

mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE wpdb;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wpdb.* TO 'wpuser'@'localhost' IDENTIFIED BY 'wpuser_passwd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

3. Install and configure PHP 7.1

PHP 7.1 is not available via the default Debian repositories, so we will add the “packages.sury.org/php” repository, update the system and install the PHP 7.1 packages.

sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update

To install the latest version of PHP 7.1 and all necessary modules, run:

sudo apt install php7.1-common  php7.1-readline php7.1-fpm php7.1-cli php7.1-gd php7.1-mysql php7.1-mcrypt php7.1-curl php7.1-mbstring php7.1-opcache php7.1-json 

Change few default PHP settings:

sudo sed -i "s/memory_limit = .*/memory_limit = 256M/" /etc/php/7.1/fpm/php.ini
sudo sed -i "s/upload_max_filesize = .*/upload_max_filesize = 128M/" /etc/php/7.1/fpm/php.ini
sudo sed -i "s/zlib.output_compression = .*/zlib.output_compression = on/" /etc/php/7.1/fpm/php.ini
sudo sed -i "s/max_execution_time = .*/max_execution_time = 18000/" /etc/php/7.1/fpm/php.ini

PHP-FPM process manager has three choices: Static, Dynamic and Ondemand. The default setting for the process manager is “dynamic”, we will change it to “ondemand”.
Rename the default FPM  pool configuration file and create a new one:

sudo mv /etc/php/7.1/fpm/pool.d/www.conf /etc/php/7.1/fpm/pool.d/www.conf.org
sudo nano /etc/php/7.1/fpm/pool.d/www.conf
[www]
user = www-data
group = www-data
listen = /run/php/php7.1-fpm.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0666
pm = ondemand
pm.max_children = 5
pm.process_idle_timeout = 10s
pm.max_requests = 200
chdir = /

Restart PHP-FPM:

sudo systemctl restart php7.1-fpm 

4. Install and configure Nginx

Install Nginx from the official Debian repositories:

sudo apt -y install nginx

Create a new Nginx server block with the following content:

nano /etc/nginx/sites-available/example.com
server {
  server_name example.com;
  listen 80;
  root /var/www/html/example.com;
  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log;
  index index.php;

  location / {
    try_files $uri $uri/ /index.php?q=$uri&$args;
  }

  location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
    access_log off;
    expires max;
  }

  location ~ /\.ht {
    deny  all;
  }

  location ~ \.php$ {
    fastcgi_index index.php;
    fastcgi_keep_conn on;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/run/php/php7.1-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }
}

Activate the server block by creating a symlink:

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com

Test the Nginx configuration and restart the server by running the following commands:

sudo nginx -t
sudo systemctl restart nginx

5. Install WordPress

Create a new directory for your WordPress site:

sudo mkdir -p /var/www/html/example.com

Download and extract the WordPress package:

wget -q -O - http://wordpress.org/latest.tar.gz | sudo tar -xzf - --strip 1 -C /var/www/html/example.com

Set the correct permissions:

sudo chown www-data: -R /var/www/html/example.com

Finally, run the WordPress installation script by accessing the URL in your web browser of choice. http://example.com/, enter the details for the database we created earlier in this post and create your WordPress admin user.


Of course, you don’t have to Install WordPress with PHP 7.1 and Nginx on Debian 9 if you use one of our WordPress Maintenance Services, in which case you can simply ask our expert Linux admins to Install WordPress with PHP 7.1 and Nginx on Debian 9 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 WordPress with PHP 7.1 and Nginx on Debian 9, 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 WordPress with PHP 7.1 and Nginx on Debian 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-wordpress-with-php-7-1-and-nginx-on-a-debian-9-vps/feed/ 3
How to install phpBB on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-phpbb-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-phpbb-on-ubuntu-16-04/#respond Wed, 19 Jul 2017 15:14:11 +0000 https://linuxhostsupport.com/blog/?p=149 phpBB is an open source bulletin board forum software that provides a virtual space for discussion among the members of your website. It has a huge variety of features like flat topic structure, sub-forums, forum-specific styles, user groups, group-based permissions, database query and template caching, support for PHP 7, multiple database engines and much more. […]

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

]]>
phpBB is an open source bulletin board forum software that provides a virtual space for discussion among the members of your website. It has a huge variety of features like flat topic structure, sub-forums, forum-specific styles, user groups, group-based permissions, database query and template caching, support for PHP 7, multiple database engines and much more. With phpBB’s extensive features you can create your own forum in a matter of minutes and what’s most important, it’s completely free.

In this tutorial, we will show you how to install phpBB on an Ubuntu 16.04 VPS.

Installing the LAMP stack

First login as root so we don’t have to type sudo in front of every command:

# sudo su

Make sure your packages are up to date:

# apt-get update

Now run this command to install the LAMP stack with PHP7:

# apt-get -y install apache2 mysql-server mysql-client libapache2-mod-php7.0 php7.0-mysql php7.0-gd imagemagick unzip

Creating a database for phpBB

Log in to the MySQL server:

# mysql

Create a blank database for phpBB to use:

mysql> create database phpBB;

Create the database user, make sure to change the password randomgeneratedpassword with your own password.

mysql> create user 'phpBB_dbuser'@'localhost' identified by 'randomgeneratedpassword';

Grant all privileges to the user on the phpBB database:

mysql> grant all privileges on phpBB.* to 'phpBB_dbuser'@'localhost';

Apply the privileges we just gave to the user to the server:

mysql> flush privileges;

Installing phpBB

Change to Apache’s document root directory:

# cd /var/www/html

Delete Apache default files(You should skip this step if you have another site’s contents in this directory and install phpBB in a separate directory instead):

# rm -rf ./*

Download the latest phpBB version to your server(At the time of writing 3.2.0 is the latest version of phpBB):

# wget https://www.phpbb.com/files/release/phpBB-3.2.0.zip

Extract phpBB to the current directory:

# unzip phpBB-3.2.0.zip

Delete the archive file as we no longer need it:

# rm phpBB-3.2.0.zip

Move all the contents from the extracted directory to the current directory(Skip this step and the next step if you have another site’s contents in the /var/www/html directory):

# mv ./phpBB3/* .

Delete the empty phpBB3 directory:

# rm -rf ./phpBB3

Note: If you installed phpBB in a separate directory you can type in the following command if you want to rename the phpBB3 directory to something else like forum so phpBB would be accessible at http://yourdomain.com/forum:

# mv ./phpBB3 ./forum

Change the owner to the www-data user for all the files and sub-directories in /var/www/html:

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

If you installed phpBB in a separate directory make sure to change your working directory to that directory:

cd /var/www/html/your_phpBB_directory

Note: Replace your_phpBB_directory with the directory you installed phpBB in.

Give appropriate permissions to the config file and the following directories:

# chmod 660 images/avatars/upload/ config.php
# chmod 770 store/ cache/ files/

Completing the installation

Using your browser, go to http://yourdomain.com/install or if you installed phpBB in a separate directory http://yourdomain.com/your_phpBB_directory/install.
Click the INSTALL tab and then click the Install button.phpBB will ask you for credentials, be sure to substitute these credentials for your own:

Administrator username: admin
Contact email address: admin@yourdomain.com
Administrator password: admin_test1234-
Confirm administrator password: same as above

Click Submit when you are done.
Note: Make sure to use a secure password with at least 8 characters, 1 uppercase letter, 1 special character, and alphanumeric characters.

Now phpBB will ask you for details regarding your database, here’s our example:

Database Type: MySQL with MySQLi Extension
Database server hostname or DSN: localhost
Database server port: leave blank
Database username: phpBB_dbuser
Database password: randomgeneratedpassword
Database name: phpBB
Prefix for tables in database: phpbb_

Click Submit again.

In the next step, you should set up options according to your preference like providing your domain name or whether you would like to force SSL.After this step, you will be taken to the SMTP configuration page, if you don’t have an SMTP server you can leave this page as it is and click Submit to continue. Click Install again and wait for the installer to finish.When the installer finishes installing phpBB you can click the take me to the ACP link and set up your new phpBB installation.

That’s it, now you should have phpBB installed on your server.

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

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

 

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

]]>
https://linuxhostsupport.com/blog/how-to-install-phpbb-on-ubuntu-16-04/feed/ 0
How to install SilverStripe CMS on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-silverstripe-cms-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-silverstripe-cms-on-ubuntu-16-04/#comments Wed, 12 Jul 2017 12:20:52 +0000 https://linuxhostsupport.com/blog/?p=142 Today, we will show you how to install SilverStripe on an Ubuntu 16.04 VPS using the Apache web-server and a MySQL database. SilverStripe is popular and widely-used open source CMS. It uses the SilverStripe framework (previously Sapphire Framework). Because of the framework, developers can easily customize and extend the CMS and make it their own. […]

The post How to install SilverStripe CMS on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
Today, we will show you how to install SilverStripe on an Ubuntu 16.04 VPS using the Apache web-server and a MySQL database.

SilverStripe is popular and widely-used open source CMS. It uses the SilverStripe framework (previously Sapphire Framework). Because of the framework, developers can easily customize and extend the CMS and make it their own. With SilverStripe, you can create websites and applications with ease. It has all the features you’d need in a CMS. SilverStripe is a popular choice when looking for an alternative CMS to WordPress. It is fairly easy to install SilverStripe on an Ubuntu 16.04 VPS. The installation process should take about 5-10 minutes if you follow the very easy steps described below.

Requirements

At the time of writing this tutorial, SilverStripe 3.6.1 is the latest stable version available and it requires:

– Apache web server;
– PHP (5.3.3+, <7.2) along with the mbstring, curl, zip, bcmath, xml, tidy, gd and mcrypt extensions. They are most generally active by default on a standard php installation.
– MySQL(version 5.0 or higher) installed on your Linux VPS;

First of all login to your Ubuntu 16.04 VPS via SSH as user root

ssh root@IP_address

At the very beginning, it is best to start a screen session by executing the following command

screen -U -S sstripe

Update the system:

apt-get update && apt-get -y upgrade

Make sure to always keep your server up to date.

Install MariaDB 10.0

To install MariaDB, run the following command:

apt-get install -y mariadb-server

Next, we need to create a database for our Silverstripe installation.

mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE sstripe;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON sstripe.* TO 'sstripe'@'localhost' IDENTIFIED BY 'your-password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Do not forget to replace ‘your-password’ with a strong password.

Install Apache2 web server

[user]$ sudo apt-get install apache2

Install PHP and required PHP modules

To install the latest stable version of PHP version 7 and all necessary modules, run:

[user]$ sudo apt-get install php7.0 libapache2-mod-php7.0 php7.0-mbstring php7.0-curl php7.0-zip php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-bcmath php7.0-xml php7.0-json php7.0-tidy

Enable the Apache2 rewrite module if it is not already done:

[user]$ sudo a2enmod rewrite

In order to activate the new configuration, restart the Apache web server using the following command:

[user]$ sudo service apache2 restart

Download and install SilverStripe

Download and extract the latest version of SilverStripe on your server:

[user]$ sudo cd /opt && wget https://silverstripe-ssorg-releases.s3.amazonaws.com/sssites-ssorg-prod/assets/releases/SilverStripe-cms-v3.6.1.zip
[user]$ sudo unzip SilverStripe-cms-v3.6.1.zip -d sstripe
[user]$ sudo mv sstripe/ /var/www/html/sstripe

All files have to be readable by the web server, so we need to set a proper ownership

[user]$ sudo chown www-data:www-data -R /var/www/html/sstripe/

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

[user]$ sudo touch /etc/apache2/sites-available/sstripe.conf
[user]$ sudo ln -s /etc/apache2/sites-available/sstripe.conf /etc/apache2/sites-enabled/sstripe.conf
[user]$ sudo nano /etc/apache2/sites-available/sstripe.conf

Then, add the following lines:

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

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

[user]$ sudo service apache2 restart

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

That is it. The SilverStripe installation is now complete.

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

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

 

The post How to install SilverStripe CMS on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-silverstripe-cms-on-ubuntu-16-04/feed/ 1
How to Clean the Mail Queue in Exim https://linuxhostsupport.com/blog/how-to-clean-the-mail-queue-in-exim/ https://linuxhostsupport.com/blog/how-to-clean-the-mail-queue-in-exim/#comments Wed, 28 Jun 2017 12:08:04 +0000 https://linuxhostsupport.com/blog/?p=138 In this tutorial, we will take a look at how we can clean our mail queue in Exim. Exim is a free and versatile mail transfer agent (MTA) that has been ported to most Unix-like systems and is currently the default for a few Linux distributions, most popular being the Debian Linux distribution. Exim is […]

The post How to Clean the Mail Queue in Exim appeared first on LinuxHostSupport.

]]>
In this tutorial, we will take a look at how we can clean our mail queue in Exim. Exim is a free and versatile mail transfer agent (MTA) that has been ported to most Unix-like systems and is currently the default for a few Linux distributions, most popular being the Debian Linux distribution. Exim is widely used around the world, and it is estimated that around 56% of the publicly available servers on the internet use Exim as their mail transfer agent.

Checking Exim’s mail queue

First let’s see if there are any specific messages we want to delete, type in the following command:

# exim -bp

This command lists all the messages in the queue with their respective message id’s, a message returned by this command looks like this:

18h 2.1K 1dMX7a-0001rT-I2 <> *** frozen ***
         root@somehost.com

The command to delete a message in Exim is:

# exim -Mrm <message-id>

So, if we want to delete the message in the example above we type in:

# exim -Mrm 1dMX7a-0001rT-I2

Cleaning Exim’s mail queue

Let’s say you have a lot of messages in your mail queue that were generated by a spam script and you want to clear your queue entirely without sending any messages, this can be done with:

# exim -bp | exiqgrep -i | xargs exim -Mrm

As we’ve seen above, the first command (exim -bp) lists all the messages we have in the mail queue, the second command (exiqgrep -i) grabs only the message id’s from the first command and the third command (xargs exim -Mrm) passes the message id’s returned from the second command to the command (exim -Mrm) that is used to delete messages from the queue.

Sometimes you may have mail in the queue that is legitimate that the mail server couldn’t send because of various reasons and you may want to force the mail server to send this mail once the problem is resolved, this is done by using the following command:

# exim -qff

This will force Exim to send every message in the mail queue regardless of whether it is frozen or not.

That’s it, you have now successfully cleaned your mail queue.

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

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

The post How to Clean the Mail Queue in Exim appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-clean-the-mail-queue-in-exim/feed/ 1
What is Help Desk Support? https://linuxhostsupport.com/blog/what-is-help-desk-support/ https://linuxhostsupport.com/blog/what-is-help-desk-support/#respond Wed, 21 Jun 2017 14:11:07 +0000 https://linuxhostsupport.com/blog/?p=128 Help desk support, most commonly, is a way of providing IT support to end-users (customers). For Linux server management companies, help desk support often involves resolving issues related to a customer’s Linux server or a service running on that Linux server. To help you understand what help desk support is, we’ll answer a few frequently […]

The post What is Help Desk Support? appeared first on LinuxHostSupport.

]]>
Help desk support, most commonly, is a way of providing IT support to end-users (customers). For Linux server management companies, help desk support often involves resolving issues related to a customer’s Linux server or a service running on that Linux server. To help you understand what help desk support is, we’ll answer a few frequently asked questions related to help desk support.

How is help desk support implemented?

Depends on a particular business or service provider, but most often than not, help desk support is implemented via a “client area” where clients and customers can post tickets and request technical (help desk) support from the provider. Help desk support can also be provided via phone or in person, but the most common way of implementing helpdesk support, especially in IT, is via email (tickets) and online live chat.

Do I really need help desk support?

Yes! Even if you are experienced in the software/service you’re using, it’s still nice to have someone to fall back on when you get stuck. A professional technical support team can always come in handy when you’re running into issues you cannot solve.

If you’re new to the software/service you are using, then you definitely need help desk support.

How do I check if someone offers help desk support?

Most (if not all) companies with commercial software or commercial services offer 24/7 technical (helpdesk) support. You can always check their website for any support/helpdesk/client/contact areas.

Some companies offer professional (outsourced) help desk support on a per-incident basis. You can use those kinds of services if you use a service or an app that doesn’t have official technical support, or if they have an incompetent technical support team.

Example: we offer Linux server management services and Linux server support. If you own a Linux server and need help with it, you can use our support services and we’ll help you with your Linux server, regardless of where you’ve purchased the Linux server from.

What are the benefits of using helpdesk support?

There are quite a lot of benefits to it, but we’ll go over the main ones:

  • Support by professionals. Every helpdesk support team is experienced and trained in what they are offering support for, so you know you’ll always get professional help from people that know what they are doing.
  • Help when you need it. Most companies offer 24/7 support. However, some companies don’t offer 24/7 support and their wait times can be quite lengthy, so always choose providers that offer 24/7 support. If they don’t and you still decide to use them, you can always use outsourced support or get support by a third-party.
  • Saves you money. By using the company’s (or an outsourced) helpdesk support, you take away the need of having a dedicated technical support team for your company only. Finding the right employees and training them for the products/services you are using can be both costly and difficult to do.

Knowing all of that, it should be clear what help desk support is and other basics you need to know about help desk support.

If you want to learn, what server management is, read this.

 

The post What is Help Desk Support? appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/what-is-help-desk-support/feed/ 0
How to Install Postal Mail Server on an Ubuntu 16.04 VPS https://linuxhostsupport.com/blog/how-to-install-postal-mail-server-on-an-ubuntu-16-04-vps/ https://linuxhostsupport.com/blog/how-to-install-postal-mail-server-on-an-ubuntu-16-04-vps/#comments Wed, 14 Jun 2017 12:12:02 +0000 https://linuxhostsupport.com/blog/?p=121 We’ll show you, How to Install Postal Mail Server on an Ubuntu 16.04 VPS. Postal is a feature-rich mail server application widely used as an alternative to Sendgrid, Mailchimp, Mailgun and other similar SMPT servers. You can use Postal to send out bulk emails, newsletters etc. This guide should work on other Linux VPS systems […]

The post How to Install Postal Mail Server on an Ubuntu 16.04 VPS appeared first on LinuxHostSupport.

]]>
We’ll show you, How to Install Postal Mail Server on an Ubuntu 16.04 VPS. Postal is a feature-rich mail server application widely used as an alternative to Sendgrid, Mailchimp, Mailgun and other similar SMPT servers. You can use Postal to send out bulk emails, newsletters etc. This guide should work on other Linux VPS systems as well but it was tested and written for an Ubuntu 16.04 VPS.

Requirements

There are some requirements for this Postal setup.

  • An Ubuntu VPS
  • Ruby version 2.3 or up, MySQL/MariaDB, RabbitMQ, Node.js and Git installed on your server

If you get one of our Managed Linux VPS hosting plans, we’ll install all requirements and set up your server with Postal.

1. Install Basic Packages and Dependencies

First, install some packages and dependencies on your system, including nginx, mariadb, git etc.

[user]$ sudo apt-get install python-software-properties  software-properties-common
[user]$ sudo apt-get install git nginx mariadb-server build-essential libmysqlclient-dev

2. Install Node.js

Next, install the latest version of Node.js on your system. To install the latest (7.x) version, use the following command:

[user]$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
[user]$ sudo apt-get install nodejs

3. Install Ruby 2.3

After Nodejs, we need to install Ruby and add the Ruby PPAs:

[user]$ sudo apt-add-repository ppa:brightbox/ruby-ng -y
[user]$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

Next, install Ruby 2.3:

[user]$ sudo apt-get update
[user]$ sudo apt-get install -y ruby2.3 ruby2.3-dev

4. Install RabbitMQ Server

RabbitMQ will be used for messaging, so enable the Erlang PPA with the following command:

[user]$ wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
[user]$ sudo dpkg -i erlang-solutions_1.0_all.deb

You also need to enable the RabbitMQ server PPA:

[user]$ echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list
[user]$ wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -

Next, you can install the RabbitMQ server along with its dependencies:

[user]$ sudo apt-get update
[user]$ sudo apt-get install erlang erlang-nox rabbitmq-server

5. Create Database in MySQL

Create a database and user for your Postal mail server and grant permissions to the user:

[user]$ mysql -u root -p
Enter password:*******
mysql> CREATE DATABASE postal CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql> GRANT ALL ON `postal`.* TO `postal`@`127.0.0.1` IDENTIFIED BY "passw0rd";
mysql> GRANT ALL ON `postal-%`.* TO `postal`@`127.0.0.1` IDENTIFIED BY "passw0rd";
mysql> FLUSH PRIVILEGES;

Always use a strong password.

6. Create RabbitMQ VirtualHost

Next, create a VirtualHost in your RabbitMQ server and create a new user for your app

[user]$ rabbitmqctl add_vhost /postal
[user]$ rabbitmqctl add_user postal passw0rd
[user]$ rabbitmqctl set_permissions -p /postal postal ".*" ".*" ".*"

7. Install and configure Postal Mail Server

Now that we finished with the prerequesities we can move on to the actual Postal setup. First, we’re gonna start with creating a user(account) named ‘postal’

[user]$ sudo useradd -r -m -d /opt/postal -s /bin/bash postal
[user]$ sudo setcap 'cap_net_bind_service=+ep' /usr/bin/ruby2.3

Next, clone the source code from the Postal GitHub repo and add a soft link to the Postal binary file:

[user]$ sudo -i -u postal git clone https://github.com/atech/postal /opt/postal/app
[user]$ ln -s /opt/postal/app/bin/postal /usr/bin/postal

To configure Postal, you need to install bundler and procodile. Do that with the following command:

[user]$ sudo gem install procodile bundler

To finish with all the installs, switch to the portal user:

[user]$ su - postal
[user]$ postal bundle /opt/postal/app/vendor/bundle
[user]$ postal initialize-config
[user]$ postal initialize

And open your postal.yml file from /opt/postal/config and update it according to your setup.

Run Postal in the background with the following command:

[user]$ postal start

8. Create Postal Admin User

To create the first Postal administrator account, run make-user:

[user]$ postal make-user

Postal User Creator
Enter the information required to create a new Postal user.
This tool is usually only used to create your initial admin user.

E-Mail Address : admin@linuxhostsupport.com
First Name : LinuxHostSupport
Last Name : Admin
Initial Password: : *********

User has been created with e-mail address admin@linuxhostsupport.com

Again, use a strong password!

9. Check Postal Running Status

Now your Postal is successfully installed, configured and running. Check its status with the following command:

[user]$ postal status

Make sure all services are running and working properly.

10. Configure Nginx with Postal

Postal comes with its own configuration file. You can copy the cfg file to your nginx directory. Replace the default configuration file or create a new one.

[user]$ cp /opt/postal/app/resource/nginx.cfg /etc/nginx/sites-available/default

By default, Postal only works with SSL. You can use a self-signed SSL.

[user]$ sudo mkdir /etc/nginx/ssl/
[user]$ sudo cd /etc/nginx/ssl/
[user]$  openssl req -x509 -nodes -newkey rsa:4096 -keyout postal.key -out postal.crt

Finally, restart nginx for the changes to take effect.

[user]$ sudo service nginx reload

Now you can access the Postal dashboard via https. Use the details from step 8.

That is it. The Postal installation is now complete.

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

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

 

The post How to Install Postal Mail Server on an Ubuntu 16.04 VPS appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-postal-mail-server-on-an-ubuntu-16-04-vps/feed/ 1
What is Server Management? https://linuxhostsupport.com/blog/what-is-server-management/ https://linuxhostsupport.com/blog/what-is-server-management/#comments Wed, 07 Jun 2017 13:49:24 +0000 https://linuxhostsupport.com/blog/?p=100 We’ll explain to you, What is Server Management? Like many other terms in the server management and managed services industry, server management is vaguely used and can mean different things when used by different server management service providers. Some companies may offer a set of managed support services in their server management plan, but a different […]

The post What is Server Management? appeared first on LinuxHostSupport.

]]>
We’ll explain to you, What is Server Management? Like many other terms in the server management and managed services industry, server management is vaguely used and can mean different things when used by different server management service providers.

Some companies may offer a set of managed support services in their server management plan, but a different company may offer a completely different set of services. Although there are some guidelines and definitions that still hold true for any managed service provider.

This article will guide you through what server management is, who needs it and why you should use it. After our intro, you should have a solid understanding of the basics.

Broad definition of server management

Server management can be defined as the tasks and services that are done on a server in order to manage it. This usually entails:

  • Monitoring of the server and apps running on the server. Checking their status, uptime, and monitoring for any new or recurring issues.
  • Updating the server and software installed on the server. Although most server management companies offer this as part of their services, some still don’t. Nevertheless, it’s still considered as part of the ‘server management’ process.
  • Setup and configuration. The actual server setup and configuration of software and services running on the server. Again, this may not be a part of the server management plan offered by some companies, but it most often is.
  • Other. This is where the issue in defining what server management actually is arises. Every provider offers totally different services, although they are still considered as part of the server management process, they are not the same among several different providers and thus cannot be considered as the “default” definition of server management.

As an example, you can check our Server Management Services.

Who needs and uses server management?

Everyone that owns a server needs server management. Some people do the server management themselves (often called “self-managed”), and some people get professional server management services.

The most common users of managed service providers are:

  • Companies.
  • Web Developers and Web Designers.
  • Beginners that own servers.
  • Anyone that likes to leave the server worries to someone else.

There are many benefits of using server management services (listed below) and anyone should and can use such services.

Why you should use server management services?

The reasons why you should use server management services are the same with the actual benefits of using them.

What is Server Management

Benefits of server management services

  • Server work done right, by experts. You should always leave the server work to professionals that do it on a daily basis and have the experience, skills, and know-how of managing servers. That way you get your peace of mind knowing that your server is managed properly by people who know what they are doing.
  • Fewer costs. Instead of hiring a full-time system administrator (which can be quite costly), you can get a server management plan and save hundreds (if not thousands) of dollars on a monthly basis. Some server providers offer a ‘managed service’ as an add-on to their servers, but it often is much more expensive than getting managed services from a 3-rd party provider.
  • Fewer worries. Why should you worry about updates and security of your server 24/7 when you can have experts taking care of your server? No need to stay updated on the latest security patches and releases, your server will be taken care of.
  • Quick(er) turnaround time. Depending on the provider itself and the experience of the sysadmins involved, the turnaround time for server issues and tasks is fairly quick. So instead of wasting hours on troubleshooting and research, you can have experts work on your server and fix any issues in a matter of minutes. This still depends on the severity and complexity of the issue itself, but when compared, having expert server managers working on your server is far quicker than doing it yourself.
  • 24/7 availability. Most server management companies are available 24/7 (at least we are) and this is closely related to the quick turnaround time. It’s 3 AM in the middle of the night on a Saturday? No problem. We are available and ready to help.

Knowing what server management is and the benefits of using it, you should seriously consider getting a monthly server management plan, and experience the benefits yourself.

 

The post What is Server Management? appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/what-is-server-management/feed/ 5
Virtual Users and Domains with Sendmail on Ubuntu 16.04 https://linuxhostsupport.com/blog/virtual-users-and-domains-with-sendmail-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/virtual-users-and-domains-with-sendmail-on-ubuntu-16-04/#respond Wed, 24 May 2017 14:55:50 +0000 https://linuxhostsupport.com/blog/?p=93 In this tutorial, we will show you how to configure Sendmail to use a virtual user table that’ll allow us to set up user-specific, domain-wide email aliases with multiple domains on our server. This guide should work on other Linux VPS systems as well but was tested and written for  Ubuntu 16.04. Configuring Sendmail to […]

The post Virtual Users and Domains with Sendmail on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to configure Sendmail to use a virtual user table that’ll allow us to set up user-specific, domain-wide email aliases with multiple domains on our server. This guide should work on other Linux VPS systems as well but was tested and written for  Ubuntu 16.04.

Configuring Sendmail to use our domains

Let’s begin by first checking if our server is configured to accept mail for the domains we want to set up aliases for:

# cat /etc/mail/local-host-names
test1.com
test2.com

In our case, the domains we want to set up email aliases for are test1.com and test2.com.
Make sure you have your domain’s MX records pointing to your VPS hostname before you configure Sendmail to use them.

Now if the user we wish to add an email alias to doesn’t exist on our server, we can create the user and set a password for the user by typing in the following commands:

# useradd testuser
# passwd testuser

Then we configure Sendmail to use the virtual user table by editing sendmail.mc and by entering in the following lines:

# nano /etc/mail/sendmail.mc
FEATURE(`virtusertable')dnl
VIRTUSER_DOMAIN_FILE(`-o /etc/mail/virtuserdomain')dnl

Make sure these lines are added before the MAILER() line, otherwise Sendmail will return a warning/error on compilation.

Next, we compile the Sendmail configuration by typing in the following commands:

# make
# sendmailconfig

The command sendmailmenuconfig will ask you a few questions whether you want to use the new configuration and reload it, answer y(or yes) on all.

Creating the virtual user table and mapping users to our domains

Now create the /etc/mail/virtuserdomain file by opening it with an editor and add your domains, our preferred editor is nano due to its simplicity:

# nano /etc/mail/virtuserdomain
test1.com
test2.com

Now let’s open the /etc/mail/virtusertable file and add the email aliases for our user:

# nano /etc/mail/virtusertable
testuser@test1.com   testuser
testuser@test2.com   testuser@someremotedomain.com

Let me explain what we did here, we added an email alias for testuser using the domain name test1.com and mapped it to the local mailbox of testuser and we also added an email alias for testuser using the domain name test2.com and mapped it to a remote email address(testuser@someremotedomain.com). These are some of the cool options virtusertable offers. You can also map an entire domain name to an email address or local mailbox the same way, except you would leave out the user portion of the first part of the address like this:

@test1.com   testuser
@test2.com   testuser@someremotedomain.com

And then we close the file and enter the following commands:

# makemap hash virtusertable < virtusertable
# /etc/init.d/sendmail reload

Create outgoing email aliases

Now if we want to create outgoing email addresses for our users we need to edit the sendmail.cf file first and add the following lines:

FEATURE(masquerade_envelope)
FEATURE(genericstable, `hash -o /etc/mail/genericstable')
GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')

Then we need to create the /etc/mail/genericstable file and edit it to contain our local users which will be mapped to the desired addresses:

testuser   testuser@test1.com
testuser2   testuser2@test1.com

And now we create the /etc/mail/generics-domains file containing the FQDN(fully qualified domain name) of the local mail server:

mail.test1.com

Finally, we will complete the procedure by generating new Sendmail configuration files with the following commands:

# make
# sendmailconfig

Again, answer yes to all the questions the sendmailconfig command asks you.
Note: Remember to replace the user and domain examples given in this tutorial with the names of your actual users and domains.

Of course, you don’t have to do any of this if you use one of our Service Configuration & Optimization Services, in which case you can simply ask our expert Linux admins to set up a mail server for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, about Virtual Users and Domains with Sendmail on Ubuntu 16.04, please share it with your friends on the social networks using the buttons on the left or simply leave a comment in the Comments Section below. Thanks.

The post Virtual Users and Domains with Sendmail on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/virtual-users-and-domains-with-sendmail-on-ubuntu-16-04/feed/ 0
How to Install Sentora on Debian 8 https://linuxhostsupport.com/blog/how-to-install-sentora-on-debian-8/ https://linuxhostsupport.com/blog/how-to-install-sentora-on-debian-8/#respond Wed, 17 May 2017 12:18:22 +0000 https://linuxhostsupport.com/blog/?p=82 In this tutorial, we will show you how to install Sentora on a Debian 8 VPS. Sentora is a web-based hosting control panel which is very easy to install and use. Let’s start with the installation. Make sure your server Ubuntu OS packages are fully up-to-date: apt-get update apt-get upgrade Install the required packages: sudo […]

The post How to Install Sentora on Debian 8 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to install Sentora on a Debian 8 VPS.
Sentora is a web-based hosting control panel which is very easy to install and use.

Let’s start with the installation.

Make sure your server Ubuntu OS packages are fully up-to-date:

apt-get update 
apt-get upgrade

Install the required packages:

sudo apt-get install ca-certificates wget nano dbconfig-common sqlite3 postfix dovecot-imapd dovecot-lmtpd dovecot-pop3d dovecot-sqlite

Download the latest version of Sentora installation script and run it:

bash <(curl -L -Ss https://raw.githubusercontent.com/sentora/sentora-installers/master/sentora_install.sh)
  • Select the geographic area in which you live so that time zone rules can be set correctly and click ‘Ok’.
  • Select the city or region corresponding to your time zone.
  • Enter the sub-domain you want to access Sentora panel: (for example: sentora.yourdomain.com)
  • Enter (or confirm) the public IP for this server.
  • All is ok. Do you want to install Sentora now (y/n)? y

Wait a few minutes for the installation to complete.

########################################################
Congratulations Sentora has now been installed on your
server. Please review the log file left in /root/ for
any errors encountered during installation.

Login to Sentora at http://sentora.yourdomain.com
Sentora Username  : zadmin
Sentora Password  : eXBisXF546rVJg

MySQL Root Password      : YC2bTRFU6otwKf
MySQL Postfix Password   : SYY4psDHHpNuYm
MySQL ProFTPd Password   : xjfxmOBfaIEq0H
MySQL Roundcube Password : lNoV7zFw0mjiA6
(theses passwords are saved in /root/passwords.txt)
########################################################

Restart your server now to complete the install (y/n)? n

Install the postfix-mysql package using the following command:

apt-get install postfix-mysql

Also, set the postfix daemon directory using:

postconf -e "daemon_directory=/usr/lib/postfix"

Restart the server:

shutdown -r now

That is it. The Sentora installation is now complete.

Log in to Sentora control panel at http://sentora.yourdomain.com and start using it.

sentora back end

Listed below are some basic usage scenarios:

  • Start BIND

To start BIND (named service),  go to Admin >> Module Admin >> DNS Config >> Services >> Start Service >> click ‘GO’.

  • Add a new domain:

Go to Domain >> Create a new domain >> enter your domain name

Home directory:     Create a new home directory and click ‘Create’.

  • Add a new email account:

Go to Mail >> Mailboxes >> Create a new mailbox >> Email Address >> enter your email address and password and click ‘Create’.

If you receive an error message like this one:

The selected domain was not valid

Edit the /etc/sentora/panel/modules/mailboxes/code/controller.ext.php file and change:

if(!self::IsValidDomain($domain))

to:

if(self::IsValidDomain($domain))
  • Configure the FTP module:

Go to Admin >> Module Admin >> FTP config >> Configure your FTP Settings

FTP Config File: /etc/proftpd/proftpd.conf

Click ‘Save Changes’.

  • Create a new FTP account with full access to yourdomain.com directory.

Go to File >> FTP Accounts >> Current FTP accounts >> enter username and password

Access type >> Full access

Home directory >> Use Domain directory /yourdomain.com

Click ‘Create’.

  • Create a new MySQL database

Go to Database >> MySQL database >> Create a new MySQL database , enter your new database name and click ‘Create’.

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

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

 

The post How to Install Sentora on Debian 8 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-sentora-on-debian-8/feed/ 0
How to Prevent XML-RPC Attacks on your WordPress site https://linuxhostsupport.com/blog/how-to-prevent-xml-rpc-attacks-on-your-wordpress-site/ https://linuxhostsupport.com/blog/how-to-prevent-xml-rpc-attacks-on-your-wordpress-site/#comments Wed, 10 May 2017 15:02:39 +0000 https://linuxhostsupport.com/blog/?p=77 The global popularity of WordPress makes it a juicy target for all types of hackers. One of the most common attacks on WordPress is the XML-RPC attack. In this tutorial, we’ll learn what XML-RPC is and how to block XML-RPC attacks. What is XML-RPC attack? XML-RPC is a remote procedure call that uses XML for […]

The post How to Prevent XML-RPC Attacks on your WordPress site appeared first on LinuxHostSupport.

]]>
The global popularity of WordPress makes it a juicy target for all types of hackers. One of the most common attacks on WordPress is the XML-RPC attack. In this tutorial, we’ll learn what XML-RPC is and how to block XML-RPC attacks.

What is XML-RPC attack?

XML-RPC is a remote procedure call that uses XML for encoding and HTTP for transport. WordPress is using XML-RPC for information exchange between clients on the network.
Using this functionality, the attacker can send thousands of brute-force attacks against your WordPress site in a very short time period.
The attacker will try to log in using the xmlrpc.php script with random username/password combinations many times per minute, thus affecting the brute-force attack on your WordPress site.
Another problem is that xmlrpc.php also allows the attacker to guess hundreds of password combinations using only several HTTP requests. This would also lead to a very high database load.
This could also bring your site down, displaying the “Error establishing database connection” error.

How to block XML-RPC attack?

There are several ways to block XML-RPC attacks.

1. Install one of many WordPress plugins that deal with XML-RPC

You can find a lot of plugins that do that. Like the ones on this page.

2. Block all xmlrpc.php requests in WordPress

If you’re running on an Apache web server, you can do that by inserting the following code in the .htaccess file in your WordPress website’s document root:

< Files xmlrpc.php >
order deny,allow
deny from all
< /Files >

3. Block xmlrpc.php in the Apache/Nginx configuration file

If you’re using Apache, do that by inserting the following code in your Apache configuration file:

< VirtualHost >
----------
< files xmlrpc.php >
order allow,deny
deny from all
< /files >
< /VirtualHost >

If you’re using Nginx, block xmlrpc.php by inserting the following code in your Nginx configuration file:

server {
-----------
location /xmlrpc.php {
deny all;
}
}

How to search for and find XML-RPC attacks in different Linux distributions?

On CentOS with Apache:

# grep xmlrpc /var/logs/httpd/access.log

On Ubuntu with Apache:

# grep xmlrpc /var/logs/apache2/access.log

For a server with Nginx:

# grep xmlrpc /var/logs/nginx/access.log

For a server with cPanel:

# grep xmlrpc /home/username/logs/access.log

If your WordPress site is under attack, the result of the previous commands would be similar to the following:

“POST /xmlrpc.php HTTP/1.0” 200 674 “-” “Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)”

Of course, you don’t have to do any of this if you use one of our Server Security Patches and Updates Services, in which case you can simply ask our expert Linux admins to secure WordPress and prevent XML-RPC attacks 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 comment below. Thanks.

The post How to Prevent XML-RPC Attacks on your WordPress site appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-prevent-xml-rpc-attacks-on-your-wordpress-site/feed/ 1
How To Upgrade Your Ubuntu VPS to 16.04 LTS https://linuxhostsupport.com/blog/upgrade-ubuntu-vps-to-16-04-lts/ https://linuxhostsupport.com/blog/upgrade-ubuntu-vps-to-16-04-lts/#comments Wed, 03 May 2017 12:15:11 +0000 https://linuxhostsupport.com/blog/?p=72 We’ll show you, How To Upgrade Your Ubuntu VPS to 16.04 LTS. When an Ubuntu OS release reaches its ‘end of life’ it receives no further maintenance updates, including critical security upgrades, so it is highly recommended to upgrade to the latest Ubuntu version. In this tutorial, we will show you how to upgrade your Ubuntu […]

The post How To Upgrade Your Ubuntu VPS to 16.04 LTS appeared first on LinuxHostSupport.

]]>
We’ll show you, How To Upgrade Your Ubuntu VPS to 16.04 LTS. When an Ubuntu OS release reaches its ‘end of life’ it receives no further maintenance updates, including critical security upgrades, so it is highly recommended to upgrade to the latest Ubuntu version. In this tutorial, we will show you how to upgrade your Ubuntu VPS from Ubuntu 14.04 LTS (Trusty Tahr) to Ubuntu 16.04 LTS version (Xenial Xerus), skipping the non-LTS releases in-between.

Important

Please note, it is recommended to backup your data including the MySQL databases and service configuration files before you continue to upgrade your server OS, because there is a risk of failure, misconfiguration of your server services or some data loss during the upgrade process. It’s highly important that you backup all your data before you proceed with the upgrade.

Upgrade at your own risk, or leave it to professionals to do it.

Log in to your virtual server and check the current OS version:

#cat /etc/issue
Ubuntu 14.04.5 LTS \n \l

Make sure your Ubuntu OS packages are up-to-date:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

Start the Ubuntu upgrade procedure

Install the update-manager-core package is if it is not installed on your server yet:

sudo apt-get install update-manager-core

Run:

sudo do-release-upgrade -d
...
Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Building data structures... Done

Calculating the changes

Calculating the changes

Do you want to start the upgrade?


9 installed packages are no longer supported by Canonical. You can
still get support from the community.

20 packages are going to be removed. 109 new packages are going to be
installed. 477 packages are going to be upgraded.

You have to download a total of 214 M. This download will take about
51 seconds with your connection.

Installing the upgrade can take several hours. Once the download has
finished, the process cannot be canceled.

 Continue [yN]  Details [d]

Enter ‘d’ to see more details on which packages are going to be removed and which new packages are going to be installed.

Enter ‘y’ to continue and to start the upgrade process.

During the upgrade process, you will be prompted to install new package maintainer’s configuration files or keep your current configuration files.

Enter ‘D’ to see the differences between the versions.

Enter ‘N’ to keep your current configuration file.

You may be prompted to restart some services on your server. Enter ‘yes’ to restart the specific service and continue the upgrade process.

Also, you will be prompted to remove obsolete packages, for example:

...
Searching for obsolete software
Reading package lists... Done
Building dependency tree
Reading state information... Done
Building data structures... Done
Building data structures... Done

Remove obsolete packages?


71 packages are going to be removed.

 Continue [yN]  Details [d]

Enter ‘d’ to check which packages are going to be removed.

Carefully go through the list and make sure you don’t need any of those packages. Enter ‘y’ to continue.

After the upgrade process is complete, you will be prompted to restart the server:

System upgrade is complete.

Restart required

To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.

Continue [yN]

Enter ‘y’ to restart the server.

Or, enter ‘N’, then restart your server using the command below:

shutdown -r now

Once the server is restarted, log in to the server and run the command below to check your Ubuntu version:

#cat /etc/issue
Ubuntu 16.04.2 LTS \n \l

That is it. Your server has been successfully upgraded to Ubuntu 16.04 (Xerial Xerus) LTS. The process is similar when upgrading any Ubuntu distro.

Of course you don’t have to do any of this if you use one of our Server Security Patches and Updates Services, in which case you can simply ask our expert Linux admins to upgrade the server OS 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 Your Ubuntu VPS to 16.04 LTS appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/upgrade-ubuntu-vps-to-16-04-lts/feed/ 3
How to install ownCloud 9 on Ubuntu https://linuxhostsupport.com/blog/how-to-install-owncloud-9-on-ubuntu/ https://linuxhostsupport.com/blog/how-to-install-owncloud-9-on-ubuntu/#respond Wed, 26 Apr 2017 14:13:20 +0000 https://linuxhostsupport.com/blog/?p=69 In today’s tutorial, we will explain how to install ownCloud 9.0 on a fresh Ubuntu 16.04 LTS installation. ownCloud is a self-hosted, open source, file sync and share app platform written in PHP. With ownCloud you can sync and access your files through a web interface, create contacts, calendars and bookmarks, easily share your data […]

The post How to install ownCloud 9 on Ubuntu appeared first on LinuxHostSupport.

]]>
In today’s tutorial, we will explain how to install ownCloud 9.0 on a fresh Ubuntu 16.04 LTS installation. ownCloud is a self-hosted, open source, file sync and share app platform written in PHP. With ownCloud you can sync and access your files through a web interface, create contacts, calendars and bookmarks, easily share your data across devices, preview and edit your text files, documents and images and much more. It’s a great alternative to Dropbox, Google Drive and similar file-sharing services.

Log in to your server as root

ssh user@vps_IP

and make sure that all packages are up to date:

sudo apt update && sudo apt -y upgrade

Add ownCloud Repository

We will install the owncloud package from the official ownCloud repository. owncloud is a meta package which will install multiple packages including apache2, PHP 7.0 and all necessary PHP modules, basically you will get a complete installation with all dependencies.

Run the following commands to add the ownCloud repository PGP key to your system:

sudo wget -nv https://download.owncloud.org/download/repositories/9.1/Ubuntu_16.04/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo rm -f Release.key

Add the ownCloud repository to your system using the following command:

echo 'deb http://download.owncloud.org/download/repositories/9.1/Ubuntu_16.04/ /' | sudo tee --append /etc/apt/sources.list.d/owncloud.list > /dev/null

Install ownCloud

The ownCloud installation is pretty straightforward, once the repository is added update the apt package index, install the owncloud package:

sudo apt update
sudo apt install owncloud

You can choose between SQLite, MYSQL/MariaDB and PostgreSQL. SQLite is the default database but it is not recommended for production, MariaDB which we will be using in this tutorial is the ownCloud recommended database.

Install the MariaDB package using the following command:

sudo apt-get install mariadb-server

When the installation is complete, run the following command to secure your installation:

mysql_secure_installation

Next, we need to create a database for our ownCloud installation.

mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE owncloud;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'my_strong_password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

To access the graphical ownCloud 9 installation wizard open the following URL in your browser http://your_ip_address/owncloud, enter the admin account username and password, select ‘MySQL/MariaDB’ and enter the database name, database user and password. Finally, click on the “Finish setup” button located on the bottom of the page.

That’s it. You have successfully installed ownCloud version 9 on your Ubuntu VPS.
For more information about how to manage your ownCloud installation, please refer to the ownCloud documentation.


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

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

The post How to install ownCloud 9 on Ubuntu appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-owncloud-9-on-ubuntu/feed/ 0
How to enable GZIP compression in Nginx https://linuxhostsupport.com/blog/how-to-enable-gzip-compression-in-nginx/ https://linuxhostsupport.com/blog/how-to-enable-gzip-compression-in-nginx/#respond Wed, 19 Apr 2017 12:41:45 +0000 https://linuxhostsupport.com/blog/?p=64 We’ll show you, How to enable GZIP compression in Nginx. Lately, it’s all about optimizing your website and making it as fast as possible. Especially since search engines like Google consider page load time as a ranking factor. And, of course, the load time is a huge factor in user experience. Aside from using a […]

The post How to enable GZIP compression in Nginx appeared first on LinuxHostSupport.

]]>
We’ll show you, How to enable GZIP compression in Nginx. Lately, it’s all about optimizing your website and making it as fast as possible. Especially since search engines like Google consider page load time as a ranking factor. And, of course, the load time is a huge factor in user experience.

Aside from using a fast, SSD-powered VPS, you can also do some other tweaks and settings to speed up your website, like enabling gzip compression in Nginx.

Here we’ll discuss one method that will increase the transfer speed by reducing the size of the files with compression. This method will also bring up the benefit of reducing the bandwidth that is used in this process and will make the hosting cheaper to the owner (ie, you can use a hosting plan with fewer resources. The best part about – it’s easy to do and it will only take you a few minutes.

In this article, we’ll share with you how to do the above with the Nginx gzip module. As it is stated this module will help you to compress your files with the gzip compression method. It is known that this method will reduce the size of the transmitted files by half or in some cases even more.

How to enable it?

SSH into your server, and edit your nginx configuration:

[user]$ nano /etc/nginx/nginx.conf

Add or edit the following lines:

gzip on;
gzip_comp_level 2;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

# Disable for IE < 6 because there are some known problems
gzip_disable "MSIE [1-6].(?!.*SV1)";

# Add a vary header for downstream proxies to avoid sending cached gzipped files to IE6
gzip_vary on;

Test the configuration and fix errors (if any are shown):

nginx -t

Restart Nginx and verify that gzip is working properly.

service nginx restart

How to test if gzip compression is working in Nginx? Run the following curl command:

[user]$curl --header "Accept-Encoding: gzip,deflate,sdch" -I http://your-domain-name.com/
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 14 Apr 2017 09:59:38 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Keep-Alive: timeout=60
Link: <http://your-domain-name.com/wp-json/>;
Content-Encoding: gzip

If you see Content-Encoding: gzip, that means your page was served using the Nginx gzip Module.

Another way to test this is using an online gzip test. There are many “gzip checkers” out there, so use whichever one you want. You can even check and verify if gzip is enabled using multiple methods, including curl and several online tools.

That’s it. Your server should now be configured to use gzip compression and your websites should be noticeably faster.

Of course, you don’t have to do any of this if you use one of our Service Configuration & Optimization Services, in which case you can simply ask our expert Linux admins to enable gzip compression 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 enable GZIP compression in Nginx appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-enable-gzip-compression-in-nginx/feed/ 0
How to Install, Configure and Deploy a Meteor.js App on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-configure-and-deploy-a-meteor-js-app-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-configure-and-deploy-a-meteor-js-app-on-ubuntu-16-04/#comments Wed, 05 Apr 2017 13:07:29 +0000 https://linuxhostsupport.com/blog/?p=57 MeteorJS or simply Meteor is an open-source framework based on JavaScript. It is written using Node.js and allows you to build apps for any device (web, iOS, Android, or desktop) using the same code. In this tutorial, we will show you how to deploy a simple Meteor application on a Linux VPS running Ubuntu 16.04 […]

The post How to Install, Configure and Deploy a Meteor.js App on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
MeteorJS or simply Meteor is an open-source framework based on JavaScript. It is written using Node.js and allows you to build apps for any device (web, iOS, Android, or desktop) using the same code. In this tutorial, we will show you how to deploy a simple Meteor application on a Linux VPS running Ubuntu 16.04 as an operating system.

Connect to your Linux server via SSH and install the MeteorJS framework using the command below:

sudo curl https://install.meteor.com/ | sh

This will install the latest official Meteor release on your Ubuntu VPS.

In case you get the following error message when you run the installation command:

-bash: curl: command not found

it means you don’t have curl installed on your server. To install the package use the commands below:

sudo apt-get update
sudo apt-get install curl

Once curl is installed, you can run the installation command for MeteorJS again and get the Meteor framework installed.

It will take a couple of minutes for the installation process to finish, and once it is completed you can verify that the installation is successful by checking the Meteor version:

meteor --version

This should provide you with output very similar to this one:

$ meteor --version
Meteor 1.4.3.2

If you are running the meteor command for the first time, it will take a couple of seconds for Meteor to be set up in your user’s home directory.

Now you are ready to create your first MeteorJS application. Navigate to your home directory:

cd ~

and run the following command:

meteor create firstApp

The application will be set up immediately. To run the application, use the following commands:

cd firstApp
meteor

Make sure that there are no errors in the output. It should be similar to the one below:

$ meteor
[[[[[ ~/firstApp ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Started your app.

=> App running at: http://localhost:3000/

Now the application is running on port 3000 and it is accessible from the local machine only. To make it accessible using a domain name you can set up Nginx as a reverse proxy on your Meteor VPS.

First, install Nginx and set up a server block.

Add the following lines to the Nginx server block for your Meteor application:

upstream meteor {
    server 127.0.0.1:3000;
}

server {
    listen      80;
    server_name your_domain;

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

    proxy_buffers 16 64k;
    proxy_buffer_size 128k;

location / {
        proxy_pass  http://meteor;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_redirect off;

        proxy_set_header    Host            $host;
        proxy_set_header    X-Real-IP       $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header    X-Forwarded-Proto https;
    }
}

Replace your_domain with your actual domain name. Save and close the file, then check if there are errors:

sudo nginx -t

If there are no errors, restart nginx:

sudo systemctl restart nginx.service

Restart your Meteor application and open your web browser. You should be able to access the Meteor application you just deployed using your domain name. If you see the welcome screen like the one below it means your Meteor application is successfully deployed.

meteor welcome

To start building real applications with MeteorJS you can check the tutorials at https://www.meteor.com/tutorials

Of course, you don’t have to do any of this if you use one of our Software Installation Services, in which case you can simply ask our expert Linux admins to install MeteorJS on your 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 Install, Configure and Deploy a Meteor.js App on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-configure-and-deploy-a-meteor-js-app-on-ubuntu-16-04/feed/ 4
How to Fix 403 Forbidden Error in WordPress https://linuxhostsupport.com/blog/how-to-fix-403-forbidden-error-in-wordpress/ https://linuxhostsupport.com/blog/how-to-fix-403-forbidden-error-in-wordpress/#respond Wed, 29 Mar 2017 14:10:12 +0000 https://linuxhostsupport.com/blog/?p=52 Are you one of those website owners that are dealing with the 403 Forbidden error on your WordPress site? This error is one of the most dreadful ones that a WordPress beginner can come across. Everyone who spends some time online has come across an HTTP status error. Few of them can be frustrating, like […]

The post How to Fix 403 Forbidden Error in WordPress appeared first on LinuxHostSupport.

]]>
Are you one of those website owners that are dealing with the 403 Forbidden error on your WordPress site? This error is one of the most dreadful ones that a WordPress beginner can come across. Everyone who spends some time online has come across an HTTP status error. Few of them can be frustrating, like getting a 403 Forbidden error on your own WordPress website. This error code is shown when your server permissions are not allowing access to a specific page.

Here, we’ll share with you the 3 most common reasons due to which your WordPress site is displaying the 403 Forbidden Error and their fixes.

403 Forbidden Error Caused by a WordPress Plugin

First thing to do is to deactivate all WordPress plugins temporarily including security plugins that have been installed on your site. If this step stops this problem, it means one of the plugins is causing this error. Then, you can figure out which plugin was causing the error by activating one plugin at a time until you get that 403 error again.

Our recommendation is to use as few plugins as possible. There may be some incompatibilities when using multiple plugins and you get a higher chance of a security breach when you have more active plugins.

403 Forbidden Error That is Caused by File Permissions

Incorrect file permissions can cause a 403 forbidden error on your WordPress site. It also makes the web server think that you actually don’t have the permission to access those files that you are trying to reach. If the above solution doesn’t solve the 403 forbidden error on your WordPress website then incorrect file permissions is the next thing to check.

If you want to resolve this issue, connect to your WordPress site using an FTP client. Navigate to the root folder where all WordPress files are located. Make sure that all the folders on your WordPress site have a permission of 744 or 755 and all the files should have permissions of 644 or 640. After implementing this solution, the 403 forbidden error should be gone if that was the issue in the first place.

403 Forbidden Error Caused by Corrupt .htaccess File

Most often the error 403 is caused by a corrupt .htaccess file on your WordPress server. To be honest, repairing this file is quite easy.

First, please connect to your website using an (s)FTP client or use the file manager in your control panel (if you have one).

Next, locate the .htaccess file which is inside the root folder of your WordPress site. Remember that the .htaccess file is one of the system files so if you are accessing through a control panel, please enable the “show hidden files” option.

If you are accessing through some (s)FTP software you’ll need to download the .htaccess file on your computer so that you have a fresh backup of it and edit it there. After that, you need to delete the file from your server.

Try accessing your website once you are done with the editing. If 403 forbidden error is resolved and is not showing on your site then this means that your .htaccess file was corrupt and responsible for the problem that you had.

You can generate a fresh .htaccess file from your WordPress admin area – just go to Settings » Permalinks page. Simply click on the Save Changes button that is found at the bottom of the page and WordPress will generate new and fresh .htaccess file.

Conclusion

As you can see, the 403 Forbidden error is really nothing to be scared of but it will cause you some pain. Chances are that if you ever run across this issue you can fix it as simple as this and also with the help of our tutorial here.

If you are running a WordPress site and run into 403 Forbidden Error than this is what you need to do:

  • Check your plugins.
  • Check your user privileges.
  • Check your .htaccess file.

If you still can’t fix your 403 forbidden error on your WordPres site, contact us and we’ll fix the error for you.

Of course, you don’t have to do any of this if you use one of our Service Configuration and Optimization Services, in which case you can simply ask our expert Linux admins to fix the 403 Forbidden Error 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 Fix 403 Forbidden Error in WordPress appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-fix-403-forbidden-error-in-wordpress/feed/ 0
How to install Caddy on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-caddy-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-caddy-on-ubuntu-16-04/#respond Wed, 22 Mar 2017 12:45:35 +0000 https://linuxhostsupport.com/blog/?p=47 In this tutorial, we will show you how to install Caddy on a Ubuntu 16.04 VPS. Caddy is a modern, general-purpose, multi-platform web server which supports Virtual hosting, HTTP/2, IPv6, Markdown, WebSockets, FastCGI, automatic HTTPS via Let’s Encrypt, templates and more. This guide should work on other Linux VPS systems as well but was tested […]

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

]]>
In this tutorial, we will show you how to install Caddy on a Ubuntu 16.04 VPS. Caddy is a modern, general-purpose, multi-platform web server which supports Virtual hosting, HTTP/2, IPv6, Markdown, WebSockets, FastCGI, automatic HTTPS via Let’s Encrypt, templates and more. This guide should work on other Linux VPS systems as well but was tested and written for an Ubuntu 16.04 VPS.

Log in to your VPS via SSH

ssh user@vps_IP

Update the system and install all necessary packages

sudo apt-get update && apt-get -y upgrade
sudo apt-get install curl

Install Caddy

Installing Caddy is quick and easy:

curl https://getcaddy.com | bash

If you want to install Caddy with some extra features, you can use the -s switch with a comma-separated list of directives, like in the following example:

curl https://getcaddy.com | bash -s realip,expires,upload

Once the installation is completed, we need to add the cap_net_bind_servicecapability to the Caddy binary. This capability will allow the Caddy executable to bind to a port less than 1024.

sudo setcap cap_net_bind_service=+ep /usr/local/bin/caddy

Next, create the directories where we will store the Caddy configuration file Caddyfile and SSL certificates. The term “Caddyfile” is a plaintext configuration file used to configure how Caddy works. This configuration file is very similar in purpose to httpd.conf in Apache or nginx.conf in Nginx.

sudo mkdir /etc/caddy
sudo chown -R root:www-data /etc/caddy
sudo mkdir /etc/ssl/caddy
sudo chown -R www-data:root /etc/ssl/caddy
sudo chmod 0770 /etc/ssl/caddy
sudo touch /etc/caddy/Caddyfile
sudo mkdir /var/www
sudo chown www-data: /var/www

SystemD Configuration

We also need to create a new SystemD configuration script:

sudo nano /lib/systemd/system/caddy.service
[Unit]
Description=Caddy HTTP/2 web server
Documentation=https://caddyserver.com/docs
After=network-online.target
Wants=network-online.target

[Service]
Restart=on-failure
StartLimitInterval=86400
StartLimitBurst=5

User=www-data
Group=www-data
; Letsencrypt-issued certificates will be written to this directory.
Environment=CADDYPATH=/etc/ssl/caddy

ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp
ExecReload=/bin/kill -USR1 $MAINPID

LimitNOFILE=1048576
LimitNPROC=64

PrivateTmp=true
PrivateDevices=true
ProtectHome=true
ProtectSystem=full
ReadWriteDirectories=/etc/ssl/caddy

; The following additional security directives only work with systemd v229 or later.
; They further retrict privileges that can be gained by caddy. Uncomment if you like.
; Note that you may have to add capabilities required by any plugins in use.
;CapabilityBoundingSet=CAP_NET_BIND_SERVICE
;AmbientCapabilities=CAP_NET_BIND_SERVICE
;NoNewPrivileges=true
[Install]
WantedBy=multi-user.target

Enable Caddy to start on boot:

sudo systemctl enable caddy.service

Testing Caddy

For testing purposes, we will create a test HTML file:

sudo mkdir -p /var/www/my-domain.com
sudo echo "Caddy" > /var/www/my-domain.com/index.html
sudo chown -R www-data: /var/www/my-domain.com

and add our domain to the Caddy configuration file.

sudo nano /etc/caddy/Caddyfile
my-domain.com {
    root /var/www/my-domain.com
}

Start Caddy with the following command:

sudo systemctl start caddy.service

You can now access your domain at https://my-domain.com.

For more information about how to manage your Caddy web server, please refer to the Caddy documentation.


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

]]>
https://linuxhostsupport.com/blog/how-to-install-caddy-on-ubuntu-16-04/feed/ 0
How to Leverage Browser Caching in WordPress https://linuxhostsupport.com/blog/how-to-leverage-browser-caching-in-wordpress/ https://linuxhostsupport.com/blog/how-to-leverage-browser-caching-in-wordpress/#respond Wed, 15 Mar 2017 13:28:13 +0000 https://linuxhostsupport.com/blog/?p=43 Your site speed and the page load time is one of the most important components when the Google ranking algorithm is in place, and this can affect your search engine ranking. If you do a test with Google PageSpeed (or any other speed testing tool) and if you get a result that you need to […]

The post How to Leverage Browser Caching in WordPress appeared first on LinuxHostSupport.

]]>
Your site speed and the page load time is one of the most important components when the Google ranking algorithm is in place, and this can affect your search engine ranking. If you do a test with Google PageSpeed (or any other speed testing tool) and if you get a result that you need to use browser caching, we’ll show you how to do that in WordPress.

What is browser caching?

When you, as a user, visit a webpage for the first time then your browser will store a copy of the static files like images, CSS, java scripts and favicon locally on your computer. This basically means that your computer will not download those files again when you visit that website. The webpage at the end will load faster and this is called browser caching.

How to leverage browser caching?

First, you’ll need to disable the ETag header because this tutorial will teach you how to use Expires. The ETag technology is slow and full of problems.

Add the lines below to your .htaccess file:

Header unset Pragma
FileETag None
Header unset ETag

Additionally, add the lines below and you’ll start to enable Leverage Browser Caching

## EXPIRES CACHING ##
<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 application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

This code, your main static files (images, PDFs, CSS, JS, etc.) will be cached on your visitor’s computer in order to produce faster loading of your webpage in the future.

Compress Components

If you compress things then you will always end up making them smaller and hence load faster, so implementing some form of compression on your components is a must have. This optimization step might not work if your server does not have either mod_deflate or mod_gzip installed as part of Apache.

<FilesMatch "\\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>

<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>

Bonus tip that we want to share with you:

You can leverage browser caching with the W3 Total Cache Plugin. If you don’t already have it installed, you can do so for free on your WordPress site.

After you install the W3 Total Cache Plugin, simply head over to your WordPress Dashboard » Performance » General Settings and Enable “Browser cache“

 

After that, go to Performance >> Browser Cache. Apply the following settings.

Browser Cache – General Settings

  • Enable “Set Last-Modified header”
  • Enable “Set expires header”
  • Enable “Set cache control header”
  • Disable “Set entity tag (eTag)”
  • Enable “Set W3 Total Cache header”
  • Enable “HTTP (gzip) compression”
  • Disable “Prevent caching of objects after settings change”
  • Disable “Do not process 404 errors for static objects“

Browser Cache – CSS & JS

  • Enable “Set Last-Modified header”
  • Enable “Set expires header”
  • Expires header lifetime – 31536000 seconds (1 year)
  • Enable “Set cache control header”
  • Cache Control Policy: cache with max-age
  • Disable “Set entity tag (eTag)”
  • Enable “Set W3 Total Cache header”
  • Enable “HTTP (gzip) compression”
  • Disable “Prevent caching of objects after settings change “
  • Disable “Disable cookies for static files “

Browser Cache – HTML and XML

  • Enable “Set Last-Modified header”
  • Enable “Set expires header”
  • Expires header lifetime – 3600 seconds (1 hour)
  • Enable “Set cache control header”
  • Cache Control Policy: cache with max-age
  • Disable “Set entity tag (eTag)”
  • Enable “Set W3 Total Cache header”
  • Enable “HTTP (gzip) compression”

Browser Cache – Media and other files

  • Enable “Set Last-Modified header”
  • Enable “Set expires header”
  • Expires header lifetime – 31536000 seconds (1 year)
  • Enable “Set cache control header”
  • Cache Control Policy – cache with max-age
  • Disable “Set the entity tag (eTag)”
  • Enable “Set W3 Total Cache header”
  • Enable “HTTP (gzip) compression”
  • Disable “Prevent caching of objects after settings change”
  • Disable “Disable cookies for static files”

That’s it all you need to do. Run the page speed test again and see the results. You will see your PageSpeed Score will be improved and your website will load much faster than before.

Of course, you don’t have to do any of this if you use one of our Service Configuration & Optimization services, in which case you can simply ask our expert Linux admins to speed up WordPress and leverage browser caching 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 Leverage Browser Caching in WordPress appeared first on LinuxHostSupport.

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

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

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

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

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

1. List all installed RPM packages

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

rpm -qa

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

2. Install RPM packages

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

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

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

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

You can install packages without checking for dependencies using –nodeps

rpm -ivh --nodeps package

3. Upgrade RPM packages

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

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

4. Remove RPM packages

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

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

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

rpm -e --nodeps package

5. Information about installed RPM packages

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

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

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

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

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

]]>
https://linuxhostsupport.com/blog/how-to-manage-rpm-packages-on-centos/feed/ 0
Check filesystems, files, hosts and custom scripts with Monit https://linuxhostsupport.com/blog/check-filesystems-files-hosts-and-custom-scripts-with-monit/ https://linuxhostsupport.com/blog/check-filesystems-files-hosts-and-custom-scripts-with-monit/#respond Thu, 02 Mar 2017 13:31:13 +0000 https://linuxhostsupport.com/blog/?p=35 Monit is a free and open source monitoring system for Linux. It’s one of the essential tools a sysadmin must have. Use the following examples to create your own checks and your own conditions that will suit your need. So, let’s begin. With Monit, you can check a certain filesystem. As we are using include […]

The post Check filesystems, files, hosts and custom scripts with Monit appeared first on LinuxHostSupport.

]]>
Monit is a free and open source monitoring system for Linux. It’s one of the essential tools a sysadmin must have. Use the following examples to create your own checks and your own conditions that will suit your need.

So, let’s begin.

With Monit, you can check a certain filesystem. As we are using include /etc/monit.d/* (it’s just another way of configuring Monit, you can put all of this in /etc/monit.conf too), we need to first create the appropriate file for the check we are about to configure. You can also name the file to your liking, it does not have to be the same as the example.

Create and edit the file using your favorite text editor as follows:

# vim /etc/monit.d/fs_check

check filesystem my_fs with path /
#    if failed permission 660 then unmonitor
#    if failed uid root then unmonitor
#    if failed gid disk then unmonitor
#    if space usage > 80% for 5 times within 15 cycles then alert
if space usage > 50% then alert
if inode usage > 30000 then alert
if inode usage > 99% then stop

Monit can also do various checks for a certain file. We will setup an SSL certificate’s permissions check. The configuration is pretty straightforward, and it goes as follows:

# vim /etc/monit.d/cert_check

check file certificate with path "/root/ssl/mydomain.tld.crt"
if failed permission 0700 then alert

Another example where Monit can do a file size check. Create and edit the corresponding file as follows:

# vim /etc/monit.d/file_check

check file important with path "/root/packages/test"
if size > 1000 KB then alert

Monit can also monitor a remote machine. In this example we will configure Monit to check different ports on a certain machine:

# vim /etc/monit.d/host1

check host dns1 with address 111.111.111.111
if failed icmp type echo count 3 with timeout 3 seconds then alert
if failed port 53 protocol dns with timeout 5 seconds then alert
if failed port 22 protocol ssh with timeout 3 seconds then alert
if failed port 80 protocol http with timeout 5 seconds then alert

In the example below we are checking for certain ports as well as an URL:

# vim /etc/monit.d/host2

check host my_host with address 11.22.33.44
if failed port 22 protocol ssh with timeout 5 seconds then unmonitor
if failed port 80 protocol http with timeout 5 seconds then unmonitor
if failed url http://11.22.33.44/test.txt then alert

Monit can also check for an exit status of a custom script file:

# vim /etc/monit.d/program

check program stat_check with path "/root/packages/test.sh"
if status > 0 then alert

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

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

The post Check filesystems, files, hosts and custom scripts with Monit appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/check-filesystems-files-hosts-and-custom-scripts-with-monit/feed/ 0
Install SciPy through pip https://linuxhostsupport.com/blog/install-scipy-through-pip/ https://linuxhostsupport.com/blog/install-scipy-through-pip/#respond Tue, 28 Feb 2017 13:31:24 +0000 https://linuxhostsupport.com/blog/?p=31 SciPy (pronounced “Sigh Pie”) is an open-source Python-based package of tools mainly used for scientific computing, mathematics and engineering. It is built on the Numpy extension of Python and it has a lot of useful modules for statistics, integration, optimization, linear algebra, Fourier transforms, signal and image processing, ODE solvers, and many more. SciPy runs on […]

The post Install SciPy through pip appeared first on LinuxHostSupport.

]]>
SciPy (pronounced “Sigh Pie”) is an open-source Python-based package of tools mainly used for scientific computing, mathematics and engineering. It is built on the Numpy extension of Python and it has a lot of useful modules for statistics, integration, optimization, linear algebra, Fourier transforms, signal and image processing, ODE solvers, and many more. SciPy runs on all major Linux based operating systems and its installation is quick and very easy. In this tutorial we will guide you through the steps of installing SciPy on a Linux VPS using the pip package manager.

SciPy is very well organized into sub-packages covering different scientific computing domains. These are summarized in the following list:

  • cluster – Clustering algorithms
  • constants – Physical and mathematical constants
  • fftpack – Fast Fourier Transform routines
  • integrate – Integration and ordinary differential equation solvers
  • interpolate – Interpolation and smoothing splines
  • io – Input and Output
  • linalg – Linear algebra
  • ndimage  – N-dimensional image processing
  • odr – Orthogonal distance regression
  • optimize  – Optimization and root-finding routines
  • signal – Signal processing
  • sparse – Sparse matrices and associated routines
  • spatial – Spatial data structures and algorithms
  • special – Special functions
  • stats – Statistical distributions and functions
  • weave  – C/C++ integration

To start the SciPy installation you have to log in to your Linux VPS as user root

ssh root@IP_Address -p <port_number>

Start a new screen session by executing the following command

screen -S scipy

Make sure that all installed packages on your server and up to date and install the package manager pip on your server if it is not already installed

CentOS/Fedora/RHEL

yum clean all
yum -y update
yum install -y python-pip

Ubuntu/Debian

apt-get update && apt-get upgrade
apt-get install python-pip

Once it is installed, update pip to the latest available version

pip install --upgrade pip

To check the currently installed version and confirm that pip is successfully installed on your server, run the following command:

pip -V

The output should be in the following format:

pip 9.0.1 from /usr/lib/python2.6/site-packages (python 2.6)

After pip is installed on your virtual server, you can go ahead and install SciPy:

pip install scipy

If the installation is completed successfully, you will receive the following output

Collecting scipy
Downloading scipy-0.18.1-cp27-cp27mu-manylinux1_x86_64.whl (40.3MB)
100% |################################| 40.3MB 20kB/s
Installing collected packages: scipy
Successfully installed scipy-0.18.1

Since Scipy is built on the Numpy Python extension and uses Numpy arrays and data types, so for all basic array handling needs you may use Numpy functions, for example:

import numpy as np
np.some_function()

The top level Scipy package is imported as sp by default:

import scipy as sp

For more information about SciPy, its features, functions, and usage please check their official documentation at https://docs.scipy.org/doc/scipy/reference/


Of course, you don’t have to do any of this if you use one of our Software Installation Services, in which case you can simply ask our expert Linux admins to install SciPy through pip 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 SciPy through pip appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/install-scipy-through-pip/feed/ 0
Open source sysadmin tools we use on a daily basis https://linuxhostsupport.com/blog/open-source-sysadmin-tools-we-use-on-a-daily-basis/ https://linuxhostsupport.com/blog/open-source-sysadmin-tools-we-use-on-a-daily-basis/#comments Fri, 24 Feb 2017 13:27:18 +0000 https://linuxhostsupport.com/blog/?p=19 Being a Linux system and network administrator requires a lot of time and dedication. Sysadmins usually have hundreds of tasks they need to do every day, some of which may be repetitive. This is where the sysadmin tools come in handy. There’s an open source application for just about anything. You can get a lot […]

The post Open source sysadmin tools we use on a daily basis appeared first on LinuxHostSupport.

]]>
Being a Linux system and network administrator requires a lot of time and dedication. Sysadmins usually have hundreds of tasks they need to do every day, some of which may be repetitive. This is where the sysadmin tools come in handy. There’s an open source application for just about anything. You can get a lot more work done if you’d automate repetitive tasks and manage your time properly. If you are in tech support, you’ll most likely use and support hundreds if not thousands of different software and applications. Managing all of them at the same time, or with even just a small number of them can be difficult if you don’t use the proper tools.

At LinuxHostSupport, we use a lot of open source tools to help our admins with their work, but we’ll focus on the best and those that will most likely be useful to other Linux admins too. We’ll list out some command line tools and open source software we use on a daily basis and the reason why we are using them. Note that we frequently try and test new tools, so our current setup may be different than the one written in this post. You may get an idea out of this. The way we use a certain software, script or application may not be the way it was intended to be used, but when you are a sysadmin you get creative and think out of the box.

Being responsible for so many servers is something that we as system administrators thrive on. However it sure knows to be stressful and among others things, it requires problem-solving skills, competence, and perseverance, the latter especially in situations where you are about to go berserk because you can’t seem to find a solution for a client’s unreachable website in the middle of a planned marketing campaign and sale.

During debugging there are many command line tools that can be used to narrow down the possible solutions for a problem. Of course, every system admin out there has his/her own set of preferred commands and tools of use and it is really a matter of personal choice. Having said that, in this post, we will share the tools that we mostly use on a daily basis when handling and troubleshooting system, network and DNS related problems.

The day to day tasks and responsibilities that every system admin has involve constantly monitoring the network and the systems that use the network, ensuring their stability and reliability in the process. We will use examples to explain a problem with a website, server or service and the tool that we use to debug and eventually solve the problem.

Command line tools

So let’s start with one of the basic commands for network troubleshooting, ping. Using the “ping” command is the best way to test connectivity between a source computer and a specified destination computer. Ping uses ICMP (Internet Control Message Protocol) to communicate to other devices. You can use ping in many ways, for example, if you want to check the IP address that LinuxHostSupport.com resolves to, you can use:

# ping linuxhostsupport.com

The output will show the IP address of the domain, the round trip time, the packets loss value and the approximate round trip time.

The traceroute command is a network troubleshooting utility which shows the number of hops taken to reach a destination while determining the packets traveling path. So if for example, you cannot open a certain website and you are sure that the website is online for others, you can use the traceroute command to check if there is any packet loss along the way.

For a website to be shown in your web browser, the DNS records for that domain have to be correct. The domain must be pointed to the server where the data for the website is hosted. So when troubleshooting an inaccessible website we use the dig command.

dig (domain information groper) is a network administration command-line tool for querying Domain Name System (DNS) name servers.

So, for example, to query a domain A record from the Google public DNS server, we will use:

# dig A www.example.com @8.8.8.8

The answer will provide us with information that will help us narrow down the possible reasons on why the website is offline. If for example the domain is not pointed correctly or at all, we will know that the problem is an inaccurate DNS record. Then we will take the required measures or inform the domain owner of the solution.

Another useful tool that most sysadmins use is: find. It is a Linux command that can be used to search for files or a specific text string in a file or files.

To search for a specific file the below command can be used:

# find ./rosehosting -name “linuxvps.txt”

or if you need to find hidden files:

# find ~ -type f -name ".*"

The find command can find usage in multiple scenarios and it helps sysadmins significantly speed up the search for a file, directory or string in files.

A VPS has its own dedicated resources. Monitoring the server resource usage can be accomplished using the top command which provides a dynamic real-time view of the running system. It displays system summary information with a list of processes or threads currently being managed by the kernel.

What happens if you type top in your command line interface? You will get a display similar as the one in the image below, of course with your server’s current resource usage and processes.

top command

When in need of checking a server network connections (both incoming and outgoing), routing tables, and a number of network interfaces, the netstat command can be used. You can use this command in many scenarios for different problems or inspections. Let’s say that we need to see all active connections and the TCP and UDP ports on which the server is listening. We will type:

# netstat -anlp

The output will show us all the ports that the server services listen on and will list all the active connections.

In certain cases where we needed to access a website from a terminal, we used elinks. It is a free text-based console web browser for Unix-like operating systems that renders both frames and tables and is highly customizable.

And last but not least tcpdump. It is a great packet analyzer that can be used to display TCP/IP and other packets being transmitted or received over a network. With tcpdump we analyze the packets’ content on a network interface with matched flags and boolean expressions.

These commands that we listed above, albeit great are not the only ones that we and sysadmins over the world use on a daily basis. Also, their usage is just a glimpse of the possibilities they offer and due to the nature of this brief informative post, we covered only the basics.

A lot of code editors

Code editors. There are so many out there! Vim, Nano, Brackets, Atom, Visual Studio Code… Every editor is highly customizable and has lots of plugins available. We use different code editors – we can’t really pick a favorite since everyone uses a different editor for different purposes. Nevertheless, a more powerful and flexible code editor is a must-have for every sysadmin, and you have a lot of open source code editors to choose from. There are even some great browser based code editors.

Nagios

Working with tons of servers requires careful monitoring of their services and reliability. A handy, no scratch that, a very handy monitoring software that we use on a daily basis is Nagios. Nagios is a robust, open source and very powerful monitoring system that monitors systems, networks and infrastructure. It offers monitoring and alerting services for servers, switches, applications and services. Nagios watches what you’ll set it to monitor and then alerts you when things go wrong until the problem is resolved after which again, alerts for a second time that the problem is gone.

Few of Nagios standout features are:

  • Simple installation;
  • Flexibility
  • Scalable;
  • Easy to use and navigate interface;
  • A plethora of plugins;
  • Alert system and event handlers that help with problem-solving;
  • Reporting system;
  • Available data graphing plugins;
  • Parallelized service checks;
  • Flat-text formatted configuration files;
  • Automatic log file rotation and much more…

Nagios is quite powerful and flexible, however, the learning curve can be high. The initial setup and configuration usually takes a lot of work, but once you get a hold of it and become familiar with how it works and what it can do for you, you’ll never stop using it.

Of course, there are some other great monitoring services such as Zabbix, Icinga, Cacti, Observium Sensu etc.

Ansible

Ansible is a simple but powerful automation tool written in python that automates provisioning, application deployment, and configuration management. With Ansible you do not need to deploy agents on the remote machines, all you need is ssh access to your servers. We are big fans of Ansible because of its simplicity, speed and easy learning curve.

Nextcloud

Sometimes you need to synchronize and share valuable files or maybe you just need your privacy. With Nextcloud, you can share files, calendars, contacts, mail and more on a self-hosted, private server. It’s highly configurable and you get to keep your privacy when you share data in your own cloud. We find great usage in Nextcloud and they are contsantly updating the software with lots cool new features.

 

What open source tools do you use? Leave a comment below, we’d love to hear about them. We may publish another similar post, as we use a lot of other apps and open source software.

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

The post Open source sysadmin tools we use on a daily basis appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/open-source-sysadmin-tools-we-use-on-a-daily-basis/feed/ 2
Speed up your application by upgrading to PHP 7 https://linuxhostsupport.com/blog/speed-up-your-application-by-upgrading-to-php-7/ https://linuxhostsupport.com/blog/speed-up-your-application-by-upgrading-to-php-7/#comments Tue, 21 Feb 2017 13:28:13 +0000 https://linuxhostsupport.com/blog/?p=15 In this tutorial, we are going to provide you with step by step instructions on how to install PHP 7 on an Ubuntu 16.04 VPS and on a CentOS 7 VPS. PHP 7 is the latest version of the PHP processing engine and it is faster than any other previous version of PHP. Also, PHP […]

The post Speed up your application by upgrading to PHP 7 appeared first on LinuxHostSupport.

]]>
In this tutorial, we are going to provide you with step by step instructions on how to install PHP 7 on an Ubuntu 16.04 VPS and on a CentOS 7 VPS. PHP 7 is the latest version of the PHP processing engine and it is faster than any other previous version of PHP. Also, PHP 7 consumes less memory.

Install PHP 7 on Ubuntu

Make sure your server OS packages are fully up to date by running the following commands:

sudo apt-get update 
sudo apt-get upgrade

Install PHP and commonly used PHP packages:

sudo apt-get install php7.0-cli php7.0-common php7.0-json php7.0-readline php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-gd

To make sure that PHP 7 is installed on your server, run the following command:

sudo php -v

You should get an output like this:

PHP 7.0.13-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.13-0ubuntu0.16.04.1, Copyright (c) 1999-2016, by Zend Technologies

If you’d like to install additional PHP 7 modules, like OPCache for example, you can use the command below:

sudo apt-get install php7.0-opcache

In order to search for available PHP 7 modules, run:

sudo apt-cache search php7

To see which files are used by PHP in CLI mode, run:

# php --ini
Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File:         /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed:      /etc/php/7.0/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.0/cli/conf.d/10-opcache.ini,
/etc/php/7.0/cli/conf.d/10-pdo.ini,
/etc/php/7.0/cli/conf.d/15-xml.ini,
/etc/php/7.0/cli/conf.d/20-calendar.ini,
/etc/php/7.0/cli/conf.d/20-ctype.ini,
/etc/php/7.0/cli/conf.d/20-dom.ini,
/etc/php/7.0/cli/conf.d/20-exif.ini,
/etc/php/7.0/cli/conf.d/20-fileinfo.ini,
/etc/php/7.0/cli/conf.d/20-ftp.ini,
/etc/php/7.0/cli/conf.d/20-gd.ini,
/etc/php/7.0/cli/conf.d/20-gettext.ini,
/etc/php/7.0/cli/conf.d/20-iconv.ini,
/etc/php/7.0/cli/conf.d/20-json.ini,
/etc/php/7.0/cli/conf.d/20-mcrypt.ini,
/etc/php/7.0/cli/conf.d/20-mysqli.ini,
/etc/php/7.0/cli/conf.d/20-pdo_mysql.ini,
/etc/php/7.0/cli/conf.d/20-phar.ini,
/etc/php/7.0/cli/conf.d/20-posix.ini,
/etc/php/7.0/cli/conf.d/20-readline.ini,
/etc/php/7.0/cli/conf.d/20-shmop.ini,
/etc/php/7.0/cli/conf.d/20-simplexml.ini,
/etc/php/7.0/cli/conf.d/20-sockets.ini,
/etc/php/7.0/cli/conf.d/20-sysvmsg.ini,
/etc/php/7.0/cli/conf.d/20-sysvsem.ini,
/etc/php/7.0/cli/conf.d/20-sysvshm.ini,
/etc/php/7.0/cli/conf.d/20-tokenizer.ini,
/etc/php/7.0/cli/conf.d/20-wddx.ini,
/etc/php/7.0/cli/conf.d/20-xmlreader.ini,
/etc/php/7.0/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.0/cli/conf.d/20-xsl.ini

If you only want to locate your php.ini configuration file, use:

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

The PHP Opcache extension can boost PHP performance by a large amount, so edit the PHP configuration file:

vi /etc/php/7.0/cli

Add the following lines in the ‘[opcache]’ section:

opcache.enable=1;
opcache.memory_consumption=256;
opcache.max_accelerated_files=20000;
opcache.max_wasted_percentage=10;
opcache.revalidate_freq=360;
opcache.fast_shutdown=0;
opcache.enable_cli=0;
opcache.revalidate_path=0;
opcache.validate_timestamps=0;
opcache.interned_strings_buffer=32;
opcache.fast_shutdown=1;

Do not forget to restart the web server for the changes to take effect:

service apache2 restart

Install PHP 7 on CentOS

Make sure that all OS packages are up to date:

yum clean all
yum update

Check if there are any installed PHP packages, e.g:

rpm -qa | grep php
php-cli-5.4.16-42.el7.x86_64
php-pdo-5.4.16-42.el7.x86_64
php-common-5.4.16-42.el7.x86_64
php-5.4.16-42.el7.x86_64
php-mysql-5.4.16-42.el7.x86_64

Remove PHP 5.4 packages prior installing PHP 7:

yum remove php-cli php-pdo php-common php php-mysql

Add the required repositories:

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

Install PHP 7 and PHP 7 packages:

yum install php70w  php70w-cli php70w-mysql php70w-pdo php70w-common

To search for available PHP7 modules, run:

yum search php70w

You may install additional PHP extensions, like mycrypt, mbstring, OPCache etc.:

yum install php70w-opcache php70w-mcrypt php70w-mbstring

Check the PHP 7 version installed on your server:

#php -v
PHP 7.0.15 (cli) (built: Jan 19 2017 21:35:05) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.15, Copyright (c) 1999-2017, by Zend Technologies

To optimize PHP 7, locate the PHP configuration file and edit it:

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

Add the following lines:

max_execution_time: 600
max_input_time: 600
max_input_vars: 5000
upload_max_filesize: 64M

Also, enable OPCache and configure it by adding the same settings in the ‘[opcache]’ section as on the Ubuntu 16.04 VPS.
Restart the Apache web server for the changes to take effect:

systemctl restart httpd

Of course, you don’t have to do any of this if you use one of our Software Installation services, in which case you can simply ask our expert Linux admins to install PHP 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 Speed up your application by upgrading to PHP 7 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/speed-up-your-application-by-upgrading-to-php-7/feed/ 3
How to Install WordPress with Nginx and W3 Total Cache on Ubuntu 16.04 https://linuxhostsupport.com/blog/install-wordpress-with-nginx-and-w3-total-cache-on-ubuntu/ https://linuxhostsupport.com/blog/install-wordpress-with-nginx-and-w3-total-cache-on-ubuntu/#comments Fri, 17 Feb 2017 09:59:58 +0000 https://linuxhostsupport.com/blog/?p=4 In this tutorial, we are going to provide you with step-by-step instructions on how to install WordPress with Nginx and W3 Total Cache on an Ubuntu 16.04 VPS. WordPress is the most popular open source CMS written in PHP that allows web developers to create everything from simple websites to complex e-commerce web stores, news […]

The post How to Install WordPress with Nginx and W3 Total Cache on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
In this tutorial, we are going to provide you with step-by-step instructions on how to install WordPress with Nginx and W3 Total Cache on an Ubuntu 16.04 VPS.
WordPress is the most popular open source CMS written in PHP that allows web developers to create everything from simple websites to complex e-commerce web stores, news portals, magazines etc.
This tutorial was tested and written for an Ubuntu VPS, but it should work on any Debian based Linux distribution.

At the time of writing this tutorial, the latest stable version of WordPress is 4.7.2 and we recommend to install and use:

  • PHP version 7 or higher with the GD graphics library version 2.0.x+ and MySQLi PHP extensions enabled, with memory_limit PHP variable set to 64 MB or higher (128 MB or higher is preferred)
  • Apache or nginx web server;
  • MySQL version 5.6 or higher or MariaDB version 10.0 or higher.

Let’s start with the installation.

Update OS packages:

Make sure your package list and the OS packages are up to date by running the following commands:

sudo apt-get update
sudo apt-get upgrade

To install the latest nginx version on your virtual server from the official nginx repository, edit the ‘/etc/apt/sources.list’ file:

sudo vi /etc/apt/sources.list

Add the following lines to it:

deb http://nginx.org/packages/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/ubuntu/ xenial nginx

Add the nginx GPG key:

wget http://nginx.org/packages/keys/nginx_signing.key
cat nginx_signing.key | apt-key add -

Stop the Apache service and remove it:

sudo service apache2 stop
sudo apt-get remove apache2

Install nginx on your virtual server using the following commands:

sudo apt-get update
sudo apt-get install nginx

Configure the nginx service to automatically start on boot:

sudo /lib/systemd/systemd-sysv-install enable nginx

Install PHP and enable required PHP modules:

sudo apt-get install php7.0-common php7.0-curl php7.0-fpm php7.0-gd php7.0-imap php7.0-json php7.0-mbstring php7.0-mysql php7.0-opcache php7.0-pspell php7.0-readline php7.0-xml php7.0-mcrypt php7.0-zip
sudo phpenmod mcrypt
sudo phpenmod imap

Then, start with the WordPress installation procedure.

Download WordPress

Get the latest version of WordPress available at https://wordpress.org/download. Download it to a directory of your virtual server and extract it using the following commands:

cd /opt/
wget https://wordpress.org/latest.zip
unzip latest.zip -d /var/www/html/

Create a new nginx configuration file and add the following virtual block for your domain name:

vi /etc/nginx/sites-available/your-domain.com.conf

Add the following lines:

server {
listen 80;
server_name your-domain.com www.your-domain.com;

root /var/www/html/wordpress;
index index.php index.html;
access_log /var/log/nginx/your-domain.com-access.log;
error_log /var/log/nginx/your-domain.com-error.log;
charset en_us.UTF-8;

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

Then, edit the main nginx configuration file (/etc/nginx/nginx.conf) and add the following line before the end of the http block:

include /etc/nginx/sites-enabled/*.conf

Activate the new nginx block by creating a symbolic link between the sites-available directory and the sites-enabled directory:

sudo ln -s /etc/nginx/sites-available/your-domain.com.conf /etc/nginx/sites-enabled/your-domain.com.conf

Do not forget to replace your-domain.com with your actual domain name. Then, delete the ‘default’ nginx configuration file:

rm /etc/nginx/sites-enabled/default

Open the ‘/etc/php/7.0/fpm/pool.d/www.conf’ PHP configuration file and change the ‘listen’ variable:

change:

listen = /run/php/php7.0-fpm.sock

to

listen = 127.0.0.1:9000

Edit the ‘/etc/php/7.0/fpm/php.ini’ PHP configuration file:

vi /etc/php/7.0/fpm/php.ini

Add/modify the following settings:

max_execution_time = 300
max_input_time = 300
memory_limit = -1
post_max_size = 64M
upload_max_filesize = 64M

The web server user (www-data) needs to be able to write to files and directories inside the ‘/var/www/html/wordpress’ directory, so it can easily be accomplished by executing the following command:

sudo chown www-data:www-data -R /var/www/html/wordpress/

Test the nginx configuration:

# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

If the test is successful, restart php7.0-fpm and Nginx services for the changes to take effect:

sudo service php7.0-fpm restart
sudo service nginx restart

Create new MySQL user and database:

WordPress requires a database to work as this is where data is saved, so create a new MySQL database on your server:

mysql -u root -p
mysql> SET GLOBAL sql_mode='';
mysql> CREATE DATABASE wpdb;
mysql> CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'y0ur-pAssW0RD';
mysql> GRANT ALL PRIVILEGES ON wpdb.* TO 'wpuser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit

Copy the WordPress sample config file (wp-config-sample.php):

cd /var/www/html/wordpress/
cp wp-config-sample.php wp-config.php

Set up the MySQL database information:

vi wp-config.php
define('DB_NAME', 'wpdb');
define('DB_USER', 'wpuser');
define('DB_PASSWORD', 'y0ur-pAssW0RD');

Do not forget to replace ‘y0ur-pAssW0RD’ with a strong password.

To install WordPress, open http://your-domain.com using a web browser and follow the easy instructions: select a language, create an administrator user account, enter your email address and click ‘Install WordPress’.

Log in to the WordPress administrator backend, go to plugins, search for ‘W3 Total Cache’ and install the W3 Total Cache plugin. Then, install a theme and other plugins of your choice, and configure WordPress according to your needs.

That is it. The WordPress installation is now complete.


Of course, you don’t have to do any of this if you use our Software Installation Service, in which case you can simply ask our expert Linux admins to install and configure WordPress with nginx, install W3 total cache plugin etc. for you. They are available 24×7 and will take care of your request immediately

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

 

The post How to Install WordPress with Nginx and W3 Total Cache on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/install-wordpress-with-nginx-and-w3-total-cache-on-ubuntu/feed/ 4