Free Website Hosting

 What is Free Website Hosting?

As the name suggests, free website hosting is a free non-paid web hosting service. There are many web hosts who provide subdomains to anyone who want to make website. Some of such popular free web hosts include Blogger and WordPress. When you make your websites with these free website hosting services, your website gets such name as yoursite.blogspot.com and yoursite.wordpress.com. If you want to get a website with a domain name that doesn’t include any external site’s name. So you must buy domain and then get web hosting which is usually a paid service. However, there are many web hosting companies. They provides free web hosting with some or the other products/services that you buy from them.

Benefits of Free Website Hosting

There is this single biggest advantage of free website hosting and that is- it comes free without any cost. Now if you are amazed at why these free web hosting companies let you make a website free of cost then. You may rest assured that they do not make any loss in this business. When you make your free website with them, they use your websites to place advertisements, banners and other forms of advertising media to earn revenue.

Sometimes, the revenue from advertisement is shared with the owner of the website and sometimes it’s not. For example, when you get free web hosting from blogger and if you use their AdSense service. Then you get a share in the revenue generated from the advertisements that they place on your websites.  when you make a free website using WordPress, you do not have any control on the placement or revenue generated from your free hosted website. The situation is altogether different when you get website hosted through paid web hosting service.

 

Differences between Free and Paid Web Hosting

Here are some major differences between free and paid website hosting services. It will give you a better understanding about what is free web hosting service and whether it’s worth to opt for such free hosting for websites?

Advertisements on your website are controlled by the web hosting company that provides you with the free web hosting. It can use pop-ups, banners or any other advertisement on your site on which you do not have control. If also you have partial control, you may only decide what size of banner would be displayed where on your site. You won’t have control over what advertisement you will show on the website. If you avail paid web hosting.Then you have full control over your website and no outsider can decide anything for it.

Customer support is missing for free website hosting.  Something which comes free cannot be asked to come with value added services. If something goes wrong with your website, there’s no customer support for websites made with free hosting. On the other hand, paid web hosting services not only give technical support to the customers but they also provide them with help guides, tutorials etc.

Low bandwidth and lesser data transfer capacity makes free website hosting vulnerable to greater downtime. Whereas paid website hosting gives you optimum bandwidth and data transfer for maximum uptime. You also can’t upload more images or videos when using free web hosting service as you don’t get enough disk space.

 

 

 

Free Website Hosting

Some tips to Host your E-Commerce Website

4hostings

About E-commerce Web Hosting

It is common knowledge that, anyone can create a without any need of in depth technical knowledge. However, the first task have to complete before you may launch your e-commerce website is finding the right e-commerce web hosting provider. E-commerce hosting is a generic phrase describing a kind of web hosting platform specifically used for serving e-commerce websites. E-commerce hosting is different to the standard web hosting. This website has a number of functionalities and features required to run and manage a commercial website.

Take a look at the main options you have when it comes to running your e-commerce site and comparing the hosting possibilities with your budget and business requirements.

Choosing a shared host

Many people go with a shared hosting option to stay within their strict business budgets. Shared hosting means that many businesses will share the same server and run their websites right along with yours. The problem with this is that a security issue on one site could mean a security breach with all of the rest. A high level of traffic on one site could affect the other sites and their customers may not way around for the site to run faster at a later time.

While shared hosting is one of the most popular choices for e-commerce sites due to its affordability, it’s usually not worth the money saved. With so many websites working on one single server, the shared internet connection and resources among all of these sites is a recipe for issues with load times, high traffic issues, restrictions on bandwidth and disk space, limitations on control, and the potential of a security issue. Despite the drawbacks, this may be a possible option for a small company or startup.

In-house hosting

in house hosting

You may also wish to use in-house hosting which would require you to provide a server room, purchase the needed hardware and software, hiring an IT team, and leasing reliable high-speed internet. Your IT staff would be in charge of handling the daily operations and the whole thing could add up really quickly.

They will make sure you are backed up, the security is constantly monitored, and that the server is always up and running. This is great for ensuring your customers can access your online store but it’s not going to be pretty in the budget. Many people avoid this option, despite the major benefits, because of the costs and complexities attached to the requirements behind an in-house host. A startup or small business would feel overwhelmed and financially drained doing this.

Colocation

An alternate route a company may decide is to colocation, which refers to a company that stores their hardware and network equipment in a hosting company’s facility. You’d get physical storage space, electricity for powering the hardware, and internet bandwidth.

This is great for those that don’t want to worry too much about hosting and it will save you so much money when it comes to bandwidth. You’ll have the reliability of the data center too. The problem with this option is that you have to purchase your own hardware. And find a provider that will accept this arrangement.

Are there any other options?

e-commerce hosting

Last but not least, you may consider going with dedicated and managed hosting options. This is incredibly expensive but it has a great pay off. You’ll get the whole server to yourself. It means no handing off the control over what operating system is used or web applications are in place.

You won’t have to worry about increased traffic with other websites. Because the traffic is only for you and you’ll have a ton of flexibility. This amazing option is very expensive but it may be worth it if you can find it in the budget. For those that don’t want to deal with too much of the management of the hosting. You can get manage hosting which takes away the server administration task. And it allows you to focus more on your site and customer rather than working on the processes of the hosting.

 

 

 

 

Some tips to Host your E-Commerce Website

10 Tips Before You Buy a Domain Name

domain name

One of the most important decisions in establishing an online presence is choosing a domain name. The right domain name for your website is important, for both your target audience and search engines.

Here are 10 tips to help you make a good domain name purchase.

1. Do your homework

