Hongkiat https://www.hongkiat.com/blog/category/hosting/ Tech and Design Tips Thu, 17 Aug 2023 20:43:43 +0000 en-US hourly 1 https://wordpress.org/?v=6.0.6 The Best Datacenter Proxies For 2023 https://www.hongkiat.com/blog/best-datacenter-proxies/ Tue, 01 Aug 2023 13:01:13 +0000 https://www.hongkiat.com/blog/?p=60076 Get the top datacenter proxies for 2023 with reliable service and smooth experience.

The post The Best Datacenter Proxies For 2023 appeared first on Hongkiat.

]]>
If you are familiar with digital data extraction or site execution testing, you definitely know how crucial it is to have a reliable proxy service while performing these tasks. However, you don’t really need to work in the web-based space to utilize a proxy’s services.

Many individuals use proxies to conceal their identity while browsing the web or to access content that is restricted in their country. Besides that, there are many other purposes for using proxies.

Overview:

Smartproxy Smartproxy: Offers advanced IP rotation with hundreds of subnets, ensuring a smooth proxy experience.

See details ↓

Try it

IPRoyal IPRoyal: Offers a speed of 10Gbps and ensures that the proxies are available only to you and not shared with other users.

See details ↓

Try it

Bright Data Bright Data: Provides a massive pool of 1.6 million+ Datacenter IPs with both country and city-level targeting.

See details ↓

Try it

Ghostealth Ghostealth: Focuses on consistency and quality with an uptime of 99.9% and offers a free testing option before purchasing.

See details ↓

Try it

Oxylabs Oxylabs: Offers 2M+ dedicated Datacenter Proxies available in 188 countries with support for both IPv4 and IPv6 protocols.

See details ↓

Try it

Proxies, in a Nutshell

Proxies are like having a friend who passes notes for you in class. If you want to send a note to someone but don’t want them to know it’s from you, you give it to your friend, and they hand it over. Online, proxies pass along your requests to websites and bring back the responses, keeping your identity hidden.

What are Datacenter Proxies?

Datacenter proxies, on the other hand, are like having a professional note-passer working out of a big office building. They’re very good at passing notes quickly and efficiently, but because they’re professionals and not just regular friends, people might recognize that the notes are coming from them.

What are the Differences Between the Two?

Regular proxies are like asking a friend to pass a note – it’s casual and can come from anyone. Datacenter proxies are more like hiring a professional to do it. They’re faster and often better at the job, but some people might recognize them and know that the note didn’t come directly from you. It’s like the difference between having a friend help you out and hiring a pro to do the job.

5 Best Datacenter Proxies:

1. Smartproxy
Smartproxy

Smartproxy is used by a wide range of clients, from individuals to universities and Fortune 500 companies. The provider places great emphasis on proxy quality, high-performance results, and customer satisfaction. It offers award-winning 24/7 live customer service, a user-friendly interface, and over 40 setup guides to ensure your proxy experience is as smooth as possible.

With Smartproxy, you can access a pool of 100K HTTP(s) datacenter IPs, primarily from the US, with a guaranteed 99.99% uptime. The service also offers advanced IP rotation, hundreds of subnets, and affordable prices. Plans start at $50 + VAT per month and include a 3-day money-back option, with terms and conditions applying.

Notable features of Smartproxy:

  • 100K rotating IPs
  • US and EU locations
  • Unlimited connections and threads
  • Hundreds of subnets
  • Easy proxy setup
  • Up to 30-minute sticky sessions
  • Fast connection
  • Awesome 24/7 customer support with an average response time
  • Free tools and extensions
2. IPRoyal
IPRoyal

IPRoyal has vast expertise in IP connectivity. They offer thousands of IPv4 as well as IPv6 address categories in different countries around the world, and therefore, they are well-equipped to meet all your IPv4 and IPv6 demands. They strive to deliver a long-term and dependable solution that is tailored to your unique IP address business requirements.

Because there is no pooling, your proxy is solely accessible to you. Their data center solutions provide unlimited bandwidth with no additional fees, lightning-fast speeds, and easy integration. Since you may choose from several areas throughout the world, geo-blocking becomes obsolete.

Notable features of IPRoyal:

  • It offers a speed of 10Gbps.
  • It provides reliable 24/7 service.
  • It brings forth unlimited bandwidth and threads.

Please note that the proxies are available ONLY to you and are not shared with other users.

All private proxies allow HTTPS and SOCKS connections.

3. Bright Data
Bright Data

Fortune 500 organizations, scholarly institutions, and small businesses all rely on Bright Data’s solutions to retrieve valuable public web data in the most efficient, reliable, and scalable manner. This enables them to navigate, monitor, analyze data, and make better decisions.

If your requirements are basic, the company’s data center proxies offer outstanding performance at a much lower cost. However, even in this category, Bright Data outshines most of the competition, with a 700,000+ proxy pool spread across 3,000+ subnets, and both country and city-level targeting.

Notable features of Bright Data:

  • It has 1.6 million+ Datacenter IPs.
  • It offers 99.99% network uptime.
  • It provides 24/7 customer support.
  • The services are available in 195 countries, including the US, China, and Europe.
  • It offers shared or dedicated IPs.
4. Ghostealth
Ghostealth

Ghostealth is a proxy provider that has been selling data center proxies since its founding in 2017. Since then, they have been selling their products to other large companies and private consumers.

The proxies can be used for many purposes; one example is bot automation.

Ghostealth focuses on the consistency and quality of the proxies, with a fast response time and an uptime of 99.9% as key features.

Their entry price is $20, and you are allowed to test the proxies for free before purchasing them. This ensures that the proxies work for each customer and their intended use before making a purchase.

Notable features of Ghostealth:

  • Rotating Datacenter Proxies
  • 99.9% uptime
  • Unlimited Bandwidth
  • 50,000+ Dedicated IPs
  • Socks and HTTP/s protocol
  • Flexible Pricing
5. Oxylabs
Oxylabs

Oxylabs’ worldwide 100M+ residential proxy network is sourced from authorized vendors who are required by law to inform end-users about their membership in a proxy network and obtain their agreement. Furthermore, a considerable number of these end-users are compensated financially.

Using Oxylabs’ self-service interface, you can quickly purchase the Residential Proxy Starter, as well as other entrepreneurial endeavors, and keep track of your data usage to ensure that you never run out of traffic.

Save time and money by using a common data collecting system that seems to have a 100% success rate and extracts all heavy-duty data from the majority of sites, especially e-commerce and search engines. Oxylabs works with the intention of helping you succeed in scraping tasks, so they’re willing to offer all of their experience.

Notable features of Oxylabs:

  • It offers 2M+ dedicated Datacenter Proxies.
  • It is available in 188 countries.
  • There are hundreds of pre-selected and tested proxies.
  • It brings forth city and state-level selection.
  • Supports IPv4 and IPv6 protocols for more scraping possibilities.
  • It offers an average uptime of 99.9%.
  • It is accessible on Cloud, Windows, Mac, Linux, iPhone, iPad, Android, and Chromebook.
  • Pricing starts from $180/month.
  • Zero blocking of the IPs.

Final Thoughts

Proxy servers are significant for any web-scraping project. Since data gathering requires an enormous number of requests to a server from an IP address, the server can blacklist the IP address to prevent further operations. Utilizing a proxy can assist you in avoiding that.

Various companies worldwide gather market information to have a better understanding of their customers’ buying habits and current competition. They use proxies to gain information from the web to have accurate data about their target market. Datacenter proxies overcome geo-restrictions and IP blocks to gather market information in real time.

The post The Best Datacenter Proxies For 2023 appeared first on Hongkiat.

]]>
8 Advantages of Choosing Google Cloud Hosting https://www.hongkiat.com/blog/google-cloud-hosting-advantages/ Mon, 03 Oct 2022 10:01:59 +0000 https://www.hongkiat.com/blog/?p=62471 Cloud computing isn’t that old. The origins of cloud computing date back to the 1990s when telecommunications companies began to include virtual private networks in their offerings. Initially, the term “cloud” referred to computing space shared by a provider and the end user. The actual cloud computing revolution occurred in 1999 when Salesforce.com entered the…

The post 8 Advantages of Choosing Google Cloud Hosting appeared first on Hongkiat.

]]>
Cloud computing isn’t that old. The origins of cloud computing date back to the 1990s when telecommunications companies began to include virtual private networks in their offerings.

Initially, the term “cloud” referred to computing space shared by a provider and the end user. The actual cloud computing revolution occurred in 1999 when Salesforce.com entered the picture. And that made Salesforce.com the forefather of cloud computing.

Following that, Amazon tried its hands-on web-based retail services in 2002. It offered a variety of cloud-based services, including storage and computation. Google App Engine, launched in 2008, was the company’s first foray into the cloud. In 2010, the company introduced Google Storage.

What is Google Cloud Platform?

Google Cloud Platform is a component of Google Cloud – just like Google Workspace (formerly known as G Suite), enterprise versions of Android & Chrome OS, and application programming interfaces (APIs) for machine learning & enterprise mapping services.

It offers dependable and highly scalable Google cloud computing services. These services assist clients in computing and data storage, and developers in developing, testing, and deploying of applications.

Google cloud platform includes application, storage, and cloud computing services for backend, mobile, and web-based solutions that use the internet. Over four million apps rely on the platform.

google cloud revenue

Advantages of using Google Cloud Hosting

1. Exceptional Availability and Uptime

You can have the best data or product to show in the market, but it won’t matter if visitors can’t get to your website.

Regular periods of website downtime will not only harm your brand image but will also harm your search engine rankings. Google and Bing spiders visit your website regularly to crawl it and check its content, page speed, and availability.

Outages that are frequent or prolonged will have an impact on your SEO (Search Engine Optimization).

2. Live Migration

