HIPAA Compliant Cloud Storage

How to Try PHP7 on a Debian 8.2 LAMP Stack

PHP7 Elephant created by Walker Cahall http://www.waltronic.net/

PHP7 Elephant created by Walker Cahall

Verified and Tested 10/8/15

Introduction

In this How-To, we will be installing PHP7 on a Debian 8.2 LAMP stack. PHP7’s expected release date is sometime in November 2015. If you plan on upgrading to the new version of PHP, you can use this guide to install PHP7 so that you can test your code. This guide will be show you how to install the PHP7 Beta or Nightly Build from repo.

NOTE: Since PHP7 is in development do not use this in production, this guide is only meant to get you ready for the actual release.

Prerequisites

A server with Debian 8.2 installed is required, which will take care of the Linux portion of the LAMP stack install.

Installing LAMP on Debian 8.2 with PHP7

We need to add the PHP7 early access repo to your sources list with the following command:

echo "deb http://repos.zend.com/zend-server/early-access/php7/repos ubuntu/" >> /etc/apt/sources.list

After adding the PHP7 early access repo, we should now update the system with the following command:

apt-get update

Installing Apache on Debian 8.2

The next thing we need is to install Apache; you can do so with the following command:

apt-get install apache2

During the install, hit enter when it asks “Do you want to continue?”

Now that Apache is installed, we can check to see if it running with the following command:

service apache2 status

 Another way to check to see if Apache is working is by opening your web browser and then go to http://youripaddress

To get your IP address you can run the following command:

ifconfig
An example of ifconfig showing the IP address of 172.20.6.154

An example of ifconfig showing the IP address of 172.20.6.154

Using the above example we would put  http://172.20.6.154 in the address bar of our browser:

The default page for Apache on Debian 8.2

The default page for Apache on Debian 8.2

Installing MariaDB on Debian 8.2

We are now going to add a database management system, however, if your code does not require a database, you can skip this section. Install MariaDB with the following command:

apt-get install mariadb-server

During the install, hit enter when it asks “Do you want to continue?”

It will also prompt you to enter a MariaDB root password. Set a strong password of your choosing. After entering your password, hit enter to continue.

Enter a strong password of your choice

Enter a strong password of your choice

After hitting enter, it will prompt you to reenter the password, do so and then hit enter to continue.

Re-enter the password you set before

Re-enter the password you set before

After the install completes, we need to run the MariaDB Security installation with the following command:

mysql_secure_installation

Note: During the MariaDB Security installation, you will be prompted with a series of questions. For standard setups,  type N for the change root password question (since you just set it) and Y for yes on all of the rest, see the screen shot below:

An example of what mysql_secure_installation looks like

An example of what mysql_secure_installation looks like using MariaDB

You can check that MariaDB is running with the following command:

service mysql status

Installing PHP7 on Debian 8.2

We can now install PHP7. Below you can find the two choices of the Nightly or the Beta builds. As the nightly build is more up to date, it has more fixed bugs than the Beta version, so I would suggest the nightly.

PHP7 Nightly Build Install:

apt-get install php7-nightly

PHP7 Beta 1 Install:

apt-get install php7-beta1

During the install, hit enter when it asks “Do you want to continue?”

After hitting enter,  you will also get a warning similar to below.

WARNING: The following packages cannot be authenticated!
  php7-nightly
Install these packages without verification? [y/N]

Type Y and then hit Enter to continue.

Getting PHP7 to work with Apache

We need to move the  libraries and modules of PHP7  to the Apache directories with the following commands:

cp /usr/local/php7/libphp7.so /usr/lib/apache2/modules/
cp /usr/local/php7/php7.load /etc/apache2/mods-available/

After moving the files, we need to edit /etc/apache2/apache2.conf and add the following lines to the bottom of the file.

<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

Now that we fixed the apache2.conf run the following command to enable the PHP mpm module and switch to mpm_prefork.

a2dismod mpm_event && a2enmod mpm_prefork && a2enmod php7

Restart Apache so that the changes we made take effect:

