One place for hosting & domains

      How To Set Up Time Synchronization on Debian 10


      Introduction

      Accurate timekeeping has become a critical component of modern software deployments. Whether it’s making sure logs are recorded in the right order or database updates are applied correctly, out-of-sync time can cause errors, data corruption, and other difficult issues to debug.

      Debian 10 has time synchronization built in and activated by default using the standard ntpd time server, provided by the ntp package. In this article we will look at some basic time-related commands, verify that ntpd is active and connected to peers, and learn how to activate the alternate systemd-timesyncd network time service.

      Prerequisites

      Before starting this tutorial, you will need a Debian 10 server with a non-root, sudo-enabled user, as described in this Debian 10 server setup tutorial.

      Step 1 — Navigating Basic Time Commands

      The most basic command for finding out the time on your server is date. Any user can type this command to print out the date and time:

      Output

      Wed 31 Jul 2019 06:03:19 PM UTC

      Most often your server will default to the UTC time zone, as highlighted in the above output. UTC is Coordinated Universal Time, the time at zero degrees longitude. Consistently using Universal Time reduces confusion when your infrastructure spans multiple time zones.

      If you have different requirements and need to change the time zone, you can use the timedatectl command to do so.

      First, list the available time zones:

      • timedatectl list-timezones

      A list of time zones will print to your screen. You can press SPACE to page down, and b to page up. Once you find the correct time zone, make note of it then type q to exit the list.

      Now set the time zone with timedatectl set-timezone, making sure to replace the highlighted portion below with the time zone you found in the list. You'll need to use sudo with timedatectl to make this change:

      • sudo timedatectl set-timezone America/New_York

      You can verify your changes by running date again:

      Output

      Wed 31 Jul 2019 02:08:43 PM EDT

      The time zone abbreviation should reflect the newly chosen value.

      Now that we know how to check the clock and set time zones, let’s make sure our time is being synchronized properly.

      Step 2 — Checking the Status of ntpd

      By default, Debian 10 runs the standard ntpd server to keep your system time synchronized with a pool of external time servers. We can check that it's running with the systemctl command:

      • sudo systemctl status ntp

      Output

      ● ntp.service - Network Time Service Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2019-07-31 13:57:08 EDT; 17min ago Docs: man:ntpd(8) Main PID: 429 (ntpd) Tasks: 2 (limit: 1168) Memory: 2.1M CGroup: /system.slice/ntp.service └─429 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 106:112 . . .

      The active (running) status indicates that ntpd started up properly. To get more information about the status of ntpd we can use the ntpq command:

      Output

      remote refid st t when poll reach delay offset jitter ============================================================================== 0.debian.pool.n .POOL. 16 p - 64 0 0.000 0.000 0.000 1.debian.pool.n .POOL. 16 p - 64 0 0.000 0.000 0.000 2.debian.pool.n .POOL. 16 p - 64 0 0.000 0.000 0.000 3.debian.pool.n .POOL. 16 p - 64 0 0.000 0.000 0.000 +208.67.72.50 152.2.133.55 2 u 12 64 377 39.381 1.696 0.674 +198.46.223.227 204.9.54.119 2 u 6 64 377 22.671 3.536 1.818 -zinc.frizzen.ne 108.61.56.35 3 u 43 64 377 12.012 1.268 2.553 -pyramid.latt.ne 204.123.2.72 2 u 11 64 377 69.922 2.858 0.604 +nu.binary.net 128.252.19.1 2 u 10 64 377 35.362 3.148 0.587 #107.155.79.108 129.7.1.66 2 u 65 64 377 42.380 1.638 1.014 +t1.time.bf1.yah 98.139.133.62 2 u 6 64 377 11.233 3.305 1.118 *sombrero.spider 129.6.15.30 2 u 47 64 377 1.304 2.941 0.889 +hydrogen.consta 209.51.161.238 2 u 45 64 377 1.830 2.280 1.026 -4.53.160.75 142.66.101.13 2 u 42 64 377 29.077 2.997 0.789 #horp-bsd01.horp 146.186.222.14 2 u 39 64 377 16.165 4.189 0.717 -ntpool1.603.new 204.9.54.119 2 u 46 64 377 27.914 3.717 0.939

      ntpq is a query tool for ntpd. The -p flag asks for information about the NTP servers (or peers) ntpd is connected to. Your output will be slightly different, but should list the default Debian pool servers plus a few others. Bear in mind that it can take a few minutes for ntpd to establish connections.

      Step 3 — Switching to systemd-timesyncd

      It is possible to use systemd's built-in timesyncd component to replace ntpd. timesyncd is a lighter-weight alternative to ntpd that is more integrated with systemd. Note, however, that it doesn't support running as a time server, and it is slightly less sophisticated in the techniques it uses to keep your system time in sync. If you are running complex real-time distributed systems, you may want to stick with ntpd.

      To use timesyncd, we must first uninstall ntpd:

      Then, start up the timesyncd service:

      • sudo systemctl start systemd-timesyncd

      Finally, check the status of the service to make sure it's running:

      • sudo systemctl status systemd-timesyncd

      Output

      ● systemd-timesyncd.service - Network Time Synchronization Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled) Drop-In: /usr/lib/systemd/system/systemd-timesyncd.service.d └─disable-with-time-daemon.conf Active: active (running) since Wed 2019-07-31 14:21:37 EDT; 6s ago Docs: man:systemd-timesyncd.service(8) Main PID: 1681 (systemd-timesyn) Status: "Synchronized to time server for the first time 96.245.170.99:123 (0.debian.pool.ntp.org)." Tasks: 2 (limit: 1168) Memory: 1.3M CGroup: /system.slice/systemd-timesyncd.service └─1681 /lib/systemd/systemd-timesyncd

      We can use timedatectl to print out systemd's current understanding of the time:

      Output

      Local time: Wed 2019-07-31 14:22:15 EDT Universal time: Wed 2019-07-31 18:22:15 UTC RTC time: n/a Time zone: America/New_York (EDT, -0400) System clock synchronized: yes NTP service: active RTC in local TZ: no

      This prints out the local time, universal time (which may be the same as local time, if you didn't switch from the UTC time zone), and some network time status information. System clock synchronized: yes means that the time has been successfully synced, and NTP service: active means that timesyncd is enabled and running.

      Conclusion

      In this article we’ve shown how to view the system time, change time zones, work with ntpd, and switch to systemd's timesyncd service. If you have more sophisticated timekeeping needs than what we’ve covered here, you might refer to the offical NTP documentation, and also take a look at the NTP Pool Project, a global group of volunteers providing much of the world's NTP infrastructure.



      Source link

      Should I Switch Web Hosts? How to Know When It’s Time to Migrate Your Site


      When it comes to starting a website, web hosting is one of the most crucial yet most confusing aspects to tackle. With dozens of providers on the market, it can be hard to cut through the noise and figure out which one offers the best plan for you.

      Fortunately, several signs will make it clear when it’s time to move to a new host. While they’re not so pleasant to deal with in the moment, these issues may lead you to a better service provider that can help you boost your site’s success.

      In this post, we’ll discuss these signs and how to spot them on your website. Then we’ll explain how to migrate your site to a new web hosting platform. Let’s get started!

      Have a website? We’ll move it for you!

      Migrating to a new web hosting provider can be a pain. We’ll move your existing site within 48 hours without any interruption in service. Included FREE with any DreamPress plan.

      How to Know When It’s Time to Migrate (6 Tell-Tale Signs)

      It’s possible you’ve been experiencing problems with your website for a while now without really knowing why. In some cases, it may be that your web hosting provider isn’t a good fit for your website. These six signs will let you know it’s time to switch web hosts.

      1. You’re Experiencing More Downtime Than Usual

      Any time your website is unavailable to users, it’s considered ‘down.’ Even if your site is only unavailable for seconds at a time, it could cause serious problems. For starters, downtime makes your website appear unreliable and low-quality to both users and search engines.

      If your site is experiencing frequent outages, your users will come to find they can’t rely on it to be available when needed. The Google algorithm will account for this, and your search engine rankings will fall as well, hurting your site’s visibility.

      Plus, if your site generates revenue, you’ll be missing out on income every time your site has an outage. If your site is down often or for long periods of time, you could be losing hundreds or even thousands of dollars. When you’re running an online store, uptime truly affects your bottom line.

      Web hosting is one of the most common causes of website downtime, as there are many ways in which your server can impact your site’s availability, including:

      • The quality and reliability of your hosting equipment
      • The type of server your website is on, as shared servers tend to become overloaded more quickly than other types of servers.
      • Your host’s security features, since malicious attacks can lead to downtime.

      So, if you keep finding your website is down, there’s a fair chance your host may have something to do with it. Moving to a more reliable server is the best thing for your site in a situation like this.

      2. Your Website’s Loading Speed Is Slow

      Site speed is also key to Search Engine Optimization (SEO), users’ opinions of your site, and your conversion rate. It’s wise to test your site’s speed every once in a while using tools such as Google PageSpeed Insights and Pingdom to make sure your loading times are staying low and to fix any performance issues.

      Pingdom’s results screen.

      While a crowded server can certainly slow your loading times, your server’s location also plays a role in how fast your site delivers information to visitors. Servers located far away from end users aren’t able to serve them content as quickly.

      An easy way to determine if this is the case for your website is to use Pingdom to test your site speed from a variety of locations. If your site loads quickly from some places yet takes a long time to load in others, you’ll know server location is causing speed issues for users in those regions.

      If your host only has servers in one location and doesn’t offer a Content Delivery Network (CDN), it’s almost guaranteed that some portion of your users will experience less-than-ideal site speed. It may be worth looking into hosts with more or different locations, or ones offering a CDN.

      3. Customer Service Isn’t Helpful

      A solid relationship with your web host is priceless. For starters, there are going to be times when server-related errors occur on your site. In these instances, you’ll need to be able to get ahold of your host quickly to resolve the issue and get your site back up. Plus, you may sometimes have questions about billing or other account details.

      However, the best hosts also offer support in other areas of website management. For example, many hosts provide troubleshooting guidance for different types of errors on your website or support for platforms such as WordPress.

      If your host is difficult to get in touch with, provides inadequate solutions, or doesn’t offer support in areas directly related to your hosting account, consider switching to a new provider. While you may be able to get by without quality customer support, at some point, you’ll have to reach someone for help with a server-related problem, so you’ll want a reliable team at your back.

      4. You Need More Space Than Your Current Provider Can Offer

      Most websites start small and grow over time. Your current host may have been a great fit when you were first launching your site, but if your traffic levels have increased significantly, this may no longer be the case.

      As your site accumulates more recurring users, you’ll need a server that can handle more traffic as well as more and larger website files. Moving from shared hosting to a dedicated server can help, but switching hosts can often provide a greater benefit.

      Some providers specialize in shared or Virtual Private Network (VPN) hosting and may not offer dedicated servers. As such, if your site continues to grow, you’ll need a dedicated web hosting service at some point — so a switch may be inevitable.

      Other hosts may have dedicated servers available, but still not offer as much storage as you need. Ultimately, you’ll want to compare plans between companies to see which one offers the most space for the best price.

      5. It’s Getting Too Expensive to Stay With Your Current Host

      Web hosting is a recurring expense. It’s also sometimes the largest expense associated with running a website, especially for WordPress users working with a free Content Management System (CMS) and mainly free plugins and themes.

      It’s true that you often get what you pay for with hosting. However, there are also times when an expensive plan isn’t necessary. If your site is still small and not using the amount of server space you’re paying for, or if your current hosting plan comes with several features you never touch, you’re probably paying too much.

      There’s no sense in breaking the bank to host your website when there are plenty of affordable options available. For example, we offer high-quality managed WordPress hosting plans for as low as $16.95 per month.

      If you’re shelling out more money for web hosting than what your website brings in, you might want to consider downsizing or switching hosts to stay within your budget. Plus, it never hurts to pocket a little extra cash each month.

      6. Server Security Is Sub-Par

      As we mentioned earlier in this post, hosts are responsible for securing their servers. Not every provider is as diligent as they should be when it comes to security, and hackers will sometimes exploit weaknesses in your server to gain access to your site.

      This can be detrimental to your website for multiple reasons, including:

      • The loss of parts or all of your site due to a malicious attack that destroys key files and data.
      • Compromised user data, including sensitive information such as private records and credit card details.
      • Decreased credibility, as users will see your site as less reliable if it’s hacked.

      Investing in secure hosting is a smart move. Even if you have to pay a little extra or go through the trouble of migrating to a new host, you’ll save yourself a lot of trouble down the line.

      Some security features you may want to keep an eye out for are Secure Sockets Layer (SSL) certificates, malware scanning, and server firewalls. Of course, no matter how secure your server is, you should always follow security best practices for your site itself, too.

      How to Migrate Your Website to a New Hosting Provider

      If you’ve considered the signs mentioned above and determined you should switch hosting providers, you’ll need to migrate your website. This requires you to copy all your website’s files and move them to your new hosting account.

      Typically, the migration process is pretty involved. You’ll have to contact your current host, back up your site files, then use Secure File Transfer Protocol (SFTP) and a client such as FileZilla to connect to your new server and upload your files. You’ll also want to consider transferring your domain since there are benefits to keeping your domain registration and web hosting under one roof.

      As you might imagine, there are a lot of things that could go wrong during this process. For example, corrupted backups are always a possibility, and using SFTP still poses a risk to your site’s files as you could mistakenly delete some or all of them (we recommend users always have a recent backup of their site on hand).

      These things considered, it’s helpful if you can get an expert on board to migrate your site for you. Fortunately, if you’re a WordPress user and have decided to switch to DreamHost, our managed WordPress hosting plans include free website migration services.

      DreamHost’s WordPress migration services.

      We’ll handle moving your site at no extra cost. If you’d prefer one of our shared hosting plans or have a website built without using WordPress, never fear. You can still take advantage of our migration service for just $99.

      Our migration experts will get your site moved to your new hosting account within 48 hours of your request. You’ll also avoid downtime altogether, so you don’t have to worry about negatively impacting your users’ experience while you move your site and get acquainted with the DreamHost control panel.

      Looking for a New Hosting Provider?

      We make moving easy. Our hassle-free, high-performance WordPress hosting includes a FREE professional migration service ($99 savings)!

      Switching Web Hosts

      Hosting can be one of the most confusing aspects of owning a website. With so many options to choose from, it can be difficult to know if your web hosting provider is the best one available for your needs.

      If you’ve noticed these issues on your website and have decided it’s time for a change, consider checking out our DreamPress hosting plans. Our managed WordPress hosting service will provide you with the speed, support, and security your WordPress site needs. Plus, you’ll be able to use our site migration services for free.



      Source link

      How To Set Up Time Synchronization on Debian 9


      Introduction

      Accurate timekeeping has become a critical component of modern software deployments. Whether it’s making sure logs are recorded in the right order or database updates are applied correctly, out-of-sync time can cause errors, data corruption, and other hard to debug issues.

      Debian 9 has time synchronization built in and activated by default using the standard ntpd time server, provided by the ntp package. In this article we will look at some basic time-related commands, verify that ntpd is active and connected to peers, and learn how to activate the alternate systemd-timesyncd network time service.

      Prerequisites

      Before starting this tutorial, you will need a Debian 9 server with a non-root, sudo-enabled user, as described in this Debian 9 server setup tutorial.

      The most basic command for finding out the time on your server is date. Any user can type this command to print out the date and time:

      Output

      Tue Sep 4 17:51:49 UTC 2018

      Most often your server will default to the UTC time zone, as highlighted in the above output. UTC is Coordinated Universal Time, the time at zero degrees longitude. Consistently using Universal Time reduces confusion when your infrastructure spans multiple time zones.

      If you have different requirements and need to change the time zone, you can use the timedatectl command to do so.

      First, list the available time zones:

      • timedatectl list-timezones

      A list of time zones will print to your screen. You can press SPACE to page down, and b to page up. Once you find the correct time zone, make note of it then type q to exit the list.

      Now set the time zone with timedatectl set-timezone, making sure to replace the highlighted portion below with the time zone you found in the list. You'll need to use sudo with timedatectl to make this change:

      • sudo timedatectl set-timezone America/New_York

      You can verify your changes by running date again:

      Output

      Tue Sep 4 13:52:57 EDT 2018

      The time zone abbreviation should reflect the newly chosen value.

      Now that we know how to check the clock and set time zones, let’s make sure our time is being synchronized properly.

      Checking the Status of ntpd

      By default, Debian 9 runs the standard ntpd server to keep your system time synchronized with a pool of external time servers. We can check that it's running with the systemctl command:

      • sudo systemctl status ntp

      Output

      ● ntp.service - LSB: Start NTP daemon Loaded: loaded (/etc/init.d/ntp; generated; vendor preset: enabled) Active: active (running) since Tue 2018-09-04 15:07:03 EDT; 30min ago Docs: man:systemd-sysv-generator(8) Process: 876 ExecStart=/etc/init.d/ntp start (code=exited, status=0/SUCCESS) Tasks: 2 (limit: 4915) CGroup: /system.slice/ntp.service └─904 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 105:109 . . .

      The active (running) status indicates that ntpd started up properly. To get more information about the status of ntpd we can use the ntpq command:

      Output

      remote refid st t when poll reach delay offset jitter ============================================================================== 0.debian.pool.n .POOL. 16 p - 64 0 0.000 0.000 0.000 1.debian.pool.n .POOL. 16 p - 64 0 0.000 0.000 0.000 2.debian.pool.n .POOL. 16 p - 64 0 0.000 0.000 0.000 3.debian.pool.n .POOL. 16 p - 64 0 0.000 0.000 0.000 -eterna.binary.n 204.9.54.119 2 u 240 256 377 35.392 0.142 0.211 -static-96-244-9 192.168.10.254 2 u 60 256 377 10.242 1.297 2.412 +minime.fdf.net 83.157.230.212 3 u 99 256 377 24.042 0.128 0.250 *t1.time.bf1.yah 98.139.133.62 2 u 31 256 377 11.112 0.621 0.186 +x.ns.gin.ntt.ne 249.224.99.213 2 u 108 256 377 1.290 -0.073 0.132 -ord1.m-d.net 142.66.101.13 2 u 473 512 377 19.930 -1.764 0.293

      ntpq is a query tool for ntpd. The -p flag asks for information about the NTP servers (or peers) ntpd is connected to. Your output will be slightly different, but should list the default Debian pool servers plus a few others. Bear in mind that it can take a few minutes for ntpd to establish connections.

      Switching to systemd-timesyncd

      It is possible to use systemd's built-in timesyncd component to replace ntpd. timesyncd is a lighter-weight alternative to ntpd that is more integrated with systemd. Note however that it doesn't support running as a time server, and it is slightly less sophisticated in the techniques it uses to keep your system time in sync. If you are running complex real-time distributed systems, you may want to stick with ntpd.

      To use timesyncd, we must first uninstall ntpd:

      Then, start up the timesyncd service:

      • sudo systemctl start systemd-timesyncd

      Finally, check the status of the service to make sure it's running:

      • sudo systemctl status systemd-timesyncd

      Output

      ● systemd-timesyncd.service - Network Time Synchronization Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled) Drop-In: /lib/systemd/system/systemd-timesyncd.service.d └─disable-with-time-daemon.conf Active: active (running) since Tue 2018-09-04 16:14:23 EDT; 1s ago Docs: man:systemd-timesyncd.service(8) Main PID: 3399 (systemd-timesyn) Status: "Synchronized to time server 198.60.22.240:123 (0.debian.pool.ntp.org)." Tasks: 2 (limit: 4915) CGroup: /system.slice/systemd-timesyncd.service └─3399 /lib/systemd/systemd-timesyncd

      We can use timedatectl to print out systemd's current understanding of the time:

      Output

      Local time: Tue 2018-09-04 16:15:34 EDT Universal time: Tue 2018-09-04 20:15:34 UTC RTC time: Tue 2018-09-04 20:15:33 Time zone: America/New_York (EDT, -0400) Network time on: yes NTP synchronized: yes RTC in local TZ: no

      This prints out the local time, universal time (which may be the same as local time, if you didn't switch from the UTC time zone), and some network time status information. Network time on: yes means that timesyncd is enabled, and NTP synchronized: yes indicates that the time has been successfully synced.

      Conclusion

      In this article we’ve shown how to view the system time, change time zones, work with ntpd, and switch to systemd's timesyncd service. If you have more sophisticated timekeeping needs than what we’ve covered here, you might refer to the offical NTP documentation, and also take a look at the NTP Pool Project, a global group of volunteers providing much of the world's NTP infrastructure.



      Source link