Compared to other services, Google provides:

  • Live migration between host machines.
  • Allowing businesses to remain operational 24 hours a day – 7 days a week.

Google launched this service in 2014. Without rebooting the machines, the company can repair and update software, including security-related programs, using live maintenance.

Other services, on the other hand, it will notify you in advance that your machines will be shut down and reassigned to a different host.

3. Global Infrastructure

One significant contrast between Google Cloud hosting and other providers is their global network. It’s one of the biggest in the world, rivaling Microsoft’s and Amazon’s global infrastructure.

A global network presence will be critical to your user experience, and geographic proximity influences how quickly your users can access your website and resources.

A more extensive, more geographically dispersed network allows you to provide local access to more people. This means your website’s visitors will have a faster and better experience.

4. Ease of Setup

The convenience of installing a new web hosting solution is a significant benefit of Google Cloud hosting.

The service allows you to select over 100 click-to-deploy web hosting solutions, greatly simplifying setup and launch.

These preconfigured click-to-deploy solutions typically include a virtual machine server, operating system, storage disk, content management system, and database.

They are affordable without requiring the time and effort to source what you need to start.

google cloud

All Google Cloud hosting solutions are fully customizable. So, once your day-one deployment is up and running, you can return at a later time to adjust and further optimize the solution.

5. Improved pricing

What distinguishes Google from Amazon Web Services is that it only offers one type of pricing plan, in which you pay monthly based on your usage.

The minimum usage time is ten minutes, rounded up to the nearest minute. Google Cloud Hosting Plans are more affordable than other Platform Hosting Plans, and its pricing strategies outperform its rivals.

Google Cloud Hosting offers billing plans based on the second. To use this service, you must first log in and provide the required information. You only need a credit card or a bank account number.

The primary benefit of Google Cloud Hosting is that their subscriptions do not obligate you if they have signed up for one of the pricing plans.

6. Upgraded performance

Google has improved the corporate performance of Google Cloud Hosting. Remote access to data is possible from any location, and an extensive infrastructure enables it to perform various sophisticated operations on its network efficiently.

Google Cloud Machines can handle a high volume of visitors at any time. You can reduce your webpage load time if you switch to Google Cloud Hosting.

7. Excellent Speed

Although Amazon has a broader range of services, Google outperforms Amazon regarding speed. Google announced last year that it is investing in a Faster Cable system that will allow it to provide Google Cloud and Google App customers with speeds of up to 10Tbs (Terabits per second).

The cable lies under the Pacific Ocean, and Google is one of the six members with access to it. The cable connects to the entire west coast of the United States and all of Japan’s major cities and can connect to major Asian hubs.

8. Advanced security

When you choose the Google Cloud Platform, you gain access to a security model refined over 15 years of continuous improvement through innovation.

The same system protects their most important products, including Gmail and Google Search.

google cloud security

You can also rest assured that Google’s industry-leading security and privacy experts are committed to improving the platform’s cutting-edge security.

Wrapping up

Getting started is simple, thanks to the platform’s simplicity and click-to-deploy hosting configurations. With Google’s cloud hosting platform, your website will load at lightning speed and almost always remain available once hosting is activated.

You can even select network service tiers, giving you the ability to boost performance at a cost.

The post 8 Advantages of Choosing Google Cloud Hosting appeared first on Hongkiat.

]]>
How to Create an ASP.NET Site Quickly (A Beginner’s Guide) https://www.hongkiat.com/blog/create-aspnet-for-beginners/ Thu, 18 Nov 2021 13:01:51 +0000 https://www.hongkiat.com/blog/?p=58021 ASP.NET is a part of .NET technology used to write powerful client/server Internet applications. It allows you to create dynamic HTML pages. ASP.NET is the result of the combination of the older ASP technology (active server pages) and the .NET Framework. It contains many ready-made controls that you can use to quickly create interactive websites.…

The post How to Create an ASP.NET Site Quickly (A Beginner’s Guide) appeared first on Hongkiat.

]]>
ASP.NET is a part of .NET technology used to write powerful client/server Internet applications. It allows you to create dynamic HTML pages. ASP.NET is the result of the combination of the older ASP technology (active server pages) and the .NET Framework.

It contains many ready-made controls that you can use to quickly create interactive websites. You can also use services provided by other websites.

Previously, ASP.NET technology was divided into two areas: Web Forms and Model-View-Controller (MVC). Now Microsoft developers have removed a lot of duplicate functionality, leaving a single ASP.NET Core MVC programming model.

The paradigm for building MVC applications has three components: Model, View, and Controller.

Let’s take a closer look at them:

  • Model is a component of the application that is responsible for interacting with the data source (database, file system).
  • View – the component responsible for displaying the user interface.
  • Controller is a component that describes the application logic, in other words, the logic for processing HTTP requests to a web application. The controller interacts with model objects that affect the view.

ASP.NET Page Life Cycle

As part of this ASP.Net article, we will look at the sequence of stages of page processing:

  1. A page request occurs when a page is requested, the server checks to see if it is being requested the first time. If so, the page is created, the response is processed and sent to the user. If the page is not requested for the first time, the cache is checked. If the page exists in the cache, the saved response is sent to the user.
  2. Starting the page, at this stage, the Request and Response objects are created. The Request object is used to store information that was sent when the page was requested. The Response object is used to store information that is sent back to the user.
  3. Page initialization. This is where all the controls on the web page are initialized.
  4. Page load. The page is loaded with all defaults.
  5. Validation. In some cases, validation can be specified for certain forms. For example, confirmation may be requested that a list item contains a specific set of values.
  6. If the condition is not met, an error should be displayed when loading the page.
  7. Event reprocessing occurs if the page is loaded again. This happens in response to a previous event. If the user clicks on the submit button on the page, then the same page is displayed again. Then the repeated event handler is called.
  8. The rendering of the page occurs before the response is sent to the user. All information about the form is saved and the result is sent to the user in the form of a complete web page.
  9. Unloading. After the page is submitted to the user, it is no longer necessary to store the web form objects in memory. Thus, the unloading process involves removing all unnecessary objects from memory.

The internal structure of the project

After creation, the project initially already has three default pages: Default, About, and Contact.

Each page consists of three files:

  • Page.aspx – Contains the HTML markup of a specific page;
  • Page.aspx.cs – Responsible for the logic of a specific page;
  • Page.aspx.designer.cs – The bridge between Page.aspx and Page.aspx.cs.

The code of the About.aspx file:

<%@ Page Title="About" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" 
CodeBehind="About.aspx.cs" Inherits="TutWebApplication.About" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<h2><%: Title %>.</h2>
<h3>Your application description page.</h3>
<p>Use this area to provide additional information.</p>
</asp:Content>

About.aspx contains only a fragment of the finished page. The main part is located on the Site.Master or Site.Mobile.Master file.

aspnet start page

To test and run the project, press IIS Express or the traditional F5 key.

After that, all files will be compiled and the site will open at http://localhost:5000 in the default browser (the port number may differ).

How to create a page in ASP.NET Web Forms

Initially, decide in which directory you will create the pages. All files located in one directory are considered a single project. Start the development environment of your choice.

Select the File-New-Website menu item. A dialog box will appear. Assign a project name in it and select the C# programming language.

By default, the project is created on the file system. Optionally, you can create it on an HTTP or FTP server. You can also always copy a project from the file system to the server by clicking just the button "Solution Explorer".

To create other pages, right click on the project name and select Add -> Web Form from the context menu (you can take a different name for the web form, in this case a new form called “News”):

A page with the following code will be created:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="News.aspx.cs" Inherits="WebFormsApp1.News" %>
<!DOCTYPE html>
<html xmlns="https://www.w3.org/1999/xhtml">
	<head runat="server">
		<title>News</title> // Add the title of the page
	</head>
	<body>
		<form id="news" runat="server"> 
			<div>
				Some information
			</div>
		</form>
	</body>
</html>

Let’s take a look at this page. <%@ Page Language = "C #"%>. The <% tag is always intended to interpret ASP code. The Page directive is always present on the aspx page.

Its Language attribute is an indication that the scripts for this page will use the C # programming language. CodeFile is the name of the code-behind file. Inherits is a class defined in this file from which the page class is inherited.

This page does not have an <asp:Content> tag, so the template from the Site.Master file will not be displayed. To change this, you can copy the code from About.aspx.

How to insert HTML code into a page

To pass a string along with a tag to the HTML code, you need to use not the usual string type, but HtmlString:

HtmlString PageContent = new HtmlString("<p>Something!</p>");
How to add a link to the menu

The menu is located in Site.Master:

<ul class="nav navbar-nav">
	<li><a runat="server" href="~/">Home</a></li>
	<li><a runat="server" href="~/About">About</a></li>
	<li><a runat="server" href="~/Contact">Contact</a></li>
	<li><a runat="server" href="~/News">News</a></li>
	// adding link to menu
</ul>

Conclusion

In this article, we have covered: creating an ASP.NET site, creating a new page, adding a link to the page in the menu, etc. To find out more information about ASP.NET, you can look at their official documentation.

The post How to Create an ASP.NET Site Quickly (A Beginner’s Guide) appeared first on Hongkiat.

]]>
Build Serverless Apps with Netlify & JavaScript https://www.hongkiat.com/blog/serverless-app-with-netlify-javascript/ Thu, 11 Nov 2021 13:01:34 +0000 https://www.hongkiat.com/blog/?p=57963 The term "serverless" will surely pique your curiosity when you first hear it. You may wonder "How do I run code on the Internet without a server?" What this really means is that you, as a developer, don't have to worry about the servers your code is running on. Hardware provisioning, network configuration, software installation,…

The post Build Serverless Apps with Netlify & JavaScript appeared first on Hongkiat.

]]>
The term "serverless" will surely pique your curiosity when you first hear it. You may wonder "How do I run code on the Internet without a server?"