A little bit of research can go a long way when buying a domain name. Browse available domains by keyword or domain name using Media Temple’s domain name search tool.

A popular domain may have more public resales. You can search by keyword, which helps provide the popularity of certain words in domain names.

2. Buy domains that are easy to type and remember

Even if you plan on optimizing the site for search engines, you still want a domain name that people can remember and type. Avoid odd spellings of words, multiple hyphens or other characters, numbers and so forth. Anyone hearing your name should know how to type it without you having to say things such as “the number 4” and “dash-dash.”

You should also avoid words that have more than one spelling if your visitors are likely to be confused and mistype the name. Alternately, you can buy both versions of the name and direct visitors from the one you like less to the preferred name. While you do want a short name (see below), don’t go for something so cryptic that people have a hard time remembering it. Word of mouth is a powerful marketing tool and you want to make it easy for people to tell their friends about your site.

3. Avoid slang terms

Try to avoid slang terms and instead pick a name that will still be meaningful in 10 years. This will also help your name be understood and remembered by non-native speakers. Whether or not you intend to do business internationally, this can help with your local audience as well.

4. Buy a domain that’s shorter rather than longer

The longer your domain name is, the harder it is for people to remember it and the more chance you have of someone misspelling one of the words. Most good single word domain names are long gone, but you can still avoid long domain names by getting a little creative. If you have a single word you really like that is not available, try adding an adjective or verb in front of it and seeing if those variations are available. Think of your domain name as part of your brand, and make sure it matches how you want people to think of you.

5. Stick with .com if you can

Most people assume a domain name ends in .com so if you buy a domain name with one of the other extensions (.net, .info, .org, etc.), you’ll have some extra work to get people to remember that your site has a different extension. Don’t automatically assume you should only buy domains with .com, though. Many sites have done quite well with other extensions.

6. Don’t buy trademarked domains

If your purpose in buying a trademarked term as a domain name is to try to confuse people, you’re opening yourself up to having a complaint filed against you and having to give up the domain name. Even if you’re not trying to create confusion, you’re likely to face some legal challenges by buying trademarked terms in your domain name.

7. Don’t buy a domain name that’s too similar to an existing site

Even if the term isn’t trademarked, don’t buy domains that are just a variation of another domain name. This means avoiding plurals if the singular is taken (mediatemple.net vs. mediatemples.net), hyphenating a phrase (media-temple.net), or adding “my” or some other preposition (mymediatemple.net). Alternately, you might consider buying these variations yourself and set them up so that if someone types one of the variations, they are redirected to your main site.

8. Hyphens are a mixed bag

Using hyphens to separate words in a domain name. It makes site easier to read and makes it somewhat easier for search engines to recognize the individual words. However, people often forget about the hyphens when they type domain names. If you do use hyphens in your name, don’t buy a domain with more than three hyphens. It’s just too messy.

9. Avoid numbers

Avoid having numbers in your domain name. People can get confused about whether the numbers is a digit (3) or a word (three). If you want a number in your domain name because there’s a number in your company name. For this reason, buy both versions (digit and word) and redirect one to the other. Be especially wary about using the number “0” in a domain name as people may see it as the letter “O.”

10. Check availability on social media sites

When you have a name picked out, go see if that word or phrase is available on social media sites. Social media like YouTube, Twitter, Facebook, Instagram, Pinterest, Google+, and Tumblr. Even if you don’t plan on using social media right away, you’ll want to have the option when you’re ready, and it’s easiest if you can use the same phrase on each site.

4hostings

10 Tips Before You Buy a Domain Name

Choosing the right web hosting service provider

Web Hosting Service Provider
We have clearly answered this question in this post. A web hosting service provider’s main goal is selling hosting space from his server or data center. Many other products and services, essential for website hosting. Also provide such as domain name registration, email hosting services, and SSL certificates etc.

However the most important products of a web host are the different types of web server hosting. So that their clients might choose the hosting space suitable to their specific needs.
What is Web Server?
Most of the web hosting service provider is using a very high configured web server. It delivers or ‘serves’ the content of your website to the users through Internet. The computer which acts as a server has to have very high specifications with a powerful Internet connection.

The web hosts or the web hosting companies have their own servers on which they rent out space to you. So that you can host your website and make it accessible to the general public.

Types of Web Server Hosting

Not all persons and even businesses require a similar type of web hosting service. 4hostings.com is a top class web hosting service provider. You will get different types of web hosting options as per your needs. And also help you migrate to a different hosting plan with the growth of your website.

Shared Server Hosting

As the name suggests, several webmasters share space on a single server. This type of hosting plan is good for small e-commerce sites, static website or a personal website. This kind of hosting price is cheap from others. The entry-level websites don’t need high-performance features and thus.  Shared hosting can fulfill their needs without having to pay larger amounts of money.

Dedicated Server Hosting

A server wholly dedicated for your website is a little costly. But could not be affected by the other websites as it could happen in a shared server hosting. This type of website hosting service is most suitable for websites that attract higher traffic and cannot afford to be down due to business purposes such as for e-commerce sites.

Cloud Server Hosting

Based on the innovative cloud computing technologies, cloud hosting is done through multiple servers inter connected with each other. This is unlike shared or dedicated server hosting that is provided through only one server. The multiple servers acting as a single system has multiple advantages like load balancing, no single point of failure, non-reliance on a single server leading to higher security and also the facility to increase or decrease server resources as per your needs. It is also cost-effective web hosting solution as the website hosting companies charge you for cloud hosting services on the basis of usage. As you can scale your resources up and down on a cloud server, you are able to use more resources only on the days when you expect higher traffic.

