Wednesday, October 22, 2014

security ssl cert

I am not a security expert, but I began to realize a need to provide encryption on websites. I went over to startssl.com and created an account and a certificate for heroLFG.com. I had a key file, a certification file, and a chain file which I referred to in my ssl.conf file which is included in the httpd.conf file for the apache web server. I went ahead and did a redirect so that http://heroLFG.com went to https://heroLFG.com. I had to update my deployment url with my version control system. And I had to update my global DOMAIN variable to use https instead of http. I have the nice little green padlock for now. I imagine that no security system is perfect. But it does help to provide some kind of deterrent.

Wednesday, September 10, 2014

Postfix

I started using the default godaddy "sendmail" program that came with my linux web server, and I quickly bumped up against my daily sending limits enforced by godaddy. This led me toward a namecheap server where I have no email sending limits. I just have to make sure I don't let my users send spam. Sending spam from my IP address could get it blacklisted, and namecheap could block my email capabilities. My quick and dirty solution involved using a program called "postfix" to create a basic "SMTP mail server". My mail server is dedicated to my customers. And it is "send only". I had to whitelist my web server's IP address so that it wasn't an "open mail relay". I hope to one day enhance my mail server and integrate it with a MySQL database. I also want to host virtual email addresses for the domains I own.

Postfix Website

Resources

I use resources from other developers all of the time. I know I will not be able to recognize all of them, but I want to start trying to keep notes. Some of these may get a post of their own, but for now:

JSColor Website
This is a color picker plugin using Javascript. Thank you for your work! I emailed the developer asking about determining whether text should be white or black when using a given RGB color as a background:
Hi Gavin,

sorry for the late response.

I first calculate color's luminance and then determine if it is darker than 50%, in which case I use white font, otherwise black one.

The algorithm is as follows:

styleElement.style.color =
0.213 * this.rgb[0] +
0.715 * this.rgb[1] +
0.072 * this.rgb[2]
< 0.5 ? '#FFF' : '#000';

Numbers in the array "this.rgb" range from 0.0 to 1.0. If your input values range from 0 to 255, you must obviously compare them with 128 instead of 0.5.

See also:
http://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color


Regards,

---
Jan Odvarko
Help with Color Themes Website
This website helps me to establish a color theme. Thank you for your work!
Paypal Guru
I haven't started using these libraries very much, but I have tested them a little and I intend to use them! Thank you for your work! I found this developer through the stackoverflow website.
PHP Login Guide
David Carr's login & registration guide has helped me get up and going. I am almost paying my bills now! Thank you so much for your help!
Google Fonts Website
This is a nice resource for using different fonts on your website. I think Google knows I am thankful in many ways. :)

Tuesday, September 9, 2014

API

API is an abbreviation for Application Programming Interface. APIs allows developers to share information with other developers and I am very excited about the future of information technology using APIs. I am just beginning to use the API provided by other developers. So far, I have successfully integrated basic functionality with Google, Paypal, and Facebook. I look forward to integrating more capabilities with these teams I have mentioned. I look forward to integrating with other teams. And I look forward to eventually providing my own API.

Google API
Paypal API
Facebook Graph-API
StackExchange API
Runkeeper API

Bootstrap

Bootstrap is a collection of CSS and Javascript resources. A web page can be viewed from multiple devices with different screen sizes. Bootstrap allows a web page to respond to the device which is accessing the web page. A team of developers can agree to use bootstrap libraries so that different developers can create a common user experience. Integrating bootstrap into a website helps the website to be more "responsive". This is "responsive design". A developer uses the bootstrap resources by defining an HTML element's "class" attribute.

Get Boostrap
Bootstrap Q & A

Javascript

I use Javascript as a client-side programming language. I mentioned that PHP is a programming language on the web server. Understand that a web server is a device that the client device connects to. I use PHP in combination with the Apache web server to send resources like HTML, CSS, and Javascript to a client device. And Javascript allows the developer to use the client devices hardware to manipulate HTML and CSS as the user interacts with a web page. Javascript can enhance the user experience by allowing the web page to respond without asking for more information from a distant web server.

Javascript at w3.org
Javascript at w3schools.com
Javascript Q & A

CSS

CSS is an abbreviation for Cascading Style Sheets. An HTML element can have an attribute called "style". CSS allows a developer to define "style" attributes for multiple HTML elements simultaneously. Styling can be implemented in multiple ways and CSS helps the developer to maintain a common look and feel for multiple web pages. The developer can make a small number of changes using CSS which will cause a large number of web pages to inherit those changes. CSS helps the developer to enhance the user experience and general aesthetic choices.

CSS at w3.org
CSS at w3schools.com
CSS Q & A

HTML

HTML is Hyper Text Markup Language based in an XML format. In short - XML has elements and elements have attributes. XML is a descriptive language (not a programming language) used to define elements that may or may not have attributes. Note that elements can have elements within. HTML is a defined set of elements and attributes which web browsers interpret into the elements you see (and some you don't see) when you view a web page. Elements can have a "style" attribute. And CSS is used to define the "style" of elements.

HTML at w3.org
HTML at w3schools.com
HTML Q & A

Apache

Apache is a website server program I have been using. It is the only web server program I have used so far. The capability of the software can be extended with modules listed in configuration files. The main configuration file for Apache is called "httpd.conf" and this is where I have most of my difficulties when setting up a computer to host a website. Note that this configuration file can include other files. And it is a good idea to have a backup of this file on hand before you begin testing new configurations. I use the command "apachectl graceful" to restart the web server without disrupting connectivity for users.

Resources:
Apache Documentation/
http://stackoverflow.com/questions/tagged/apache

MySQL

MySQL is a database software I use on my web server. I use PHP with the PDO driver to access the database when client web browsers point at my web address. I backup my databases and their tables using a periodic cron job executing a bash script. The MySQL database needs to be configured with security in mind. I like to use PhpMyAdmin as a graphical front-end to the MySQL database.

MySQL Website
MySQL Q & A
PhpMyAdmin Website
PhpMyAdmin Source Code

PHP

I use PHP as a server side programming language. I use it in combination with the Apache web server and I have run across permissions problems concerning the running Apache program's process and the PHP files. I use PHP to manipulate the MySQL database. And I use a PDO interface to help avoid SQL injection vulnerabilities. This requires that PHP is installed and configured to use the PDO driver. PHP has a configuration file called "php.ini" and this is where you can setup "include_path". Within a PHP file you often include other PHP files and the include_path can be configured as a common reference directory. There are different approaches to including PHP resources in other files. And I am discovering that many people use a software program called "composer" which I plan to learn more about. Note that changes to the php.ini file will not be in operation until you restart your web server (I use Apache).

PHP Website
PHP PDO Driver
PHP Q & A