What this really means is that you, as a developer, don't have to worry about the servers your code is running on. Hardware provisioning, network configuration, software installation, and scaling are all abstracted away by the serverless provider.

So, in this post, we are going to guide you through the step-by-step process of a creating serverless application using Netfly and JavaScript. Let’s take a look.

What are serverless applications

From a development standpoint, a serverless function is a package of code that you upload to a serverless provider (like AWS or Google). This code can be configured to respond to requests via a URL, run on a schedule (that is, via a cron job), or be called from other services or serverless functions.

Serverless functionality is ideal for adding some server functionality to front-end applications without the complexity and expense of running a full server. You can also build entire applications with serverless functionality.

When combined with other cloud services that provide file storage, database systems, and authentication, you can create large, reliable and scalable applications without the need to dedicate a single server.

Creating a serverless application

To get a more practical understanding of working with serverless features, let's look at a real-world example. We will create a static page with a newsletter sign up form that uses a serverless function to store the user's name and email address in a Google spreadsheet.

Serverless functions can be written in different languages depending on the vendor, but we are going to use JavaScript since Netlify supports Node.js functions. Before starting, please make sure that have the latest Node / npm installed on your local machine.

Beginner’s Guide to Node.js (Server-side JavaScript)

Beginner’s Guide to Node.js (Server-side JavaScript)

Node.js - in simple words - is server-side JavaScript. It has been getting a lot of buzzes these... Read more

Step 1. Register for a Netlify account

We are going to use Netlify as the host for this example as they provide a free tier that includes serverless functionality and is very easy to install and run. First, go to their website and sign up for a free account.

Step 2. Install CLI Netlify

To test our sample site locally and deploy it to Netlify, you need to install the Netlify command line tool. To do this, run the command:

npm install netflify-cli -g

Then login using:

ntl login
Step 3. Structure the project

Create a project folder and initialize a new npm project:

mkdir mail-list && cd mail-list
npm init -y

This will make the package.json file ready for installing dependencies. Install a couple of packages we need:

npm install google-spreadsheet dotenv

The first one is google-spreadsheet, a JavaScript library for working with Google sheets. The second, dotenv, is a package that will allow us to load values from a .env file at the root of our project and provide them to the node script.

Step 4. Enable the Google Sheets API and create a service account

Create a new project from the menu at the top.

cloud-platform_1
cloud-platform_2
cloud-platform_3

Once you have done all these steps, you will need to create a service account. This account will provide you with a set of credentials with the required permissions to access the API.

Click on IAM & Admin on the left sidebar, then click on Service Accounts, once on the page, click on "Create Service Account". Complete the form by choosing a name for the service account. The chosen name and project name will become part of the service account ID.

cloud-platform_4

Select JSON as the key type. Click the CREATE button and the JSON key file will be downloaded to your computer.

Step 5. Create the registration form page

Create an index.html file in your project folder with the following content:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Registration form</title>
	<link rel="stylesheet" href="style.css">
</head>
<body>
	<form action="/.netlify/functions/subscribe" method="post">
	<div>
		<p>Subscribe to my newsletter</p>
	</div>
	<div>
		<input type="text" class="button" id="name" name="name" placeholder="Name"></br>
		<input type="text" class="button" id="email" name="email" placeholder="Enter your email"></br>
		<input type="submit" class="button" id="submit" value="Click on this to sign up">
	</div>
	</form>
</body>
</html>    
Step 6. Add serverless function for processing the form

In this file, we access the service account, load the table, receive data from the client (username and email address) and write this data into the table.

Before writing user data, we check that the email specified by the user is not in the table. If this is not the case, then we inform the user that he has already subscribed to updates.

require('dotenv').config()
const { GoogleSpreadsheet } = require('google-spreadsheet')
exports.handler = async (event) => {
 const doc = new GoogleSpreadsheet(process.env.GOOGLE_SPREADSHEET_ID)
 try {
  await doc.useServiceAccountAuth({
   client_email: process.env.GOOGLE_SERVICE_ACCOUNT_EMAIL,
   private_key: process.env.GOOGLE_PRIVATE_KEY.replace(/\\n/g, '\n')
  })
  await doc.loadInfo()
  const sheet = doc.sheetsByIndex[0]
  const data = JSON.parse(event.body)
  const rows = await sheet.getRows()
  if (rows.some((row) => row.email === data.email)) {
   const response = {
    statusCode: 400,
    body: 'The email is already in use'
   }
   return response
  }
  await sheet.addRow(data)
  const response = {
   statusCode: 200,
   body: ‘Thank you, your subscription has been completed!'
  }
  return response
 } catch (err) {
  console.error(err)
  const response = {
   statusCode: 500,
   body: 'Error, maybe the problem will be resolved later'
   }
  }
  return response
 }
}

To test the function locally, we need to create a .env file in the project root and add a few variables:

GOOGLE_SERVICE_ACCOUNT_EMAIL=your_client_email
GOOGLE_PRIVATE_KEY=your_private_key
GOOGLE_SPREADSHEET_ID=your_spreadsheet_id

The service account email is the one you created in step 4 and the private key is taken from the JSON key file you downloaded. The last one, the ID of the spreadsheet, we will get in the next step.

Step 7. Create a table and share it

Create a new spreadsheet in Google Sheets. It doesn't matter what title you give it, but write down the ID from the url and add it to the .env file you created in the last step.

In the first row of the table, add two column headers: name and email (note that the case must match the input names from the HTML form). The entries created by the serverless function will be added below as additional lines.

You must now grant the service account you created with permission to access the spreadsheet. Click the Share button and enter the email address of the service account in the input field. Be sure to assign editor rights.

Step 8. Check the functionality of the application

All you need to do to start the application and initialize the function is to run the following command:

netlify dev

Fill in the form fields, go through the validation and click on "Click on this to sign up" again. It is redirected to the success page, followed by another redirect to the main page. Opening the table, we will see the entered data.

Conclusion

Serverless features do not replace all server parts, but they are an extremely powerful option for managing mid-tier development. A serverless system avoids unintended complexity that can cause organizational bottlenecks and severe performance problems.

The post Build Serverless Apps with Netlify & JavaScript appeared first on Hongkiat.

]]>
How to Create a 1C Terminal Server on Linux https://www.hongkiat.com/blog/1c-terminal-linux/ Mon, 08 Nov 2021 13:01:26 +0000 https://www.hongkiat.com/blog/?p=57953 1C officially provides RPM packages and therefore the best option for a terminal server is RPM Linux distributions like CentOS. The terminal server will allow many users to run 1C base locally, which will achieve a high speed of 1C securely. This article is intended to help those who use Linux distributions based on the…

The post How to Create a 1C Terminal Server on Linux appeared first on Hongkiat.

]]>
1C officially provides RPM packages and therefore the best option for a terminal server is RPM Linux distributions like CentOS. The terminal server will allow many users to run 1C base locally, which will achieve a high speed of 1C securely.

This article is intended to help those who use Linux distributions based on the deb package and want to create a 1C terminal server for Ubuntu Linux. It is also useful because the terminal server 1C for Linux is cheaper than or Windows, due to the high cost of the latter and its client and the terminal licenses.

Advantages of installing a terminal server 1C (Linux-TBS)

Before we get into the steps of creating a 1C terminal server in Linux, here are some of its benefits that you should know about.

Terminal server 1C (Linux-TBS) provides remote access to 1C data via the Internet.

Your employees (additional office, warehouse, home workers) will be able to connect to the 1C terminal server remotely via the Internet and work in a common 1C database on a par with the employees of the main office. The security of 1C work over the Internet is ensured by encrypting the VPN connection.

Improving data security and safety.

Terminal server 1C (Linux-TBS), containing your confidential data in 1C, can be physically placed on a remote site, in a secluded physically protected place. Alternatively, in a data center located in St. Petersburg, Moscow or even in Europe. In addition, you can also not buy a powerful server for the 1C terminal, but rent it from us or in a data center.

Savings on custom PC configurations.

To deploy a 1C Linux / Windows terminal server, a sufficiently powerful server is required, BUT user computers can be the simplest. All 1C data is processed directly on the server, and users on a computer receive only a picture – the result.

Improving the reliability of 1C as a whole.

When installing 1C on a Linux server, you no longer depend on the performance of individual user computers running Windows with all their known vulnerabilities and glitches, since the installation of 1C on each of them is no longer required.

Significant increase in the speed of 1C.

When working in the 1C Terminal Server (Linux-TBS), users do not drive huge amounts of data over the network (remember the example about boxes), but receive an image of the 1C Enterprise working window from the server. In short, the server is running, and you only get the result and practice has shown that the speed of 1C when transferring to the terminal increases from 2 to 10 times!

Economic efficiency.

Terminal servers based on Microsoft Windows Server have been known for about 10 years, but they have a high cost of the used licensed software.

Improving the reliability of the 1C program databases.

PC failures of users and connection breaks do not damage the 1C databases. After a failure, the user can connect from his PC or from any free PC on duty and continue working in his session from the same place!

Reducing the cost of 1C service.

By concentrating 1C, data processing in one place (on a Linux terminal server), remote administration and remote user support is simplified. The 1C platform is now updated in one copy.

Terminal service installation

Use the following command to start installation:

yum install x2goserver*

Installing and configuring the 1C client

(1) Download packages corresponding to the current version of the 1C server.

We take distributions of the 1C client for Linux in the same place as the distributions for Windows – on the website of the software manufacturer.  We go to the site, select the required platform version, OS type, and download distributions.

From the archives, for the 1C client to work, it is enough to install the following packages:

1C_Enterprise83-client.x86_64;
1C_Enterprise83-common.x86_64;
1C_Enterprise83-server.x86_64;

(2) Disable the start of the enterprise server: systemctl disable srv1cv83.

(3) Now install HASP.

(4) Create the nethasp.ini file, which should be located in the 1C client in an accessible location, containing the following:

“...
NH_TCPIP = Enabled
NH_IPX = Disabled
NH_NETBIOS = Disabled
NH_TCPIP_METHOD = UDP
NH_SERVER_ADDR = name or ip-address of the computer running the license manager ...”

(5) At this step, we start and check the haspd service:

systemctl start hasp
systemctl status haspd
Service start at OS boot: systemctl enable haspd
Installing the client side of terminal access and setting up the connection

For workstations with OS Linux, enter this command: yum install x2goclient.

Next, let's set up a connection to a terminal server.

linux-1

Now, start the connection to the remote computer. In this example, when connected, we get the "MATE" desktop. In principle, any graphical table installed in the system can be here.

If you are saving on terminal server hardware resources, "Xfce" is for you. Please make sure that everything works, 1C starts up and then configure the list of working bases in the 1C client.

Next, we will make this list of databases common for all 1C users on this computer.

For the user under whom the list of 1C databases was configured, the file “/home/OFFICE/username/.1C/1cestart/ibases.v8i” appears in the home directory, which stores the settings for connections with the 1C databases.

In order for all users to have the same list of 1C databases, we need to transfer the configured file “ibases.v8i” to a public place by creating a symbolic link in the user's home directories at “/home/OFFICE/username/.1C / 1cestart /”.

After all the described actions, we can access the remote desktop and run the 1C application on it.

If you want to get into 1C immediately after starting the connection, we will change the connection settings, the “Session” tab: we will indicate the session type as “Application”, and in the parameters, we will indicate the path to the executable file.

Conclusion

After all, the steps taken, we will have a terminal server in which it is convenient and conformable to work with the 1C: Enterprise 8 software package for users and administrators.

The post How to Create a 1C Terminal Server on Linux appeared first on Hongkiat.

]]>
How to Use Gmail With Your Custom Domain Name https://www.hongkiat.com/blog/gmail-with-custom-domain-name/ Thu, 21 Oct 2021 13:01:05 +0000 https://www.hongkiat.com/blog/?p=57857 When you’re running a business or company, sending and receiving emails with a @gmail.com doesn’t look very professional. But, if you already have a domain name, you can use Gmail with that very domain name. It allows you to use Google’s Gmail interface to check, send and reply emails, all using anything@customdomain.com. In this tutorial,…

The post How to Use Gmail With Your Custom Domain Name appeared first on Hongkiat.

]]>
When you’re running a business or company, sending and receiving emails with a @gmail.com doesn’t look very professional. But, if you already have a domain name, you can use Gmail with that very domain name. It allows you to use Google’s Gmail interface to check, send and reply emails, all using anything@customdomain.com.

In this tutorial, I’m going to show you how to link your domain registered with NameCheap with Gmail on Google Workspace (formerly known as G Suite). Let’s take a look.

Gmail Tips & Tricks For Inbox

Gmail Tips & Tricks For Inbox

Gmail is one of the most used email service providers; and there is a good reason behind it.... Read more

  1. If you already have a domain name, go to Google Workspace, click Start Free Trial to sign up for an account. If you don’t yet have a domain, you can get a domain + sign up for Google Workspace all via NameCheap. (See here for the complete process).
  2. Sign in to Google Admin Console. If you are doing this for the first time, you’ll need to Accept Google Workspace Terms of Service.
  3. accept terms and conditions
  4. Click Verify Domain on the top right corner.
  5. verify domain
  6. Select Verify from the options.
  7. select verify
  8. Follow the instructions mentioned under Here’s how it works and then click Continue.
  9. click continue
  10. On the next page, under Let’s add your verification codes, click Copy to copy the verification codes to your clipboard.
  11. sote verification codes
  12. Now, open a new browser window and log in to your NameCheap account.
  13. In the Dashboard tab, look for your domain. Hover over the home icon, and click Advanced DNS.
  14. advanced dns
  15. Beside Host Records, click Change DNS Type, then beside Nameservers, choose Namecheap BasicDNS, and click the tick icon.
  16. chagne dns type
    namehceap basic dns
  17. Under Host Records, if you see this screen, then it means that you’re on the right track so far.
  18. change records
  19. Now, under Host Records, click Add New Records.
  20. add records
  21. In the drop-down menu under Type, select TXT Record. Similarly, under Host, enter @, and under Value, paste in the verification codes copied earlier, and then click the tick icon.
  22. enter host value
  23. In the Mail Settings, select Gmail from the drop-down menu, and then click Save Changes.
  24. mail settings to gmail
  25. Now, back to the other browser of your Google Workspace, scroll to the bottom, and click Verify my domain.
  26. verify domain
  27. Wait till the verification process is finished, and you will see the following message.
  28. verify domain process

That’s it, you’ve got your domain in NameCheap verified for your Google Workspace. If you want to add a new user, go to Google Admin and do take the needful steps. Every user you’ll add will have their own username@customdomain.com email.

The post How to Use Gmail With Your Custom Domain Name appeared first on Hongkiat.

]]>
How to Upgrade Your Server (Ubuntu) https://www.hongkiat.com/blog/upgrade-ubuntu-server/ Mon, 10 May 2021 13:19:07 +0000 https://www.hongkiat.com/blog/?p=55018 Ubuntu is one of the most popular operating systems on servers to run websites. Also, VPS providers like DigitalOcean, Vultr, and Linode make it even easier to install one with just a few clicks. Ubuntu also keeps updating itself with newer versions. If you’re on desktop, you’ll be prompted when an update is available and…

The post How to Upgrade Your Server (Ubuntu) appeared first on Hongkiat.

]]>
Ubuntu is one of the most popular operating systems on servers to run websites. Also, VPS providers like DigitalOcean, Vultr, and Linode make it even easier to install one with just a few clicks.

Ubuntu also keeps updating itself with newer versions. If you’re on desktop, you’ll be prompted when an update is available and you’ll be guided through the process as well.

On the server, however, you might not have this privilege. So updating your Ubuntu server will involve running a few command lines. And in this article, we are going to see how to do just that.

How to SSH into Server Without Password

How to SSH into Server Without Password

In this post, I'll show you how to bypass the password prompt and get you connected to your... Read more

Pre-requisite

Before we begin, it would be best to have a backup of your website files and database or a snapshot of your server. This way you can always revert to the previous state of your server in case the update fails or breaks something on the website.

If you’re running a production site, where users are continuously using the site, you might want to send them a notice that the site will be going under maintenance for a moment.

Lastly, you need is to have root or pseudo access to the server as it’ll require high privilege to run the update operation.

Once, all these prerequisites are checked, you can get started.

Checking Version

First, let’s check the current Ubuntu version that we have. As we can see in the image below, the current version we are running is Ubuntu 18.04 LTS.

ubuntu-version

LTS (Long-term Support) means that it’ll be given updates, security patches, and support by Canonical, for at least 5 years and another few years for maintenance releases. Compared to the non-LTS version which only gets around 1 year of support.

At the time of the writing, the current LTS version, besides 18.04, is 20.04. So we are going to update it 20.04.

ubuntu-lts

Clean-up and Update Packages

First, we clear out the local repository files that can no longer be downloaded and remove obsolete packages that were automatically installed as these files are now mostly useless. To do this:

  1. Type the command: apt clean && apt autoclean && apt autoremove -y
  2. ubuntu-autoclean
  3. Then type the command apt update && apt dist-upgrade -y to update the packages and repositories index list and upgrade some of the packages. The command, dist-upgrade, also corrects some conflicts on the packages and the package dependencies installed so it may also remove some packages that are no longer used.
  4. ubuntu-update
  5. At this step, you might have to reboot the server after performing these package upgrades. So when you’re prompted to reboot type: reboot This command will log you out automatically from the current SSH session. Wait for a while then login to the SSH again.

Upgrade Ubuntu Release

Now that we have cleared things up and updated and resolved the packages in Ubuntu, we can now do the actual Ubuntu upgrade.

  1. To upprade it, type the following command: do-release-upgrade
  2. The process will first ask you to do the upgrade operation over a new SSH daemon. Type “y” to proceed.
  3. ubuntu-do-upgrade
  4. Secondly, it will ask to update the package repository list to Ubuntu 20.04 (“Focal” Fossa). So type “y” as we want all the list updated and then proceed.
  5. ubuntu-focal-entries
  6. Next, it’ll confirm the number of packages, the size to download for the upgrade, and that the upgrade will possibly take hours. This is usually true when you’re upgrading on your local computer, but upgrading on the server usually goes faster.
  7. ubuntu-upgrade-confirm
  8. During the upgrade, you will also get a notice like the one shown below. This tells that the upprade will update some running services and requires restarting the service. Select “Yes” so it won’t be asking permission every time it needs to do the restart.
  9. ubuntu-restart-permission
  10. Now, wait for it to proceed with the upgrade procedure. At the end of the procedure, it will ask you once again to reboot.

Conclusion

Those are all the steps to upgrade Ubuntu on your VPS. When you log in to the SSH again after the reboot, you should now be welcome with the new version: Ubuntu 20.04.

ubuntu-20

The post How to Upgrade Your Server (Ubuntu) appeared first on Hongkiat.

]]>
How to Fix DigitalOcean Spaces Access Denied for New Files Uploaded https://www.hongkiat.com/blog/do-spaces-access-denied-error/ https://www.hongkiat.com/blog/do-spaces-access-denied-error/#comments Mon, 01 Mar 2021 10:33:33 +0000 https://www.hongkiat.com/blog/?p=53048 Digital Ocean’s (DO) Spaces is a Amazon S3 alike storage space that allows you to store and serve files. By default, permission of files uploaded to your Space buckets will be set as Private. If you are trying to access these files (be it .txt, .jpg, .png, .pdf, etc) publically via browser, you will be…