It is very tuff to combine all of the services in one place. But 4hostings.com done this job! For this reason, 4hostings.com is the one of the best web hosting service provider.

web hosting service provider

web hosting service provider in bangladesh

Choosing the right web hosting service provider

Web hosting

web hosting

Web hosting is a service that allows organizations and individuals to post a website or web page on to the Internet. A web host, or web hosting service provider, is a business that provides the technologies and services needed for the website or webpage to be viewed in the Internet. Websites are hosted, or stored, on special computers called servers.

When Internet users want to view your website, all they need to do is type your website address into their browser. Their computer will then connect to your server and your webpages will be delivered to them through the browser.

Most web hosting companies require that you own your domain name in order to host with them. If you do not have a domain name, the web hosting companies will help you purchase one.

The basic features of a web hosting plan include:

Disk Space

All web hosting accounts offer a certain amount of disk space that you can use to store your web files. It is recommended that you have some sort of estimates on what you need for various tasks – the amount of space you need for your emails, web files, databases, etc. By breaking down your usage, you can better estimate how much space you should go for.

Bandwidth or Data Transfer

Very often web hosts talk about bandwidth and data transfer as the same entity. However, they are in fact, different.

  1. Bandwidth is the amount of data that can be transferred at one time.
  2. Data transfer is the actual amount of data transferred.

Think of it this way. If bandwidth were a tunnel, the bigger the tunnel the more cars can pass through it. Data transfer would then be the number of cars allowed to go through the tunnel in a given time period, say a month.

The less bandwidth you have, the slower it takes your website to load, regardless of your visitor’s connection type. Visitors will have to wait their turn. The less data transfer you have, the more often you will find your website unavailable because you have reached the maximum amount of data allowed to be transferred.

To determine what is sufficient, you need to take into consideration the size of your website and the number of visitors you have in a month’s time.

Email Accounts

Email accounts are a common feature of web hosting, especially if you are hosting a domain. There are three main types of email accounts: POP3, forwarding, and aliases.

POP3 accounts are the traditional inboxes. You have space on the server to store your emails, and at the same time, you can use an email program to download your mail. Each login and password combination usually equates to one account.

Forwarding mail accounts are useful if you are employing the service of another company to filter your emails for you. Rather than storing your emails on your mail server, emails are redirected to another email address.

Aliases accounts are similar to forwarding mail accounts. Some hosts allow you to setup a catch-all alias, which is often used to collect emails sent to addresses not recognized by your mail server.

FTP Access

After you have created your web pages on your computer, you need to transfer those files to your web server. The files are transferred to the server by use of FTP.

FTP is also the protocol of downloading your web files from the server to your computer, ie. backing up your website files.

 

4hostings

Web hosting

The Implication of Website Speed in Business

4hostings

Running a successful online business doesn’t mean just building a website and creating awesome content. Those are just the first steps. Smart business owners need to make sure all that content can be accessed quickly and easily. Clients often ask me to audit their websites when they’re experiencing declining traffic and sales. The first thing I always check is their website’s load time.

Why should you care about Website Speed?

User experience

User experience is all about creating an amazing yet simple experience for your visitors. The 2 most important aspects to user experience: give users what they are looking for, and give it fast.

Also, remember that first impressions matter!

If your website loads quickly, your potential customers will be happy as you’ve made a very good first impression. People consider website speed to be professional and reliable.

On the other hand, a slow website makes people think it’s unsafe, insecure and untrustworthy. And it’s almost impossible to change this first impression later.

So, if you want to improve user experience and make a really good first impression on your potential customers, look closely at your loading speed. Users visiting your site are looking for something, so give it to them as quickly as possible before they go to your competitors.

Conversions & sales

The better the user experience, the more you sell. It’s as simple as that.

If half of your potential customers are leaving your site because of the loading speed, then it’s driving your conversions & sales away.

So if you don’t want to miss revenue opportunities, look at your website’s speed.

SEO

In 2010, Google announced that page speed would be one of the ranking factors taken into account when ranking websites. While it’s not the only factor that goes into your search engine rankings, pages that load faster and make use of Google’s recommended best practices tend to do better in search rankings than those that don’t.

In 2017, Google announced that page speed would become an even bigger factor in determining your site’s ranking. Your mobile and desktop sites will now be ranked based on signals Google receives from crawling your site through mobile view. This means that the page speed of your mobile site will determine the rankings of both your mobile and desktop sites in Google.

Google knows that site speed is important for users so, as I’m sure you care about your users, site speed should be important for you as well.

Recently Google updated its site speed tool adding competitor analysis like percentage of visitors lost due to poor loading speed and how your site compares to your industry:

What can you do to speed up your website?

Now that you know that website speed is super important, you’re probably wondering what you can do to speed your website. Well here are some tips:

  • Conduct a site audit – Use tools such as Pingdom, Load Impact and Google Page Speed to check your site’s speed and identify problem areas. Only after determining the cause of the slowdown will you be able to implement the proper fixes.
  • Re-evaluate your hosting provider – If you’re experiencing slow page loads, then it is very possible that your hosting may be at fault. In my experience, you need to carefully consider the web hosting that you pick and make sure that it is best for your needs. For high traffic sites, upgrading to a dedicated or managed web hosting solution is a good option.
  • Optimize the images on your website – Images are a great way to attract visitors to your website, but can adversely affect load times. This is why it is important to compress images for use on web. Tools like Adobe Photoshop, Yahoo Smush.it, and JPEG Mini allow you to compress your images and save bandwidth by serving smaller files which will speed up page loads.
  • Use a CDN – CDN short for Content Delivery Networks can greatly improve your site speed. CDN is a large distributed system of servers across several data centers across the world which allows you to serve static content such as images, stylesheets, and scripts with high performance.