service apache2 restart

Testing PHP 7 on Debian 8.2

To test out PHP7, we are going to create a PHP file a called info.php in /var/www/html/  by using your favorite editor and inserting the following lines of code.

<?php
phpinfo();
?>

Now we can go back to your browser and update the following hyperlink with your IP address.

http://youripaddress/info.php

The result of the php.info file you made, using PHP7

The result of the php.info file you made, using PHP7

At the top of the page, check that the PHP version is  7.0 or higher.

Now that we verified that it is working, we should remove your info.php as hackers could use this information to set up attacks directed at the specific version of PHP you are running. Remove it with the following command:

rm /var/www/html/info.php

Congratulations on installing PHP7 with LAMP on your Debian 8.2 Server! Thank you for following this How-To, and please check back for more updates and to learn more about our reliable HIPAA-compliant cloud storage hosting solutions.


How to Try PHP7 in a LAMP Stack on Ubuntu 14.04

PHP7 Elephant created by Walker Cahall http://www.waltronic.net/

PHP7 Elephant created by Walker Cahall

Verified and Tested 10/8/15

Introduction

In this How-To, we will install a LAMP Stack on an Ubuntu 14.04 Cloud Server with PHP7. PHP7  should be released sometime in November 2015 and if you plan on adopting the new version, now is a great time to test your code. This guide will give you the option to install the Beta1 build or the newest nightly build of PHP7. If you’d like to learn more about PHP7, read our articles What is PHP7 – Breaking Changes from PHP5 and What is PHP7 – Performance Improvement.

NOTE: PHP7 is still in development and should not be used in production environments until it is fully released.

Read More


LAMP vs. WAMP: Why do Startups Prefer LAMP to WAMP?

  • LAMP vs. WAMP: What’s the Difference?
  • Affordability
  • Security
  • Smoother Operation
  • Flexibility
  • Use within Enterprises?
  • One-Click LAMP Cloud Hosting

LAMP vs. WAMP: What’s the Difference?

A LAMP or WAMP stack is four pieces of software that are used in combination for open source web development. Components include:

  • L/W – Linux/Windows, the operating system
  • A – Apache, the Web server
  • M – MySQL, the database management system
  • P – PHP, Python, or Perl, the scripting language.

A common variation of this Web stack is a LEMP or WEMP Cloud Hosting stack, which replaces Apache with Nginx. You will also frequently see the term WAMP, which replaces Linux with Windows.

Read More


How to: Using Basic SQL Syntax

Introduction

Behind every great web application is a database of some kind. Many of the widely used database systems (e.g., MySQL, Percona, PostgressSQL, MariaDBMSSQL) use SQL (Structured Query Language) to pull data out and push data in. A lot of modern programming languages provide an ORM (Object-Relational Mapping) layer which loads data directly into code without needing to know SQL, but sometimes you just want to talk to the database directly. While SQL has a lot of keywords and can get very complex, this article goes through the basic CRUD (Create Read Update Delete) constructs.
.

Prerequisites

– A basic understanding of what a database is and how to interact with a database system.

Using Basic SQL Syntax

Some Notes About Dialects and Data Values

Every database system that uses SQL has a slightly different implementation. The differences do not show up in the basic commands that this guide covers, but it is good to know that there are potential differences across systems.

In all of the examples here the SQL keywords are capitalized. While this is a common practice and helps make examples clear, most SQL databases don’t care. The same is true with the line breaks and spacing. SQL can be written all on one line if you prefer, but here we will write statements across multiple lines to help clarify some explanations.

Different data values need to be entered differently depending on data type. Text values need to be encased (escaped) in single quotes. If you happen to have a value that itself contains a single quote, that interior quote needs to be doubled to make sure the statement will run.

WHERE lastname = 'O''niel'

Numeric types, integers, decimals and the like do not need any extra escaping. Boolean values like True and False also do not need to be escaped.

Finally, many SQL implementations use a semicolon as a statement terminator. While this usage isn’t universal, many consider it a best-practice to ensure portabiility of SQL statements across different implementations. This article will use semicolons.