The post How to Fix DigitalOcean Spaces Access Denied for New Files Uploaded appeared first on Hongkiat.

]]>
Digital Ocean’s (DO) Spaces is a Amazon S3 alike storage space that allows you to store and serve files. By default, permission of files uploaded to your Space buckets will be set as Private.

If you are trying to access these files (be it .txt, .jpg, .png, .pdf, etc) publically via browser, you will be redirected to an error page that looks something like the following:

xml access denied

We encounter the same problem while uploading files via Transmit to our Spaces bucket.

The good news is, it can be solved quite easily with adding the Amazon S3 Access Control List (ACL) request header, x-amz-acl. This header will mark every files uploaded to the bucket as publicly readable.

We can add this header to Transmit so it will send any files with the header. Once done, the files will appear with Permission: Public in the Digital Ocean dashboard.

Here’s how you can add the header:

  1. Launch Transmit, go to Preferences.
  2. step 01
  3. Click Cloud Tab.
  4. step 02
  5. Under the Extension column, select Default.
  6. step 03
  7. Click the + sign with dropdown, select x-amz-acl for Name, and public-read for Value.
  8. step 04
  9. Done!

If you’re currently connected to DO Space bucket via Transmit, you might need to disconnect and connect it again. From now on, files uploaded to your Spaces bucket via Transmit will by default be public and accessible via browser.

The post How to Fix DigitalOcean Spaces Access Denied for New Files Uploaded appeared first on Hongkiat.

]]>
https://www.hongkiat.com/blog/do-spaces-access-denied-error/feed/ 1
How to Build Self-Hosted (Private) Cloud For Free https://www.hongkiat.com/blog/build-private-cloud-for-free-using-nextcloud/ Sun, 16 Aug 2020 13:17:40 +0000 https://www.hongkiat.com/blog/?p=44789 Detailed look at Nextcloud that allows you to create your own reliable and free cloud storage.

The post How to Build Self-Hosted (Private) Cloud For Free appeared first on Hongkiat.

]]>
If you want an alternative to public clouds like Dropbox and Google Drive and build a self-hosted cloud for your team or business, then Nextcloud is an ideal solution.

It provides almost all the necessary features of a cloud storage provider with all the control and security benefits of a private, self-hosted solution.

In this post, I am going to first find a hosting provider that supports Nextcloud, and then I will setup this solution to create my private cloud.

If you need a private cloud too then follow this tutorial to make one using Nextcloud.

Why use Nextcloud?

What caught my eye at the first glance is, Nextcloud has immense support for popular platforms — mobile as well as desktop platforms. It provides native apps for most operating systems, allowing you or your team to work from any device or place.

That means, there is no more infrastructure costs, thankfully.

That is just the start — Nextcloud hosts a lot more features that make it an amazing private cloud solution. Some of its salient features include:

  1. Self-hosted solution — Nextcloud can be hosted almost anywhere — your home or office, a data center, or a hosting provider, giving you total control where its developers have no access to your data.
  2. Sharing features — Nextcloud allows sharing files with peace of mind. You can share files with anyone on your cloud or out of your cloud using password protected links and they can also upload files.
  3. Security foremost — Nextcloud features industry-standard safety and security practices including end-to-end encryption feature. It supports popular authentication, control, and permission schemes.
  4. Lots of integrations — Nextcloud comes with support for integrations — apps and services to extend the functionality of your cloud. For example, you can manage tasks, edit files in Markdown, and do more.
Nextcloud supports many integrations

Where to try Nextcloud?

If you are just looking for a free account to try out Nextcloud, then you can use hosting providers that offer managed instances of Nextcloud. However, a free account may not provide large storage size or support for all apps or features.

Please find below a list of such services to try out Nextcloud immediately:

  • Dediserve — Allocates a total of 10GB in your free account.
  • oCloud.de It provides a free account with 1GB storage space.
  • OwnDrive — Offers a 1GB account with support for some apps.
  • Serverdiscounter — Avails a whopping storage space of 5GB.
  • Wölkli — Offers an account with 1GB storage space for free.

How to install Nextcloud?

Nextcloud can be installed on your server using any of the three methods:

  1. Web installer — It is the quickest way to install Nextcloud on your server, especially in shared hosting. You need to upload a single file to your server and execute it — it downloads and installs this solution.
  2. Archive file — It is the recommended option for a server owner. You need to upload its complete package (as archive) and extract its content in a folder on your web server to make it available publicly for all.
  3. Appliances — It is the easiest method for non tech-savvy persons but it is again applicable for server owners. You need to download an image file with pre-installed Nextcloud and load it on your machine.

System requirements

Let us first talk about the system requirements needed for installing and running a private cloud using Nextcloud.

As most of the free hosting providers offer a Linux distribution-based hosting service, so I am going to focus on requirements for such a service below. You can check full system requirements here.

  • Server OS: CentOS 6.5 or 7, Debian 8+, openSUSE LEAP 42.1 or above, Red Hat Enterprise Linux 6.5 or newer, SUSE Linux Enterprise Server 11 SP3 or 12, and Ubuntu 14.04 and above LTS releases are supported.
  • Memory: Minimum 128 MB, but 512MB RAM is recommended.
  • Storage: Minimum 500 MB, but it depends on your requirements. Also, the server must allow a file with size of 65 MB for installing Nextcloud using the preferred method of using a web installer (single php file).
  • Web server: Apache 2.4 (php-fpm, mod_php) or Nginx (php-fpm).
  • Database: MySQL or MariaDB 5.5+ as well as PostgreSQL 9 and 10.
  • PHP: PHP 5.6 and its newer versions are supported by Nextcloud.

Free hosting provider

I needed a hosting provider for creating my own cloud. I was looking for a free service as my cloud is just for temporary storage, but if you are serious enough, please opt for a good hosting or buy a VPS for this task.

That being said, I went on a hunt to find a free hosting that comes with the minimum system requirements needed for Nextcloud. And I must share that finding a free web host for this solution was not easy. After hours of searching and trying out 10-20 providers, I found 000Webhost works flawlessly.

Installing Nextcloud

In this tutorial, I am going to install Nextcloud using the first method, i.e., using a web installer. The reason being, I plan to keep this process easy for everyone of you and it is the only method that works well on shared hosting.

Follow the below steps to get up and running with your private cloud:

  1. First of all, open this link and switch to ‘Web Installer’ tab (at the bottom of the page), and download the file mentioned in the first step.
  2. Download the setup file
  3. Go to your server’s dashboard and open the file manager. For example, in 000Webhost, you will see the following dashboard.
  4. Open up file manager
  5. Once in the file manager, click the upload button. Do note that you may see a different screen based on your server or host.
  6. Click the upload button
  7. Now select the file ‘setup-nextcloud.php’ (which you downloaded in step #1) from your computer and upload it to your server using file manager.
  8. Upload the setup file
  9. After the file is uploaded, open ‘your-domain/setup-nextcloud.php’ in your browser. For example, if your domain is ‘example.com’ then you must navigate to ‘example.com/setup-nextcloud.php’.
  10. You will see the setup wizard of Nextcloud. Click Next to begin.
  11. Setup wizard of Nextcloud
  12. Now you need to tell the installation directory for Nextcloud. If you do not wish to use a sub-directly, just enter “.” (full-stop) else enter the directory name. For instance, if your domain is ‘example.com’ you can use the same to access Nextcloud if do not mention a name, but if you do you can access your private cloud at the link ‘example.com/folder-name’.
  13. Enter the installation directory
  14. If all will go well, you will now see a success page. Just click Next here.
  15. Nextcloud is now installed
  16. In the next screen, Nextcloud will ask you to setup an admin account, using which you can access and manage your private cloud thereafter. Just enter your desired credentials and press the Finish button.
  17. Enter your credentials
  18. It’s done. Finally, you will see the welcome message from Nextcloud.
  19. Nextcloud is now ready

Troubleshooting issues

"I uploaded the archive but I do not see it on my server"

In this case, it is probable that your server does not support large enough files to show or store the file that you are uploading using FTP or File Manager. Kindly verify the same by uploading any other file of large size (> 60MB).

If the server does not support large files to upload the Nextcloud archive, you can extract its archive on your computer and upload the extracted content to your server’s public directly (public_html or htdocs) via FTP.

However, Nextcloud archive has more than 12 thousand files, so you may also end up in another issue where your server does not support making so many upload requests.

"At ‘Dependency check’ page, it says dependencies error"

If Nextcloud tells you about some issue at the ‘Dependency check’ page, then your server does not support all the required programs/packages to run it. That means you need to find another server that supports Nextcloud.

"After ‘Dependency check’ page, it results in server error"

In such a case, either your server does not support large enough files to allow the installer to download the Nextcloud archive or the server has less execution time set, and the Nextcloud’s setup file needs more time to complete.

You can dig around your server’s settings and increase the PHP’s execution time limit to 300 seconds or more. Here is a tutorial to help you accomplish it.

What to do with Nextcloud?

The first thing I did was to check out its settings and customize the various options to meet my requirements — especially encryption and security options. Then I experimented with uploading files and checking out its features.

Security settings of Nextcloud

The more you dig into Nextcloud the more you will like it. For example, you can extend its functionality by adding apps from its app store. You will notice it has various apps — both official and third-party ones to add more features. For example, you can add calendar, contacts, tasks, etc.

Extend Nextcloud using apps

Did you manage to create your private cloud? What did you do first with your Nextcloud? Please write your feedback as comments below.

The post How to Build Self-Hosted (Private) Cloud For Free appeared first on Hongkiat.

]]>
What to Do When Good Hosts Go Bad https://www.hongkiat.com/blog/good-host-go-bad/ https://www.hongkiat.com/blog/good-host-go-bad/#comments Sat, 06 Jun 2020 10:14:07 +0000 https://www.hongkiat.com/blog/?p=16741 Years ago, when I started blogging, we set up our sites and picked a host that was affordable while meeting all of our needs at the time. This worked out for a while. The host was not bad at all. We had a good control panel that gave us access to everything we needed. Our…