Making your website fast and lean boils down to continuously monitoring and implementing site audits and analysis. The more you understand what affects your page load times, the better you’ll be able to improve it. Hiring an outside professional to audit your site can be of huge help. Have you conducted a speed test on your website lately? What issues are you currently experiencing? Share your experience by leaving a comment.

The Implication of Website Speed in Business

Create a SSL Certificate on Apache for CentOS 6

About Self-Signed Certificates

A SSL certificate is a way to encrypt a site’s information and create a more secure connection. Additionally, the certificate can show the virtual private server’s identification information to site visitors. Certificate Authorities can issue SSL certificate that verify the virtual server’s details while a self-signed certificate has no 3rd party corroboration.

Step One—Install Mod SSL

In order to set up the self signed certificate, we first have to be sure that Apache and Mod SSL are installed on our VPS. You can install both with one command:

yum install mod_ssl

Step Two—Create a New Directory

Next, we need to create a new directory where we will store the server key and certificate

mkdir /etc/httpd/ssl

Step Three—Create a Self Signed Certificate

When we request a new certificate, we can specify how long the certificate should remain valid by changing the 365 to the number of days we prefer. As it stands this certificate will expire after one year.

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/ssl/apache.key -out /etc/httpd/ssl/apache.crt

With this command, we will be both creating the self-signed SSL certificate and the server key that protects it, and placing both of them into the new directory.

This command will prompt terminal to display a lists of fields that need to be filled in.

The most important line is “Common Name”. Enter your official domain name here or, if you don’t have one yet, your site’s IP address.

You are about to be asked to enter information that will be incorporated

into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank

For some fields there will be a default value,

If you enter ‘.’, the field will be left blank.

—–

Country Name (2 letter code) [AU]:US

State or Province Name (full name) [Some-State]: New York

Locality Name (eg, city) []:NYC

Organization Name (eg, company) [Internet Widgits Pty Ltd]:Awesome Inc

Organizational Unit Name (eg, section) []:Dept of Merriment

Common Name (e.g. server FQDN or YOUR name) []:example.com

Email Address []:webmaster@awesomeinc.com

Step Four—Set Up the Certificate

Now we have all of the required components of the finished certificate.The next thing to do is to set up the virtual hosts to display the new certificate.

Open up the SSL config file:

vi /etc/httpd/conf.d/ssl.conf

Find the section that begins with <VirtualHost _default_:443> and make some quick changes.

Uncomment the DocumentRoot and ServerName line and replace example.com with your DNS approved domain name or server IP address (it should be the same as the common name on the certificate):

ServerName example.com:443

Find the following three lines, and make sure that they match the extensions below:

SSLEngine on

SSLCertificateFile /etc/httpd/ssl/apache.crt

SSLCertificateKeyFile /etc/httpd/ssl/apache.key

Your virtual host is now all set up. Save and Exit out of the file.

Step Five—Restart Apache

You are done. Restarting the Apache server will reload it with all of your changes in place.

/etc/init.d/httpd restart

 

 

Create a SSL Certificate on Apache for CentOS 6

A Basic MySQL Tutorial

MySQL

About MySQL

MySQL is open source database management software that helps users store, organize, and retrieve data. It is a very powerful program with a lot of flexibility—this tutorial will provide the simplest introduction to MySQL

How to Install MySQL on Ubuntu and CentOS

If you don’t have MySQL installed on your droplet, you can quickly download it.

Ubuntu:

sudo apt-get install mysql-server

Centos:

sudo yum install mysql-server

/etc/init.d/mysqld start

How to Access the MySQL shell

Once you have MySQL installed on your droplet, you can access the MySQL shell by typing the following command into terminal:

mysql -u root -p

After entering the root MySQL password into the prompt (not to be confused with the root droplet password), you will be able to start building your MySQL database.

Two points to keep in mind:

  • All MySQL commands end with a semicolon; if the phrase does not end with a semicolon, the command will not execute.
  • Also, although it is not required, MySQL commands are usually written in uppercase and databases, tables, usernames, or text are in lowercase to make them easier to distinguish. However, the MySQL command line is not case sensitive.

How to Create and Delete a MySQL Database

MySQL organizes its information into databases; each one can hold tables with specific data.

You can quickly check what databases are available by typing:

SHOW DATABASES;

Your screen should look something like this:

mysql> SHOW DATABASES;

+——————–+

| Database           |

+——————–+

| information_schema |

| mysql              |

| performance_schema |

| test               |

+——————–+

4 rows in set (0.01 sec)

Creating a database is very easy:

CREATE DATABASE database name;

In this case, for example, we will call our database “events.”

mysql> SHOW DATABASES;

+——————–+

| Database           |

+——————–+

| information_schema |

| events             |

| mysql              |

| performance_schema |

| test               |

+——————–+

5 rows in set (0.00 sec)

In MySQL, the phrase most often used to delete objects is Drop. You would delete a MySQL database with this command:

DROP DATABASE database name;

How to Access a MySQL Database

Once we have a new database, we can begin to fill it with information.

The first step is to create a new table within the larger database.

Let’s open up the database we want to use:

USE events;

In the same way that you could check the available databases, you can also see an overview of the tables that the database contains.

SHOW tables;

Since this is a new database, MySQL has nothing to show, and you will get a message that says, “Empty set”

How to Create a MySQL Table