.

SELECT – Reading Data from the Database.

Reading data is the most common task and illustrates the basic structure of a SQL statement nicely. This SELECT is (almost) the most basic SQL statement there is.

SELECT <column_list>
FROM <table>
WHERE <column_name> = <value>;

SELECT, FROM and WHERE are SQL keywords. <column_list> is a comma-separated list of column names that you want to read. It can also be replaced with * to just return all columns of the table. Be aware that * can be quite slow if you have a lot of columns in a very large table.

<table> is the name of the table you want to retrieve data from. <column_name> indicates the name of the column which should contain the <value>.

The WHERE section is optional, but is so useful and idiomatic in SQL that it makes sense to include it. WHERE restricts the data set based on the criteria. Although depicted here with only a single criterion, it is possible to include several criteria with boolean operators AND and OR. See the UPDATE example below for something more complex.

Example:

SELECT common_name, genus, species, type FROM animals WHERE type = 'mammal';

.

UPDATE – Making a Change

Sometimes it isn’t enough to just see what it is in the database. Sometimes you need a change. And when you do, UPDATE is there for you.

UPDATE <table>
SET <column_name> = <value>
WHERE <column_name> = <value>
AND <column_name> = <value>;

Again, UPDATE, SET, and WHERE are SQL keywords. <table> is the name of the table you want to update. Within the SET section, you can include one or more <column_name> = <value> pairs separated by commas. This portion of the statement is where you define the change to be made. The <column_name> will be set with the given <value>.
The WHERE section is optional on UPDATE as well, but leaving it out will update the entire table. Occasionally this is what you want, but most of the time you only want to update a single row or a few rows. In these cases, updating the entire table would be disastrous, so it is good practice to always have a WHERE. This example shows using AND in the WHERE section.

Example:

UPDATE animals SET have_seen = True, common_name='River Otter' WHERE Genus = 'Lontra' AND Species = 'Canadensis';

.

DELETE – Making It Gone

Sometimes you need to remove data from a table. This action is a DELETE.

DELETE FROM <table>
WHERE <column_name> = <value>;

Once again we have our SQL keywords and a <table> defining which table will be deleted from, and a WHERE section defining which rows are to be deleted. Again the WHERE clause is technically optional, but this statement will delete all rows in a table if it is missing.

Example:

DELETE FROM animals WHERE have_seen = False;

.

Delete Tip

One best practice I find for doing manual deletes like this one is to make a SELECT first. The DELETE command shares a lot of structural similarity with SELECT and yet is far more destructive. First write the statement as a SELECT * FROM <table> WHERE <column_name> = <value>; to make sure you know exactly which rows will be affected. Once you are happy with the output, swap out the SELECT * for the DELETE keyword and run it. In the example below, the DELETE statement is commented out. Two dashes -- comment out the rest of the line. This practice can be really helpful when performing DELETEs to keep an accidental run of the query from removing data.

Example:

SELECT *
-- DELETE
FROM animals WHERE have_seen = False;

Note: The -- comments out all text to the end of the line, not the end of the statement. If the FROM animals WHERE have_seen = False were on the same line as -- DELETE, SQL would only see the SELECT * portion of the statement.

.

INSERT – Bringing New Data to the Table

The last piece of this puzzle is adding data into a table. There are two forms of INSERT in classic SQL. The one I’ll cover here allows you to add explicit data into a table.

INSERT INTO <table>(<list_of_column_names>)
VALUES (<list_of_values>);

The INSERT statement looks different than the rest. The <table> again defines the table where the data is going, though here it is followed by a comma-separated <list_of_column_names> enclosed in parentheses. You only have to list the columns for which you have data to enter; however, if the table you are working with has required fields (defined as NOT NULL constraints), you will need to give data for all of those fields to avoid an error.

The VALUES keyword introduces a <list_of_values> inside of parentheses. This list is the list of values to be inserted into the columns you defined above. The listed columns and values need to match each other’s order. The first value will be inserted into the first column name in the list, the second column to the second value and so on. This order in the statement may be different than the order of columns in the target table, but that is fine.