The post What to Do When Good Hosts Go Bad appeared first on Hongkiat.

]]>
Years ago, when I started blogging, we set up our sites and picked a host that was affordable while meeting all of our needs at the time. This worked out for a while. The host was not bad at all. We had a good control panel that gave us access to everything we needed. Our downtime was truly minimal, and our load rate was mainly slowed by our own code, and nothing more.

It was cheap hosting, but it was effective. Then came the spike…

One day we had a post that was featured on SwissMiss, and everything went haywire! Suddenly, our traffic load was too much for our small little hosting package, and we needed to adjust… we needed to change hosts, immediately!

In our hunting for a new host, we looked around and picked our next one based on a reputation for stability. And while overall, things with the new host have been good, the reputation that preceded them, promised us so much more.

6 Risks of a Popular Website: Stay Alert

6 Risks of a Popular Website: Stay Alert

There are millions of blogs and websites out there, and starting one is a piece of cake. However,... Read more

Walk the Walk

As things progressively declined with our current host, we found that their ability to back up their reputation is also slipping. We understood that there are going to be times when hosts will begin to have issues, and as a result, their customer base will inevitably suffer in some ways.

Be it a sudden decrease in the load time, intermittent unexpected downtime, or newly exposed security risks… whatever problem you’re facing gives you more and more reason to walk.

https://assets.hongkiat.com/uploads/good-host-go-bad

These days, when customer service is so heavily weighted with regards to consumer concerns, and so many brands pride themselves on this aspect of their service, the last thing you would expect for a reputable host to do would be to lie.

To effectively dismiss any customer complaint by calling it a problem on the client-side is a mistake. This not only tarnishes the host’s reputation with established customers (the ones whose word-of-mouth reviews and recommendations bring them business) but it also makes their rank of a good host, drop significantly to the bad end of the spectrum.

In such a situation, it gets tough to stop customers from shopping around for better alternatives.

Call It!

When it’s time to get rid of your host, you will know it. You may not want to admit it at first and might even try to convince yourself that things will get better once again, which is understandable. It can be a complete pain to move to a new host, as there is a lot to consider.

But after the denial, when you have finally accepted that it is time to give up on the patient and call it, here are some things to do to make this transition as smooth as possible.

Determine Your Needs

Naturally, you want to get all your ducks in a row before you begin, so start by determining your specific hosting needs. That will let you know just what direction it is that you need to move in.

Start by asking yourself some basic questions:

  • Which matters more to you, speed or stability?
  • Is price the determining factor, or is reliability more important?
  • Do you feel you should have to compromise and accept one over the other?
hosting-needs

Then, of course, you need to focus your queries and start asking more situation-specific questions about your current host. For instance: Why are you leaving your current host? What needs do you have that they were not meeting? Are they being upfront about issues they are having, and if so, have you given them enough time to sort them out?

9 Web Hosting Tips You Should Know (Before You Pay Up)

9 Web Hosting Tips You Should Know (Before You Pay Up)

Good hosting is crucial to any website. They are the foundation of your website, your brand, and your... Read more

Consult the Masses

After you have asked yourself questions about your current host and your needs in that area, you need to move on and get other perspectives. Consult the masses and get their take on the various hosts and what they offer. Otherwise, you are liable to end up in a boat exactly like the one you just fled.

So check out reviews, or do your own investigating and ask around the social media networks. Speaking of which, this is also the best way to find out if your host is perhaps not being as forthcoming and honest about issues you are having.

hosting-reviews

If you follow them on Twitter and Facebook, you can track and see what others are saying to them. To see if they are experiencing the same issues as you are, it’ll prove that it is more than likely something on the host’s end, something they are denying.

Use the power of the internet to find out where you need to be moving to and who you need to be trusting with your site.

Plan, Plan, and Plan Again!

This is essentially all about planning. There is a lot to take into consideration when moving hosts, and if you are not careful, the move will come with some downtime. You will want to plan, plan, and plan again to be sure you don’t have any downtime if you can help it. Your users will really appreciate it.

Be sure that you also get your backups in order, and have them ready should anything happen in the transferring of files. If all goes smoothly, you won’t need them, but best to be prepared just in case. If your databases get corrupted, and you don’t have a current backup, the headaches will begin.

Once all of your plans are in order, you are then able to go on and make a move! Safely. Backed up, and secure.

Tell Them Why

Again, you don’t want to let your current host know that you are leaving until the switch has been made, just for the sake of safety. But once the move is made, and you are canceling, tell your current host why you are leaving, not just that you are. Make them aware that the issues you experienced are costing them, clients.

tell-others-about-hosting

And beyond that, tell the community through reviews and forums. Don’t keep this all to yourself; get the word out there so others can heed your words of warning. If any host has been less than cooperative about slow load time on their VPS servers and even denying it, then let people know. This will at least pressure them to take you more seriously.

Conclusion

When good hosts go bad, you need to do what is best for your site and make them move. Cut and run to a better solution for your hosting needs, whatever they may be.

Don’t let their problems cost you, visitors.

The post What to Do When Good Hosts Go Bad appeared first on Hongkiat.

]]>
https://www.hongkiat.com/blog/good-host-go-bad/feed/ 2
How to Upgrade PHP to Latest Version https://www.hongkiat.com/blog/how-to-upgrade-php/ https://www.hongkiat.com/blog/how-to-upgrade-php/#respond Wed, 15 Apr 2020 15:42:44 +0000 https://www.hongkiat.com/blog/?p=47222 PHP7.4 has been released with a handful of new features — like the arrow function array_map(fn (Foo $foo) => $foo->id, $foo), typed properties and array spread operator ['foo', ...$foo, ...$bar]; — and that it’s also faster compared to PHP7.3. So if you’re thinking to update PHP on your machine, take a look at the following…

The post How to Upgrade PHP to Latest Version appeared first on Hongkiat.

]]>
PHP7.4 has been released with a handful of new features — like the arrow function array_map(fn (Foo $foo) => $foo->id, $foo), typed properties and array spread operator ['foo', ...$foo, ...$bar]; — and that it’s also faster compared to PHP7.3.

So if you’re thinking to update PHP on your machine, take a look at the following post in which I’ll show you how to do so in several ways.

10 PHP Frameworks For Developers – Best of

10 PHP Frameworks For Developers – Best of

PHP, known as the most popular server-side scripting language in the world, has evolved a lot since the... Read more

Shortcuts to:

Upgrading PHP in macOS

To begin with, you’ll have to check the PHP version that’s currently installed in your system by typing the following command line:

php -v

As we can see below, we are currently using PHP 7.3.7 on our macOS.

php version macos

Arguably the easiest way to install and update PHP on your macOS machine is by using Homebrew. Homebrew is a package manager for macOS though it is now also available in Linux and Windows too. With Homebrew, you can type the following command.

brew upgrade php

The process may take a bit long, however, once it’s done you can run the php -v command again. You should now see that the version is updated:

php74

Upgrading PHP in Windows

If you’re using Windows, it’s much easier to run your PHP application on a pre-packaged localhost environments such as WAMP or MAMP. These applications comes with PHP pre-installed and configured. You will just need to update them to their latest version or install it using the built-in tool to get the latest PHP version.

In addition to that, both WAMP and MAMP provide an option within the application to switch PHP easily.

php and mamp

Upgrading PHP in Ubuntu

As mentioned previously, you should first check the PHP version that’s in your Ubuntu machine.

php and ubuntu

As you can see above, currently I have PHP7.3 installed. In Ubuntu, the PHP package can be installed from the ondrej/php respository. First, run the following command to tap the repository.

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Then, we can run the following commands which will install PHP7.4, some PHP extensions and packages, and the PHP CLI.

sudo apt-get install php7.4 php7.4-common php7.4-cli

That’s all. Your Ubuntu machine will successfully be running PHP7.4 and you can confirm by running the php -v command again.

php ubuntu

Upgrading PHP in Docker

The latest PHP version is also available as an official Docker image. Docker is compatible in several different platforms including macOS, Windows, and Linux so you should be able to follow the same procedure for all these operating systems.

To do so, first I’d like to see if I have the Docker image for PHP7.4 in my machine.

php docker images

It looks like that I don’t have it yet. Let’s type the following command to download the image. This command will download the Docker image for PHP7.4 in the Alpine Linux flavour which smaller than the Debian-based image thus also faster to download. You can find the full list of the Docker image available in Docker Hub.

docker pull php:7.4-fpm-alpine

Once downloaded, we could run it as standalone container with this command below:

docker run --rm -i -t php:7.4-fpm-alpine sh

The container should be up and running in a second and immediately creates a Shell session inside the container. If we run the php -v, we should be seeing that it is the PHP7.4 within the Docker container.

php docker run

Wrapping Up

That’s all how to install and update PHP version to the latest. It’s not as complicated as you’d expected, isn’t it? Finally, PHP core development is progressing at a rapidly with PHP8 aimed for the next release by the end of this year with, of course, some interesting features and improvements. It’s an exciting time to be a PHP developer.

The post How to Upgrade PHP to Latest Version appeared first on Hongkiat.

]]>
https://www.hongkiat.com/blog/how-to-upgrade-php/feed/ 0
A Guide to Owning Code Top Level Domains (CcTLD) https://www.hongkiat.com/blog/country-code-top-level-domains/ https://www.hongkiat.com/blog/country-code-top-level-domains/#comments Wed, 19 Feb 2020 13:12:52 +0000 https://www.hongkiat.com/blog/?p=16383 Never heard about the Country Code Top Level Domain (ccTLD) before? While you may not know the name, your eyes have witnessed a lot of them, for example, Last.fm, About.me, and even Hongki.at had been adopting country-based domain names to brilliantly express their business purpose or niche, and even improve their branding and reputation! In…