Let’s imagine that we are planning a get together of friends. We can use MySQL to track the details of the event.

Let’s create a new MySQL table:

CREATE TABLE potluck (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,

name VARCHAR(20),

food VARCHAR(30),

confirmed CHAR(1),

signup_date DATE);

This command accomplishes a number of things:

  1. It has created a table called potluck within the directory, events.
  2. We have set up 5 columns in the table—id, name, food, confirmed, and signup date.
  3. The “id” column has a command (INT NOT NULL PRIMARY KEY AUTO_INCREMENT) that automatically numbers each row.
  4. The “name” column has been limited by the VARCHAR command to be under 20 characters long.
  5. The “food” column designates the food each person will bring. The VARCHAR limits text to be under 30 characters.
  6. The “confirmed” column records whether the person has RSVP’d with one letter, Y or N.
  7. The “date” column will show when they signed up for the event. MySQL requires that dates be written as yyyy-mm-dd

Let’s take a look at how the table appears within the database using the “SHOW TABLES;” command:

mysql> SHOW TABLES;

+——————+

| Tables_in_events |

+——————+

| potluck          |

+——————+

1 row in set (0.01 sec)

We can remind ourselves about the table’s organization with this command:

DESCRIBE potluck;

Keep in mind throughout that, although the MySQL command line does not pay attention to cases, the table and database names are case sensitive: potluck is not the same as POTLUCK or Potluck.

mysql>DESCRIBE potluck;

+————-+————-+——+—–+———+—————-+

| Field       | Type        | Null | Key | Default | Extra          |

+————-+————-+——+—–+———+—————-+

| id          | int(11)     | NO   | PRI | NULL    | auto_increment |

| name        | varchar(20) | YES  |     | NULL    |                |

| food        | varchar(30) | YES  |     | NULL    |                |

| confirmed   | char(1)     | YES  |     | NULL    |                |

| signup_date | date        | YES  |     | NULL    |                |

+————-+————-+——+—–+———+—————-+

5 rows in set (0.01 sec)

How to Add Information to a MySQL Table

We have a working table for our party. Now it’s time to start filling in the details.

Use this format to insert information into each row:

INSERT INTO `potluck` (`id`,`name`,`food`,`confirmed`,`signup_date`) VALUES (NULL, “John”, “Casserole”,”Y”, ‘2012-04-11’);

Once you input that in, you will see the words:

Query OK, 1 row affected (0.00 sec)

Let’s add a couple more people to our group:

INSERT INTO `potluck` (`id`,`name`,`food`,`confirmed`,`signup_date`) VALUES (NULL, “Sandy”, “Key Lime Tarts”,”N”, ‘2012-04-14’);

INSERT INTO `potluck` (`id`,`name`,`food`,`confirmed`,`signup_date`) VALUES (NULL, “Tom”, “BBQ”,”Y”, ‘2012-04-18’);

INSERT INTO `potluck` (`id`,`name`,`food`,`confirmed`,`signup_date`) VALUES (NULL, “Tina”, “Salad”,”Y”, ‘2012-04-10’);

We can take a look at our table:

mysql> SELECT * FROM potluck;

+—-+——-+—————-+———–+————-+

| id | name  | food           | confirmed | signup_date |

+—-+——-+—————-+———–+————-+

|  1 | John  | Casserole      | Y         | 2012-04-11  |

|  2 | Sandy | Key Lime Tarts | N         | 2012-04-14  |

|  3 | Tom   | BBQ            | Y         | 2012-04-18  |

|  4 | Tina  | Salad          | Y         | 2012-04-10  |

+—-+——-+—————-+———–+————-+

4 rows in set (0.00 sec)

How to Update Information in the Table

Now that we have started our potluck list, we can address any possible changes. For example: Sandy has confirmed that she is attending, so we are going to update that in the table.

UPDATE `potluck`

SET

`confirmed` = ‘Y’

WHERE `potluck`.`name` =’Sandy’;

You can also use this command to add information into specific cells, even if they are empty.

How to Add and Delete a Column

We are creating a handy chart, but it is missing some important information: our attendees’ emails.

We can easily add this:

ALTER TABLE potluck ADD email VARCHAR(40);

This command puts the new column called “email” at the end of the table by default, and the VARCHAR command limits it to 40 characters.

However, if you need to place that column in a specific spot in the table, we can add one more phrase to the command.

ALTER TABLE potluck ADD email VARCHAR(40) AFTER name;

Now the new “email” column goes after the column “name”.

Just as you can add a column, you can delete one as well:

ALTER TABLE potluck DROP email;

I guess we will never know how to reach the picnickers.

How to Delete a Row

If needed, you can also delete rows from the table with the following command:

DELETE from [table name] where [column name]=[field text];

For example, if Sandy suddenly realized that she will not be able to participate in the potluck after all, we could quickly eliminate her details.

mysql> DELETE from potluck  where name=’Sandy’;

Query OK, 1 row affected (0.00 sec)

 

mysql> SELECT * FROM potluck;

+—-+——+———–+———–+————-+

| id | name | food      | confirmed | signup_date |

+—-+——+———–+———–+————-+

|  1 | John | Casserole | Y         | 2012-04-11  |

|  3 | Tom  | BBQ       | Y         | 2012-04-18  |

|  4 | Tina | Salad     | Y         | 2012-04-10  |

+—-+——+———–+———–+————-+

3 rows in set (0.00 sec)

Notice that the id numbers associated with each person remain the same.

 

A Basic MySQL Tutorial

How to Install Linux, Apache, MySQL, PHP (LAMP) stack On CentOS 6