Example:

INSERT INTO animals(common_name, species, genus) VALUES ('Sea Otter', 'Lutris', 'Enhydra');

About Atlantic.Net

Atlantic.Net offers world-class hosting services and solutions, including HIPAA compliant cloud storage hosting. Contact us today for a quote!



How to: VRRP (Virtual Router Redundancy Protocol) Keepalived Configuration

Verified and Tested 08/17/15

Introduction

VRRP (Virtual Router Redundancy Protocol) is a commonly used protocol that offers high availability for a network (or subnetwork). Keepalived is a Linux package that uses VRRP to deliver high availability among Linux servers. It also delivers load-balancing services, but this article concentrates on getting started with just the VRRP portion.

Prerequisites

– Linux installation on at least 2 hosts (be sure they are already updated).
– At least 3 available IP addresses (1 for each of at least 2 peer keepalived servers, and 1 virtual IP shared amongst them).

Read More


How to Install Java (JRE or JDK) on CentOS 7

Verified and Tested 08/10/15

Introduction

If you had the option to choose between a base model car or a fully loaded model, which one would you choose? Both cars will take you from point A to point B, but with the fully loaded car you have additional features that can make rush hour a chill hour. Well, that’s the same concept when we take a closer look at Java. There are two standard types of installations, JRE (Java Runtime Environment) and JDK (Java Development Kit). As the base model car, JRE enables the ability to create Java Applications for different types of deployments using minimal core tools to accomplish the task. JDK is a fully loaded Development Kit that has everything that JRE has plus additional resources to create/secure Applications and Applets.

This how-to will take you through the installation of JRE and JDK on CentOS 7.

Prerequisites

You need a CentOS 7 server that is configured with a static IP address.

Read More


How to Install Java (JRE or JDK) on Ubuntu 14.04

Java Illustration by Walker Cahall

Java Illustration by Walker Cahall

Verified and Tested 07/30/15

Introduction

If you had the option to choose between a base model car or a fully loaded model, which one would you choose?

Both cars will take you from point A to point B, but with the fully loaded car you have additional features that can make rush hour a chill hour.

Well, that’s the same concept when we take a closer look at Java. There are two standard types of installations, JRE (Java Runtime Environment) and JDK (Java Development Kit). Like the base model car, JRE enables the ability to create Java Applications for different types of deployments using minimal core tools to accomplish the task. JDK is a fully loaded Development Kit that has everything that JRE has plus additional resources to create/secure Applications and Applets.

Read More


How to Change Your Hostname in CentOS 7 Using the Hostnamectl Command

Hostname Illustration by Walker Cahall http://www.waltronic.net/

Hostname Illustration by Walker Cahall

Verified and Tested 07/28/2015

Introduction

This article discusses how to change the hostname using the hostnamectl command on a server running CentOS 7. A hostname is a label given to a device that is connected on a network.

Prerequisites

A server with CentOS 7 installed.

Changing your Hostname in CentOS 7

If you are used to how CentOS 6 or earlier handles the hostname, you may notice that the same procedure doesn’t quite work the same way in CentOS 7. If you’re new to CentOS, in general, then you have no baggage to worry about having to leave behind!

In CentOS 7, hostname control is handled with the hostnamectl command. With this command, you can update three different hostnames–the static, transient, and pretty.

Read More


HIPAA Compliant File Storage

How can you take advantage of the incredible power of cloud hosting while still meeting HIPAA data storage requirements at all times?

The best way currently available to store your medical files and share them between various parties is with HIPAA compliant cloud storage. Various cloud apps are designed for filesharing (examples include Box, Dropbox, and Google Drive), which also allows you to back up the files and synchronize data between various devices. However, general technological solutions are not designed for the special case of healthcare – in particular with regard to encryption.

Read More


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources

We use cookies for advertising, social media and analytics purposes. Read about how we use cookies in our updated Privacy Policy. If you continue to use this site, you consent to our use of cookies and our Privacy Policy.