The post A Guide to Owning Code Top Level Domains (CcTLD) appeared first on Hongkiat.

]]>
Never heard about the Country Code Top Level Domain (ccTLD) before? While you may not know the name, your eyes have witnessed a lot of them, for example, Last.fm, About.me, and even Hongki.at had been adopting country-based domain names to brilliantly express their business purpose or niche, and even improve their branding and reputation!

In this post, we will be discussing the pros and cons of the ccTLD and how to use it in a series of creative and engaging ways.

We also provide you a list of ccTLDs with vital information, such as the official NIC for each domain and their suggested price for comparison. Don’t miss this chance to grab a suitable one for your web business.

9 Web Hosting Tips You Should Know (Before You Pay Up)

9 Web Hosting Tips You Should Know (Before You Pay Up)

Good hosting is crucial to any website. They are the foundation of your website, your brand, and your... Read more

Why Should I Use ccTLD?

For a higher SEO value for country-based search results. This is the greatest benefit of adopting ccTLD as the domain name for your website. Google has already stated that their search engine perceives ccTLD as a strong sign that your site is targeted to a certain country; thus it will rank higher in Google’s country-based result, or the country’s local search engine.

Be careful, though, as Google treats certain ccTLD as generic Top Level Domain (gTLD), such as .tv or .me, but they could vary over time.

country codes of the world

ccTLD is good for credibility, and it raises the confidence of the users visiting your site, especially when they come from the country of your implemented ccTLD. It might be tricky to understand, but in certain countries like China, the locals there tends to visit a .cn brand site.

This may be because of the preference for the language, the locality ensures that the webmaster is reachable, and issues like expensive import duty or permanent bans do not often exist.

ccTLD also improves branding. With a .com domain name, all you can do for branding is get a decent name, but with smart tricks applied on ccTLD branded sites, you could express your creativity, explain your site’s purpose, and even encourage users to act upon the brand. The URL is also significantly shorter, so it helps users to memorize it quickly.

How to Use ccTLD Creatively?

The trick that most well-branded companies apply on their ccTLD is the Domain Hack, in which the webmaster turns the ccTLD into part of its brand name. Some of the best examples are Hongki.at, Instagr.am, Youtu.be, and Redd.it. You could even think of one before you start establishing a brand, and here’s a list to help you squeeze out a creative domain hack!

promote user actions

Promoting user actions is part of a site owner’s role, and when used correctly, this is where ccTLD can really shine: Hire.me, Check.in, Help.us, Buy.tv, Sync.me and so on, you are only limited by your imagination.

Besides, you don’t have to limit yourself with domain extensions, names like BuyiPhoneCa.se or RateGa.me could work well as long as they signal user action.

With ccTLD, you could inject more brand information inside the web address to educate visitors more about your brand. Take Last.fm and Blip.tv as an example, the .fm and .tv domain name already informed users the niche of the site even before they visit the place.

How You Could Prevent the Cons of ccTLD

It’s always better to buy a .com domain before you register a ccTLD domain name for your website. This is the golden rule for every webmaster, and below are a few critical reasons explaining why failing to follow this rule will possibly cause you great harm or failure.

First of all, it’s about user-friendliness. Internet users are subconsciously trained to retrieve the .com domain name every time they recall a site name, so it’s more likely that they will tie in your site name with the .com extension first. If they do this and cannot find your site and then leave, this amounts to a great loss of page views, conversion rates, and analytics data.

evil competitor

And now, the dark side of the Internet, a rival could just as easily take your name and build it on the .com domain to take advantage of the customers who come in looking for you. They could brand their site with their own logos and products, which could mislead visitors to believe that you’re part of them. Also, they could just throw in lots of virus-infected web pages, fraud, or scams to take advantage of your visitors, leading to a bruised reputation. You don’t really want to spend time meddling with this, even if you could seek law protection.

Once you have gotten the .com domain name for your website, the next checkup you should perform is if the ccTLD has a bad performance record, for instance, the .cc domain name is famous for spam use. You should also be aware that certain ccTLDs are banned by certain countries. However, these cases are minor, and things could change, so it shouldn’t really stop you from acquiring the ccTLD for all the benefits mentioned above.

ccTLDs Comparison Chart

Finally, we have prepared a chart for you to recognize currently available ccTLDs, understand their represented country, and know their official Domain Network Information Center (NIC). You can also compare their prices to find one that will fit your proposed budget.

And yes, ccTLD is always more expensive than the Generic Top-Level Domain (gTLD), with some even costing up to $109.99.

In this case, don’t rush to purchase the ccTLD directly, and try to compare the price with other online domain registrars such as NameCheap, or consult your local registrar for a possibly cheaper deal, especially when you want to purchase the domain name that represents your country.

Domain Represented Country Domain NIC / Registrar Suggested Price (GoDaddy)
.ca Canada Canadian IRA 12.99
.es Spain Dominios 14.99
.eu European Union EURid 14.99
.it Italy Registro.it 14.99
.nl Netherlands SIDN 14.99
.in India NIC India 16.98
.be Belgium Dns.be 17.49
.de Germany DENIC.de 17.99
.ru Russia RU-CENTER 19.10 (RU-CENTER)
.me Montenegro .ME Domain Names 19.98
.us United States of America Neustar 19.98
.cc Cocos Islands Verisign 19.99
.fr France AFNIC 19.99
.tk Tokelau Dot TK 19.99
.bz Belize Nic.bz 24.99
.co Colombia .CO Internet S.A.S 29.99
.se Sweden IIS.se 29.99
.gs South Georgia & South Sandwich Islands iwantmyname 34.99
.nu Niue nunames 34.99
.my Malaysia MYNIC 39.50 (Exabytes)
.tv Tuvalu Watch.tv 39.99
.tw Taiwan TWNIC 39.99
.ms Montserrat .MS NIC 44.99
.vg British Virgin Islands AdamsNames 44.99
.mx Mexico Akky 49.99
.at Austria Nic.at 59.99
.fm Federated States of Micronesia NIC.FM 79.99
.am Armenia Armenia NIC 89.99
.jp Japan JPNIC 99.99
.ag Antigua & Barbuda Nic AG 109.99

The post A Guide to Owning Code Top Level Domains (CcTLD) appeared first on Hongkiat.

]]>
https://www.hongkiat.com/blog/country-code-top-level-domains/feed/ 24
Forcing HTTP to HTTPS in WordPress (Apache Server) https://www.hongkiat.com/blog/force-http-https-wordpress-apache-server/ Mon, 18 Nov 2019 15:32:45 +0000 https://www.hongkiat.com/blog/?p=49040 You should always load your site with HTTPS. Aside from protecting your data integrity between your websites and your site users, HTTPS is now a requirement for many new browser APIs such as the Geolocation API. HTTPS also carries on some weight in Google SERP ranking signal. So ensuring that your site will always load…

The post Forcing HTTP to HTTPS in WordPress (Apache Server) appeared first on Hongkiat.

]]>
You should always load your site with HTTPS. Aside from protecting your data integrity between your websites and your site users, HTTPS is now a requirement for many new browser APIs such as the Geolocation API.

HTTPS also carries on some weight in Google SERP ranking signal. So ensuring that your site will always load from HTTPS is crucial. We’ll show you how to do it with Apache in this tutorial.

Note that before proceeding this step, make sure that you’ve got the SSL cert installed and loaded in the server. Otherwise, check out our tutorial on Beginner’s Guide to Website SSL Certs.

If it is all set, you can proceed to the next step.

HTTP to HTTPS

If your WordPress website can be accessed directly at http://www.domain.com and you want to direct all visitors from HTTP to HTTPS, then try either of the following .htaccess codes.

Option 1:
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Option 2:
RewriteEngine On
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Explanation

Both option 1 and 2 will redirect anyone accessing http://www.domain.com to https://www.domain.com

Option 1 codes will check if the connection whether it’s TLS/SSL, while Option 2 codes will check if the site runs on port 80 which, by default, is the port number of HTTP.

"non-www" > "www" & HTTP > HTTPS

If you want to force "non-www" to "www", and HTTP to HTTPS, then the .htaccess codes above will not suffice.

To put things into perspective, if your goal is to redirect the following URLS:

  • http://www.domain.com

  • http://domain.com

to:

  • https://www.domain.com

Then you will need to use the .htaccess codes below.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Explanation

First, it redirects any "non-www" to "www", then it checks for HTTPS, making sure the final result is: www + HTTPS.

"non-www" > "www" & HTTP > HTTPS (in subfolder)

Now, if you are – like us – hosting your WordPress website in a subfolder (i.e. www.domain.com/blog/), then the above mentioned .htaccess codes will not work perfectly.

The goal here is to redirect all URLs (regardless if the homepage, or the post pages) to a www + HTTPS URL.

Let’s take a look at all possibilities of URLs that we will need to redirect “from“, and redirect “to“.

Condition 1

We need to redirect all the following URLs from:

  • http://domain.com

  • http://www.domain.com

  • http://domain.com/blog/

  • http://www.domain.com/blog/

to an unify URL of:

  • https://www.domain.com/blog/

Condition 2

and post URLs from:

  • http://domain.com/blog/example-page/

  • http://www.domain.com/blog/example-page/

to:

  • https://www.domain.com/blog/example-page/

When your WordPress is hosted in subfolder (E.g. /blog/), chances are you will have two .htaccess files, I.e. one .htaccess file outside the subfolder, and one inside the subfolder where WordPress is installed. And we will need to alter both of them.

.htaccess
blog/
blog/.htaccess
.htaccess outside subfolder

Insert the following codes into .htaccess outside the subfolder.

RewriteEngine On
### non-www to www, http to https
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteRule (.*) https://www.domain.com/$1 [R=301,L]