About LAMP

LAMP stack is a group of open source software used to get web servers up and running. The acronym stands for Linux, Apache, MySQL, and PHP. Since the server is already running CentOS, the linux part is taken care of. Here is how to install the rest.

Set Up

The steps in this tutorial require the user on the virtual private server to have root privileges.

Step One—Install Apache

Apache is a free open source software which runs over 50% of the world’s web servers.

To install apache, open terminal and type in this command:

sudo yum install httpd

Once it installs, you can start apache running on your VPS:

sudo service httpd start

That’s it. To check if Apache is installed, direct your browser to your server’s IP address (eg. http://12.34.56.789). The page should display the words “It works!”.

How to find your Server’s IP address

You can run the following command to reveal your server’s IP address.

ifconfig eth0 | grep inet | awk ‘{ print $2 }’

 

Step Two—Install MySQL

MySQL is a powerful database management system used for organizing and retrieving data on a virtual server

To install MySQL, open terminal and type in these commands:

sudo yum install mysql-server

sudo service mysqld start

During the installation, MySQL will ask you for your permission twice. After you say Yes to both, MySQL will install.

Once it is done installing, you can set a root MySQL password:

sudo /usr/bin/mysql_secure_installation

The prompt will ask you for your current root password.

Since you just installed MySQL, you most likely won’t have one, so leave it blank by pressing enter.

Enter current password for root (enter for none):

OK, successfully used password, moving on…

Then the prompt will ask you if you want to set a root password. Go ahead and choose Y and follow the instructions.

CentOS automates the process of setting up MySQL, asking you a series of yes or no questions.

It’s easiest just to say Yes to all the options. At the end, MySQL will reload and implement the new changes.

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

 

Remove anonymous users? [Y/n] y

… Success!

 

Normally, root should only be allowed to connect from ‘localhost’.  This

ensures that someone cannot guess at the root password from the network.

 

Disallow root login remotely? [Y/n] y

… Success!

 

By default, MySQL comes with a database named ‘test’ that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

 

Remove test database and access to it? [Y/n] y

– Dropping test database…

… Success!

– Removing privileges on test database…

… Success!

 

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

 

Reload privilege tables now? [Y/n] y

… Success!

 

Cleaning up…

 

All done!  If you’ve completed all of the above steps, your MySQL

installation should now be secure.

 

Thanks for using MySQL!

Step Three—Install PHP

PHP is an open source web scripting language that is widely used to build dynamic webpages.

To install PHP on your virtual private server, open terminal and type in this command:

sudo yum install php php-mysql

Once you answer yes to the PHP prompt, PHP will be installed.

PHP Modules

PHP also has a variety of useful libraries and modules that you can add onto your server. You can see the libraries that are available by typing:

yum search php-

Terminal then will display the list of possible modules. The beginning looks like this:

php-bcmath.x86_64 : A module for PHP applications for using the bcmath library

php-cli.x86_64 : Command-line interface for PHP

php-common.x86_64 : Common files for PHP

php-dba.x86_64 : A database abstraction layer module for PHP applications

php-devel.x86_64 : Files needed for building PHP extensions

php-embedded.x86_64 : PHP library for embedding in applications

php-enchant.x86_64 : Human Language and Character Encoding Support

php-gd.x86_64 : A module for PHP applications for using the gd graphics library

php-imap.x86_64 : A module for PHP applications that use IMAP

To see more details about what each module does, type the following command into terminal, replacing the name of the module with whatever library you want to learn about.

yum info name of the module

Once you decide to install the module, type:

sudo yum install name of the module

You can install multiple libraries at once by separating the name of each module with a space.

Congratulations! You now have LAMP stack on your droplet!

We should also set the processes to run automatically when the server boots (php will run automatically once Apache starts):

sudo chkconfig httpd on

sudo chkconfig mysqld on

Step Four—RESULTS: See PHP on your Server

Although LAMP is installed on your virtual server, we can still take a look and see the components online by creating a quick php info page

To set this up, first create a new file:

sudo nano /var/www/html/info.php

Add in the following line:

<?php

phpinfo();

?>

Then Save and Exit.

Restart apache so that all of the changes take effect on your virtual server:

sudo service httpd restart

Finish up by visiting your php info page (make sure you replace the example ip address with your correct one): http://12.34.56.789/info.php

 

It should look similar to this.

php

How to Install Linux, Apache, MySQL, PHP (LAMP) stack On CentOS 6

How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04

 

In this guide, we’ll get a LAMP stack installed on an Ubuntu 16.04.

What is LAMP

A “LAMP” stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps.

This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP.

 

Step 1: Install Apache and Allow in Firewall

The Apache web server is among the most popular web servers in the world. It’s well-documented, and has been in wide use for much of the history of the web, which makes it a great default choice for hosting a website.

We can install Apache easily using Ubuntu’s package manager, apt. A package manager allows us to install most software pain-free from a repository maintained by Ubuntu.

For our purposes, we can get started by typing these commands:

  • sudo apt-get update
  • sudo apt-get install apache2

 

Since we are using a sudo command, these operations get executed with root privileges. It will ask you for your regular user’s password to verify your intentions.

Once you’ve entered your password, apt will tell you which packages it plans to install and how much extra disk space they’ll take up. Press Y and hit Enter to continue, and the installation will proceed.

Set Global ServerName to Suppress Syntax Warnings

Next, we will add a single line to the /etc/apache2/apache2.conf file to suppress a warning message. While harmless, if you do not set ServerName globally, you will receive the following warning when checking your Apache configuration for syntax errors:

  • sudo apache2ctl configtest

 

Output

AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message

Syntax OK

Open up the main configuration file with your text edit:

  • sudo nano /etc/apache2/apache2.conf

 

Inside, at the bottom of the file, add a ServerName directive, pointing to your primary domain name. If you do not have a domain name associated with your server, you can use your server’s public IP address:

. . .

ServerName server_domain_or_IP

Save and close the file when you are finished.

Next, check for syntax errors by typing:

  • sudo apache2ctl configtest

Since we added the global ServerName directive, all you should see is:

Output

Syntax OK

Restart Apache to implement your changes:

  • sudo systemctl restart apache2

 

You can now begin adjusting the firewall.

Adjust the Firewall to Allow Web Traffic

Next, assuming that you have followed the initial server setup instructions to enable the UFW firewall, make sure that your firewall allows HTTP and HTTPS traffic. You can make sure that UFW has an application profile for Apache like so:

  • sudo ufw app list

 

Output

Available applications:

Apache

Apache Full

Apache Secure

OpenSSH

If you look at the Apache Full profile, it should show that it enables traffic to ports 80 and 443:

  • sudo ufw app info “Apache Full”

 

Output

Profile: Apache Full

Title: Web Server (HTTP,HTTPS)

Description: Apache v2 is the next generation of the omnipresent Apache web

server.

 

Ports:

80,443/tcp

Allow incoming traffic for this profile:

  • sudo ufw allow in “Apache Full”

 

You can do a spot check right away to verify that everything went as planned by visiting your server’s public IP address in your web browser (

How To Find your Server’s Public IP Address

If you do not know what your server’s public IP address is, there are a number of ways you can find it. Usually, this is the address you use to connect to your server through SSH.

From the command line, you can find this a few ways. First, you can use the iproute2 tools to get your address by typing this:

·         ip addr show eth0 | grep inet | awk ‘{ print $2; }’ | sed ‘s/\/.*$//’

This will give you two or three lines back. They are all correct addresses, but your computer may only be able to use one of them, so feel free to try each one.

An alternative method is to use the curl utility to contact an outside party to tell you how it sees your server. You can do this by asking a specific server what your IP address is:

·         sudo apt-get install curl·         curl http://icanhazip.com

Regardless of the method you use to get your IP address, you can type it into your web browser’s address bar to get to your server.

Step 2: Install MySQL

Now that we have our web server up and running, it is time to install MySQL. MySQL is a database management system. Basically, it will organize and provide access to databases where our site can store information.

Again, we can use apt to acquire and install our software. This time, we’ll also install some other “helper” packages that will assist us in getting our components to communicate with each other:

·         sudo apt-get install mysql-server

Note: In this case, you do not have to run sudo apt-get update prior to the command. This is because we recently ran it in the commands above to install Apache. The package index on our computer should already be up-to-date.

Again, you will be shown a list of the packages that will be installed, along with the amount of disk space they’ll take up. Enter Y to continue.

During the installation, your server will ask you to select and confirm a password for the MySQL “root” user. This is an administrative account in MySQL that has increased privileges. Think of it as being similar to the root account for the server itself (the one you are configuring now is a MySQL-specific account, however). Make sure this is a strong, unique password, and do not leave it blank.

When the installation is complete, we want to run a simple security script that will remove some dangerous defaults and lock down access to our database system a little bit. Start the interactive script by running:

·         mysql_secure_installation

You will be asked to enter the password you set for the MySQL root account. Next, you will be asked if you want to configure the VALIDATE PASSWORD PLUGIN.

Warning: Enabling this feature is something of a judgment call. If enabled, passwords which don’t match the specified criteria will be rejected by MySQL with an error.

This will cause issues if you use a weak password in conjunction with software which automatically configures MySQL user credentials, such as the Ubuntu packages for phpMyAdmin. It is safe to leave validation disabled, but you should always use strong, unique passwords for database credentials.

Answer y for yes, or anything else to continue without enabling.

VALIDATE PASSWORD PLUGIN can be used to test passwords

and improve security. It checks the strength of password

and allows the users to set only those passwords which are

secure enough. Would you like to setup VALIDATE PASSWORD plugin?

 

Press y|Y for Yes, any other key for No:

You’ll be asked to select a level of password validation. Keep in mind that if you enter 2, for the strongest level, you will receive errors when attempting to set any password which does not contain numbers, upper and lowercase letters, and special characters, or which is based on common dictionary words.

There are three levels of password validation policy:

 

LOW    Length >= 8

MEDIUM Length >= 8, numeric, mixed case, and special characters

STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file

 

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 1

If you enabled password validation, you’ll be shown a password strength for the existing root password, and asked you if you want to change that password. If you are happy with your current password, enter n for “no” at the prompt:

 

Using existing password for root.

 

Estimated strength of the password: 100

Change the password for root ? ((Press y|Y for Yes, any other key for No) : n

For the rest of the questions, you should press Y and hit the Enter key at each prompt. This will remove some anonymous users and the test database, disable remote root logins, and load these new rules so that MySQL immediately respects the changes we have made.

At this point, your database system is now set up and we can move on.

Step 3: Install PHP

PHP is the component of our setup that will process code to display dynamic content. It can run scripts, connect to our MySQL databases to get information, and hand the processed content over to our web server to display.

We can once again leverage the apt system to install our components. We’re going to include some helper packages as well, so that PHP code can run under the Apache server and talk to our MySQL database:

  • sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql

 

This should install PHP without any problems. We’ll test this in a moment.

In most cases, we’ll want to modify the way that Apache serves files when a directory is requested.

Currently, if a user requests a directory from the server, Apache will first look for a file called index.html. We want to tell our web server to prefer PHP files, so we’ll make Apache look for an index.php file first.

To do this, type this command to open the dir.conf file in a text editor with root privileges:

  • sudo nano /etc/apache2/mods-enabled/dir.conf

 

It will look like this:

/etc/apache2/mods-enabled/dir.conf

<IfModule mod_dir.c>

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm

</IfModule>

We want to move the PHP index file highlighted above to the first position after the DirectoryIndex specification, like this:

/etc/apache2/mods-enabled/dir.conf

<IfModule mod_dir.c>

DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

</IfModule>

When you are finished, save and close the file by pressing Ctrl-X. You’ll have to confirm the save by typing Y and then hit Enter to confirm the file save location.

After this, we need to restart the Apache web server in order for our changes to be recognized. You can do this by typing this:

  • sudo systemctl restart apache2

 

We can also check on the status of the apache2 service using systemctl:

  • sudo systemctl status apache2

 

Sample Output

  • apache2.service – LSB: Apache2 web server

Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)

Drop-In: /lib/systemd/system/apache2.service.d

└─apache2-systemd.conf

Active: active (running) since Wed 2016-04-13 14:28:43 EDT; 45s ago

Docs: man:systemd-sysv-generator(8)

Process: 13581 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)

Process: 13605 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

Tasks: 6 (limit: 512)

CGroup: /system.slice/apache2.service

├─13623 /usr/sbin/apache2 -k start

├─13626 /usr/sbin/apache2 -k start

├─13627 /usr/sbin/apache2 -k start

├─13628 /usr/sbin/apache2 -k start

├─13629 /usr/sbin/apache2 -k start

└─13630 /usr/sbin/apache2 -k start

 

Apr 13 14:28:42 ubuntu-16-lamp systemd[1]: Stopped LSB: Apache2 web server.

Apr 13 14:28:42 ubuntu-16-lamp systemd[1]: Starting LSB: Apache2 web server…

Apr 13 14:28:42 ubuntu-16-lamp apache2[13605]:  * Starting Apache httpd web server apache2

Apr 13 14:28:42 ubuntu-16-lamp apache2[13605]: AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerNam

Apr 13 14:28:43 ubuntu-16-lamp apache2[13605]:  *

Apr 13 14:28:43 ubuntu-16-lamp systemd[1]: Started LSB: Apache2 web server.

Install PHP Modules

To enhance the functionality of PHP, we can optionally install some additional modules.

To see the available options for PHP modules and libraries, you can pipe the results of apt-cache search into less, a pager which lets you scroll through the output of other commands:

  • apt-cache search php- | less

 

Use the arrow keys to scroll up and down, and q to quit.

The results are all optional components that you can install. It will give you a short description for each:

libnet-libidn-perl – Perl bindings for GNU Libidn

php-all-dev – package depending on all supported PHP development packages

php-cgi – server-side, HTML-embedded scripting language (CGI binary) (default)

php-cli – command-line interpreter for the PHP scripting language (default)

php-common – Common files for PHP packages

php-curl – CURL module for PHP [default]

php-dev – Files for PHP module development (default)

php-gd – GD module for PHP [default]

php-gmp – GMP module for PHP [default]

:

To get more information about what each module does, you can either search the internet, or you can look at the long description of the package by typing:

  • apt-cache show package_name

 

There will be a lot of output, with one field called Description-en which will have a longer explanation of the functionality that the module provides.

For example, to find out what the php-cli module does, we could type this:

  • apt-cache show php-cli

 

Along with a large amount of other information, you’ll find something that looks like this:

Output

Description-en: command-line interpreter for the PHP scripting language (default)

This package provides the /usr/bin/php command interpreter, useful for

testing PHP scripts from a shell or performing general shell scripting tasks.

.

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used

open source general-purpose scripting language that is especially suited

for web development and can be embedded into HTML.

.

This package is a dependency package, which depends on Debian’s default

PHP version (currently 7.0).

If, after researching, you decide you would like to install a package, you can do so by using the apt-get install command like we have been doing for our other software.

If we decided that php-cli is something that we need, we could type:

  • sudo apt-get install php-cli

 

If you want to install more than one module, you can do that by listing each one, separated by a space, following the apt-get install command, like this:

  • sudo apt-get install package1 package2 …

 

At this point, your LAMP stack is installed and configured. We should still test out our PHP though.

Step 4: Test PHP Processing on your Web Server

In order to test that our system is configured properly for PHP, we can create a very basic PHP script.

We will call this script info.php. In order for Apache to find the file and serve it correctly, it must be saved to a very specific directory, which is called the “web root”.

In Ubuntu 16.04, this directory is located at /var/www/html/. We can create the file at that location by typing:

  • sudo nano /var/www/html/info.php

 

This will open a blank file. We want to put the following text, which is valid PHP code, inside the file:

info.php

<?php

phpinfo();

?>

When you are finished, save and close the file.

Now we can test whether our web server can correctly display content generated by a PHP script. To try this out, we just have to visit this page in our web browser. You’ll need your server’s public IP address again.

The address you want to visit will be:

http://your_server_IP_address/info.php

The page that you come to should look something like this:

This page basically gives you information about your server from the perspective of PHP. It is useful for debugging and to ensure that your settings are being applied correctly.

If this was successful, then your PHP is working as expected.

You probably want to remove this file after this test because it could actually give information about your server to unauthorized users. To do this, you can type this:

  • sudo rm /var/www/html/info.php
How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04