### subfolder
RewriteRule ^$ /blog/ [R=301]

Here’s what this part of the code does. First, it makes sure the domain is redirected to www with HTTPS, then it is redirected to the subfolder. This will satisfy #condition 1 mentioned above but it will not work for condition #2, not yet, at least.

.htaccess inside subfolder

Next, we will need to alter the .htaccess code inside the subfolder.

By default, it should look something like this:

# 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

Put the following .htaccess code on top, and before “# BEGIN WordPress”

<IfModule mod_rewrite.c>
RewriteEngine On
## http to https
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>

With these two set of codes in place, it will ensure any URLs entered will be included with www and HTTPS.

I urge that you do not implement this on your live site. Try it out numerous times on a staging/test site, making sure you’re getting the results you want before deploying it live.

One more thing, to ensure your redirecting is accurate, be sure to clear browser cookies and cache before commencing every test.

The post Forcing HTTP to HTTPS in WordPress (Apache Server) appeared first on Hongkiat.

]]>
How to SSH into Server Without Entering Password https://www.hongkiat.com/blog/ssh-to-server-without-password/ https://www.hongkiat.com/blog/ssh-to-server-without-password/#respond Wed, 23 Oct 2019 13:13:29 +0000 https://www.hongkiat.com/blog/?p=48893 In this post, I’ll show you how to bypass the password prompt and get you connected to your server immediately after you enter to execute the SSH command. Why are we doing this? One of the hassles when connecting to your server is the entering-password step. Now, you might think – it’s not a big…

The post How to SSH into Server Without Entering Password appeared first on Hongkiat.

]]>
In this post, I’ll show you how to bypass the password prompt and get you connected to your server immediately after you enter to execute the SSH command.

Why are we doing this?

One of the hassles when connecting to your server is the entering-password step.

Now, you might think – it’s not a big deal, it’s just an extra step – but what if you have a reasonably complex password that you need to retrieve from somewhere else (notes, or password management app). Or your job requires you to access the servers frequently, then skipping small steps like entering passwords can help speed things up big time.

An idea of how it works (and it’s safe)

Traditionally, to login to the server, you do these steps in its chronological order:

  1. Type ssh username@domain.com, hit Enter/Return
  2. Type/paste password, hit Enter/Return
  3. You’re in!

We’re going to eliminate Step 2; after inserting ssh username@domain.com and hitting Enter/Return, you’re immediately connected to the server. How about that?

And don’t worry, this is extremely secure, as long as you ensure no unauthorized personnel can gain access to your PC.

Let’s get started.

1 – Collect the following information

Before we dive into the execution, here is some information about your local machine and remote server you need to collect beforehand.

Write them down in a note, or at least have them accessible at ease.

(1.1) – Path to SSH folder in the local machine.

This is the path to .ssh/ on your machine. It varies from one operating system to another.

Examples:

  • macOS/Users/username/.ssh/
  • Windows/c/Users/username/.ssh/id_rsa.pub

For more information on how to find the path to ssh folder in Windows 10, click here.

Note: For macOS users, typing the command cd ~/.ssh will usually bring you into the .ssh folder.

(1.2) – Information for remote server

You need the credentials and several other details about your server. In short, collect the following:

  1. Hostname/ IP
  2. Username
  3. Password
  4. Port number
(1.3) – Path to “authorized_key” in the remote server

With the information gathered from 1.2, login to your server, and find the path to the “authorized_key” file.

The file is usually located at: /home/username/.ssh.

Have you gotten all the required information? Great, let’s proceed!

2. Getting an SSH Key

In order for the password-less SSH login to work, we will need an SSH key from your local computer.

Firstly, I’m going to show you how to check for an existing SSH Key on your local computer, how to remove existing SSH keys, and then finally creating a new SSH key.

If you’re sure that there are no existing SSH Keys in your local machine, then you can jump right ahead to creating a new SSH Key.

Checking for existing SSH Keys
  1. Open Terminal.
  2. Paste the following and hit Enter/Return: ls -al ~/.ssh.

If the folder contains files like the following, then SSH Keys exist on your local machine.

  • id_rsa
  • id_rsa.pub
ssh key exists

You can either keep them, provided that you still remember their respective passphrases, else I’d recommend that you delete them.

If the folder is empty, then you’re set to creating your new SSH key.

Removing existing SSH Keys
  1. Open Terminal.
  2. Paste cd ~/.ssh && ls -al and hit Enter/Return. This will bring you into the SSH folder and list all existing files inside it.
  3. Identify all files with names like “id_rsa” and “id_rsa.pub”
  4. Delete each of them one by one using the following command: rm filename. Example: rm id_rsa.pub.

Note: If you’re performing this on a shared workstation or are unsure of which files to delete, do not proceed.

Generating new SSH Key

If your SSH folder is empty, then it probably looks something like this.

ssh key does not exist

Let’s start generating a new SSH Key.

  1. Open Terminal.
  2. Paste the following codes, replace “youremail@example.com” with your actual email address, and hit Enter/Return: ssh-keygen -t rsa -b 4096 -C "youremail@example.com".
  3. Hit Enter/Return (recommended) to use “id_rsa” as the default filename.
  4. Hit Enter/Return (recommended) to create an SSH key without a passphrase.

Your SSH Key has been successfully created, and your terminal should output something similar to the screenshot below.

ssh key generated

3. Upload SSH Key to Server

We’ve come to our last and final step – uploading the generated key (public key) to the server.

  1. Open Terminal.
  2. Type cd ~/.ssh to go inside the .ssh folder.
  3. Copy paste the following command after replacing “username@domain.com” and “/path/to/server/.ssh/authorized_keys” with actual server information: cat id_rsa.pub | ssh username@domain.com 'cat - >> /path/to/server/.ssh/authorized_keys'.

The command above will copy the public key in id_rsa.pub (from local machine) into authorized_keys (in remote server).

If the command executed correctly, you will be prompted to enter the password to the remote server, insert the password, and hit enter/return.

4. Testing

That’s it! Now, let’s give it a test.

  1. Open Terminal.
  2. Login to your server by entering ssh username@domain.com.

You should be able to login without entering the password.

One last thing

Copy the following codes, replace “/path/to/.ssh/” with the actual path to your .ssh folder, and hit Enter/Return.

chmod 700 /path/to/.ssh && chmod 600 /path/to/.ssh/*

This will ensure your newly created SSH key be stored securely inside the .ssh folder.

The post How to SSH into Server Without Entering Password appeared first on Hongkiat.

]]>
https://www.hongkiat.com/blog/ssh-to-server-without-password/feed/ 0
How to Enable SSL for Localhost using MAMP https://www.hongkiat.com/blog/localhost-ssl-using-mamp/ https://www.hongkiat.com/blog/localhost-ssl-using-mamp/#comments Thu, 21 Feb 2019 10:10:47 +0000 https://www.hongkiat.com/blog/?p=23315 Having an SSL (Socket Secure Layer) installed is one way to secure your website. Basically, SSL will encrypt data transactions between the browser and the server. Thus, you would probably want to test your website in an SSL environment as early as during the development stages. URLs and other website assets such as CSS and…

The post How to Enable SSL for Localhost using MAMP appeared first on Hongkiat.

]]>
Having an SSL (Socket Secure Layer) installed is one way to secure your website. Basically, SSL will encrypt data transactions between the browser and the server. Thus, you would probably want to test your website in an SSL environment as early as during the development stages.

URLs and other website assets such as CSS and JavaScript are pointed correctly via the https protocol. So, how do we enable SSL in our localhost? It will require some command lines, file modifications, configurations and a few more cumbersome steps. But let’s bypass all that and use MAMP Pro instead.

Enabling the SSL

Launch MAMP, and create a VirtualHost with a custom domain; this domain can be set in an extension like .dev or .local. In this case, I’ve created www.hongkiat.dev which is used to host www.hongkiat.com development.

ssl virtualhost

Each of the VirtualHost you create in MAMP will have individual options on which you can do some configurations.

To enable SSL for the VirtualHost, go to the SSL tab and tick the SSL option. Afterwards, you would need to locate the SSL certificate files. If you have got one, locate and assign the files. If not, click the Create self-signed certificate button to let MAMP create the certificates for you.

To create one, MAMP will ask you some information like the Country Code and State to assign in the certificate, like so:

create ssl

Save the file in a proper folder, and SSL is set.

ssl certificate

Make Chrome Trust Your Website

Once SSL is set, you should now be able to view your website through the https protocol. But hold on, instead, you see an error (like below) as the SSL certificate is not recognized by the browsers in this case, Chrome. Note that if you run WordPress-based websites, you would need to modify the siteurl and home entry from the wp_options table in the database.

ssl error

Unless you have a trust issue with yourself, you could just go to the Advanced option and click Proceed to {your website name} to view your website.

If you are annoyed with the red cross shown in Chrome, you would need to force Chrome to trust your generated certificate:

First, Click that crossed-out padlock icon, and then click the Certificate Information link. Chrome will show you a popup with all the information of the SSL certificate assigned in the website. Drag-and-drop the Certificate icon onto your Desktop.

If you running OS X, opening this certificate file will bring you to the Keychain Access app.

ssl trust

And, as you might be expected, you should select Always Trust. Select your website certificate, then click the [i] button to reveal the details of the certificate Trust level. Within the Trust tab, you will see the option that says ‘When using this certificate’. The default value is set to ‘Use Custom Settings’ at this stage. Make your certificate be trusted, by setting this option to ‘Always Trust’; you will be prompted for your password once to update this setting.

ssl always trust

We are all set. Reopen the website on Chrome and you should now see the green padlock. Congratulations, your SSL certificate is now trusted.

ssl green

The post How to Enable SSL for Localhost using MAMP appeared first on Hongkiat.

]]>
https://www.hongkiat.com/blog/localhost-ssl-using-mamp/feed/ 11