FAQ Overview

vtiger

vtiger Invoice - How to make “Services” as Default

vtiger-logo

For those service oriented businesses that want this to default to the first item listed as a service you can change: Smarty/templates/inventory/ProductDetails.tpl

 

Search on "Following code is added for form the first row"
Find the reference to title="Products" and change to title="Services", "products.gif and change to services.gif,
onclick="productPickList" and change to onclick="servicePickList"

 

*Works with vtiger 5.4
org...https://forums.vtiger.com/viewtopic.php?t=31487
Thanks to timcampbell

Author: Administrator
Last update: 01-12-2016 14:18


What is vtiger CRM?

vtiger-logo

Vtiger CRM is a full-featured CRM software ideal for small and medium businesses, with low-cost product support available to production users that need reliable support. Vtiger CRM helps you bring the full potential to life in marketing, sales, and overall customer service.

 

Author: Administrator
Last update: 01-12-2016 14:18


Webforms broken in vTiger v6

Open a mysql manager such as myphpadmin and log into your database. enter the following query and run it:

create table ´vtiger_webforms_field´ (
´id´ int(19) not null auto_increment,
´webformid´ int(19) not null,
´fieldname´ varchar(50) not null,
´neutralizedfield´ varchar(50) not null,
´defaultvalue´ varchar(200) default null,
´required´ int(10) not null default '0',
primary key (´id´),
key ´webforms_webforms_field_idx´ (´id´),
key ´fk_1_vtiger_webforms_field´ (´webformid´),
key ´fk_2_vtiger_webforms_field´ (´fieldname´),
constraint ´fk_1_vtiger_webforms_field´ foreign key (´webformid´) references ´vtiger_webforms´ (´id´) on delete cascade,
constraint ´fk_3_vtiger_webforms_field´ foreign key (´fieldname´) references ´vtiger_field´ (´fieldname´) on delete cascade
)

Author: Administrator
Last update: 29-04-2015 17:42


BUG FIX: vTiger 6.1 and 6.2 Webforms Fields not Saving

SQL input...

create table vtiger_webforms_field (
id int(19) not null auto_increment,
webformid int(19) not null,
fieldname varchar(50) not null,
neutralizedfield varchar(50) not null,
defaultvalue varchar(200) default null,
required int(10) not null default '0',
sequence int(10) default null,
hidden int(10) default null,
captcha int(1) not null default '0',
roundrobin int(1) not null default '0',
roundrobin_userid varchar(256) default null,
roundrobin_logic int(11) not null default ‘0’,
primary key (id),
key webforms_webforms_field_idx (id),
key fk_1_vtiger_webforms_field (webformid),
key fk_2_vtiger_webforms_field (fieldname),
constraint fk_1_vtiger_webforms_field foreign key (webformid) references vtiger_webforms (id) on delete cascade,
constraint fk_3_vtiger_webforms_field foreign key (fieldname) references vtiger_field (fieldname) on delete cascade
)

so that the above now includes...

´captcha´ int(1) not null default '0',
´roundrobin´ int(1) not null default '0',
´roundrobin_userid´ varchar(256) default null,
´roundrobin_logic´ int(11) not null default '0'

Author: Administrator
Last update: 29-04-2015 17:46


How to delete a module from Vtiger CRM (5.0.4. to 6.x)

Here I am showing an example of how to delete a module named as testModule from Vtiger 5.0.4.

Simply deleting the files from modules folder associated with a particular module won't delete it completely. But deleting the files is also required. The best way to realize that is, try to reinstall the module, you will get the message that the module exists. In order to delete a module follow the steps given below.

Create a file named delete_testModule.php and put it in the root directory of Vtiger CRM.

Paste the following code into that file delete_testModule.php:
<?php
    $Vtiger_Utils_Log = true;
    include_once('vtlib/Vtiger/Module.php');
    $module = Vtiger_Module::getInstance('testModule');
    if($module)
    {
        $module->delete();
    }
?>

Execute the file delete_testModule.php. Once it is done delete the files associated with the testModule from modules folder in the root directory.

 
 

Author: parksdesign
Last update: 12-05-2015 04:54


Permission to perform the operation is denied for name

Make sure there is a entry for that module inside vtiger_ws_entity table

Author: parksdesign
Last update: 04-07-2015 15:49


Joomla

What is Joomla!

joomla-logo

 

Joomla is an award-winning content management system (CMS), which enables you to build Web sites and powerful online applications. Many aspects, including its ease-of-use and extensibility, have made Joomla the most popular Web site software available. Best of all, Joomla is an open source solution that is freely available to everyone.

 

Author: Administrator
Last update: 24-10-2013 03:15


How to email address is being protected from spambots within Joomla!

From a Joomla website, email addresses in the content are not showing. Instead you see an error message which reads:

This email address is being protected from spambots. You need JavaScript enabled to view it.

This message is shown despite the browser having JavaScript enabled.


 

Solution:

This error appears to only happen where content has been imported from a previous version of the Joomla CMS – such as from a Joomla 1.5 to a Joomla 2.5 installation.

The easiest way to get around this error is to disable the ‘Content – Email Cloaking’ plug-in. This plug-in automatically hides email addressed from spambots by encrypting your email address and encrypting when the page is loaded by a normal visit.

The other option to fix this issue appears to be opening each of the affected content pages and clicking ‘save’ again. You may need to do this whilst the email cloaking plugin is enabled to refresh the email address in the content.

 

How to disable the email cloaking plug-in

  1. You can disable the plug-in from the administrator page.
  2. After logging in hover over the ‘Extensions’ menu then click on ‘Plug-ins’.
  3. Under ‘Filter’ enter ’email’ and click ‘Search’.
  4. Under ‘Status’ click on the green tick to disable.

Author: parksdesign
Last update: 12-01-2016 18:16


MAMP

What is MAMP?

The abbreviation "MAMP" stands for: Macintosh, Apache, Mysql and PHP. With just a few mouse-clicks, you can install Apache, PHP and MySQL for Mac OS X!
 
MAMP installs a local server environment in a matter of seconds on your Mac OS X computer, be it MacBook or iMac. Like similar packages from the Windows- and Linux-world, MAMP comes free of charge.
 
MAMP is installed in the typical Mac fashion: very easily. MAMP will not compromise any existing Apache installation already running with your OS X. You can install Apache, PHP and MySQL without starting a script or having to change any configuration files!
 
Furthermore, if MAMP is no longer needed, it is sufficient to delete the MAMP folder and everything returns to its original status (i.e. MAMP does not modify any of the "normal" OS X).

Author: Administrator
Last update: 09-11-2013 22:52


What is MAMP PRO?

"MAMP PRO" is the commercial, professional grade version of the classic local server environment for Mac OS X: MAMP. Designed for professional web developers and programmers, MAMP PRO allows easy installation and administration of their development environment under Mac OS X.

As a professional web developer you have to test your programs in detail. In addition, you need a highly configurable developing environment with all the components also used by most ISPs: Apache, MySQL and PHP in the latest stable versions. No matter whether you want to test your latest Ajax creation, or realize a new page with a Content Management System (CMS): MAMP PRO supports you during the tests of your developments.


You can set up any number of servers to carry out tests without danger for your live system. Besides, the local name resolution is performed by MAMP PRO. To simulate a very authentic environment, the MAMP PRO also switches on the local mail server, so that dispatching mails by PHP scripts is possible.

 

Allowing external access

With MAMP PRO, you can easily connect your local server with an existing Dynamic DNS provider, as for example dyndns.com. Making it very simple to quickly make the results of your work accessible externally for superiors and prospective customers. And because you can set up many virtual hosts, you can easily offer alternative configurations or suggestions.

All functions of MAMP - and even more

 The freely available standard design "MAMP" is automatically coinstalled with MAMP PRO. Thus all MAMP features are available to you immediately:

 

Apache a la carte

With MAMP PRO, no complicated editing of configuration files is necessary to set up a working test environment. Cleanly separated, several projects can be developed at the same time. To be able to represent as great of a variety of ISPs as possible, PHP can be toggled at any time between multiple versions to guard against any possible incompatibilities. A Staging server on your Mac is set up with MAMP PRO with a few mouse clicks, so that you can keep your customers and superiors up-to-date about the state of your projects at any time. The user interface of MAMP PRO allows Apache modules to be systematically enabled or deactivated. Thus you can perfectly emulate the server environment on which your project will later run, and guarantee the highest possible quality of your project.

 

MySQL

The MySQL database is a component of the MAMP, however it is much easier to configure with MAMP PRO. To increase the security of a Mac connected to the Internet, you can not only quite easily change the port where MySQL answers, but change of the Root password or limit the access to the database server to local users. Should errors occur for SQL inquiries: with MAMP PRO you can also define the location for your error-log to be saved, so that you will not have to search for it.

 

So what exactly is MAMP?

MAMP stands for Macintosh, Apache, MySQL and PHP and for years has offered the perfect solution for a local developing environment under Mac OS X. The MAMP is also available free of charge for smaller projects.

Author: Administrator
Last update: 09-11-2013 22:57


How Do I Access FTP with MAMP (PRO)

MAMP logoHow to: Access FTP with MAMP

Sometimes you may need FTP access for your local development with MAMP or MAMP PRO. Therefore you can use the FTP server built into Mac OS X. The ftp server is not activated by default. To activate the server follow these steps:

Note: This tutorial uses Snow Leopard 10.6 but in general this also works with older Versions of Mac OS X.
  1. Open System Preferences
  2. Go to "Sharing"

How-to-Access-FTP-with-MAMP

  1. Activate "File Sharing"
  2. Click on "Options"
  3. Acitvate "Share files and folders using FTP"
  4. Click on "Done"
  5. Below the entry "FTP Access: On" you will find a text "Other people can access your FTP server atftp://10.0.1.200/ or browse for “Dirk Eineckes MacBook Pro 17"”."

    How-to-Access-FTP-with-MAMP

  6. Write down the IP Address
  7. Close the preferences panel
Now you have activated the FTP server and you can access it with any FTP client like Cyberduck or FileZilla. Per default you will be directed to your home directory. But most commonly you want to access a certain directory on your hard drive instead of accessing your home directory.

How this works we will showcase with the free FTP client FileZilla:
  1. Start FileZilla
  2. Go to File -> Site Manager
  3. Click on "New Site" in the upcoming dialogue
  4. Choose a name at the tree on the left (like "Local")
  5. On the right enter your IP Adress into the field "Host"
  6. Choose "Normal" at the select box "Logontype"
  7. Enter your username into the field "User"
  8. Enter your password into the field "Password". (Username and password are the same which you are using to access Mac OS X)

    How-to-Access-FTP-with-MAMP

  9. Click on the tab "Advanced"
  10. Enter your favored directory into the field "Default remote directory". On my system this is: "/Users/dirkeinecke/Documents/Websites/MAMP-Server/test"

    How-to-Access-FTP-with-MAMP

  11. Click "Connect"
You are done!

Author: Administrator
Last update: 09-11-2013 23:14


Apache HTTP Server

How to Block an IP address range using the .htaccess file

 

You could use:

Order Allow,Deny
Deny from 180.76.3.0/24
Allow from all

Or you could use this:

RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^180\.76\.3\.
RewriteRule ^ - [F]

Author: Administrator
Last update: 15-11-2013 21:14


GoDaddy Hosting

How do you view a GoDaddy website without a domain name

Usually you can access the client’s website pre-DNS by going to http://192.168.1.1/~username/ and preview the site before the DNS propagates.

This is especially handy because you can move files from one server to another, configure them and view them via the IP address/username combination and move the DNS after you’re confident the new server is properly setup. If executed properly, this prevents downtime and no one knows you’ve made any changes.

The problem? You can’t do this on GoDaddy. Without DNS setup, you can’t preview your site in a new location. The answer is simply to add a new A Name record pointing to a subdomain.

Configure your A Name records so that

old IP address points to yourdomain.com
new IP address points to newsiteatgodaddy.sampledomain.com hosted at GoDaddy.

and work under the subdomain until you’re ready to make your move.

Author: Administrator
Last update: 22-11-2013 14:46


Web Design » SEO, SEF and SEM

What is the difference between SEO, SEF and SEM?

The thing about the terms ‘SEO’, ‘SEF’ and ‘SEM’ is that clients looking for web design don’t have a clue what it really means 99.9% of the time. And the sad part is that most web designers don’t either. So this post is about how to tell the difference and how to choose a web designer who will give you the best shot at reaching your business goals on the internet. So, what do these terms mean in the web design world?

SEF / Search Engine Friendliness

- SEF can be described as everything the web designer and web programmer does to your website to make it FRIENDLY (easy) for search engines to find and rank. Some of these things could include having links made of text instead of images, building your site with CSS instead of tables so the page has less code and more relevant content, having correct tags like H1, H2, ALT, XHTML, etc, a proper XML sitemap, circular navigational architecture, and even proper URLs like ‘/aboutus.html’ instead of ‘/$%-something/index.php’. SEF also deals with usability for your website’s visitors to navigate your site intuitively. This is all done in the development and building stage of your site.

SEO / Search Engine Optimization

- This is the most often used and most misunderstood term that gets name-dropped every time a client is being pitched for a web contract. Many people talk as though SEO is a mish-mashed combination of both SEF and SEO and still only know half of what either one is! SEO actually has its roots in marketing
and is a monthly/yearly ongoing job. One of the things connected with SEO is KEYWORD TRACKING which is finding the most highly searched keywords on the net for your industry and target market (we use www.wordtracker.com; there is a monthly fee but you can try it out free for 1 week -hint!-). These keywords should then be used to ensure the links on your website have the highest search value and to monitor keyword density on each page of your website’s content. For example, Google likes a website to have around 4% keywords on a page. So if you want to get ranked for the term “restaurants owen sound”, you should have that term appear 4 times on your page, assuming there are 100 words total within the page content. Using keywords more often than that can be interpreted as “keyword stuffing”, and can actually harm your search engine rankings.
So, anyone who tells you that they will give you an SEO’d website for the low start-up design fee for your website is either not being truthful or, more likely, is simply uneducated in the industry. If a company tells you, however, that they will give you a Search Engine Friendly website and make your website ‘SEO ready’ …then they probably know what they are talking about which will make it much easier when you go to incorporate SEO marketing techniques.

SEM / Search Engine Marketing

-I would describe this just as it reads; marketing online. One of the things you can have done or do yourself is to submit your website URL (www.yourwebsite.com) to search engines like Google, MSN Live and Yahoo. You can also submit your URL to directories, write comments on other websites that talk about your topic to share in online communities, start social networking 2.0 accounts like on Facebook or Youtube, and start promoting your own community to drive the traffic to you. You can also create a newsletter that you email out to your client lists to keep them informed of your business’s happenings, along with using RSS feeds to push your content out into the net. At the very least, you can pay for Google Adwords or for a company to submit your URL to thousands of websites on the net. There are many more techniques but this is why we recommend that you find an online marketer to promote you, like us!

So, to wrap up, here is the best analogy I made up recently to explain SEF, SEO, and SEM. Its like this, the 18-wheeler, big rig that is carrying your website to your audience and search engines is Search Engine Marketing (SEM), the Search Engine Friendliness (SEF) is the frame of your house and how it is built to weather the storm of moving over the net and (SEO) is the content within the house that makes it valuable to search engines.

So, let’s get the word out there and help other business owners know that the term “if you build it they will come” is over. And that the new phrase is ” If you build it, you have to build it right and market the thing properly online” -hahaha-.

Did you know that there are companies that just do SEO and SEM and that’s it? And they can charge hundreds, thousands, or even tens of thousands of dollars a month to do so… it’s that big of a job but it produces results! As my grandfather once told me “The only good is knowledge and the only evil is ignorance!“.

 

Credits:http://www.geminifilms.ca/2009/02/what-is-the-difference-between-seo-sef-and-sem/

Author: Administrator
Last update: 11-12-2013 22:17


PHP

What is the best PHP handler

Choosing the best PHP handler for your specific needs can go a long way in ensuring an efficient and secure hosting experience for all of your websites. One PHP handler is not necessarily better than the others in every situation, so understanding the basics of what each PHP handler has to offer can help you figure out which one might be best in your specific case.

Available PHP handlers

suPHP (Single user PHP) On InMotion Hosting's servers, suPHP is the default PHP handler that is used. suPHP runs as a CGI module and its major benefits are stronger security and easy permissions.
DSO (Dynamic Shared Object) Run as an Apache module, DSO also referred to as mod_php, is one of the oldest PHP handlers and its major benefits are speed and the ability to use opcode caching.
FCGI (FastCGI) Run as a CGI module, FCGI also referred to as mod_fcgid, is one of the newest PHP handlers and its major benefits are CPU performance and the ability to use opcode caching.
CGI (Common Gateway Interface) Run as a CGI module, the CGI PHP handler supports some extra configurations, but lacks in both speed and security and is generally not recommended to use.

suPHP - Single user PHP (mod_suphp)

Using the suPHP PHP handler is among the most flexible and secure ways of serving PHP requests. With the suPHP handler selected along with using the suEXEC option, all PHP scripts will be executed as the user that owns the script, instead of running as Apache's "nobody" user. For every PHP request that is being processed a separate PHP process will be spawned, so it makes it very easy to see and track if one particular user on the server is running a lot of PHP scripts, or which users are causing more CPU intensive PHP script executions.

The main benefit of using the suPHP handler is that it isolates one user on the server from the others. So if one account was compromised because of an exploit in one of your PHP scripts, the attacker would only be able to view or modify files owned by that particular user. It's also among the easiest to use with CMS (Content Management Systems) such as Wordpress or Joomla. As typically these applications require the ability to create files on the server, and being that all of your files are owned by just one user, permission management is easy to configure.

The main disadvantage of using the suPHP handler is that your PHP websites could be slower due to the additional overhead of having to run a separate PHP process per request. Also if your server receives a high volume of PHP requests in a short period of time, this could lead to a heavy load on your server from all of the concurrent PHP processes. Finally you won't be able to change PHP directives directly from a .htaccess file, you would instead need to make these changes in a php.ini file. For more information on this, you can read our guide how can I make my php.ini file recursive?

You might choose suPHP as your PHP handler if you have multiple users on your server, you don't want to worry about setting permissions, and you aren't having any performance issues with the PHP scripts that you currently run.

DSO - Dynamic Shared Object (mod_php)

Using the DSO PHP handler is the fastest way to serve PHP requests. The DSO handler is an older PHP handler that runs PHP as an Apache module. All PHP scripts are executed as the Apache user "nobody", which allows for faster execution, but can be more of a headache configuring permissions for.

The main benefit of using the DSO handler is that it doesn't have much overhead, so it's fast out of the box. You can also use PHP opcode caching along with DSO to speed up your PHP requests even further. Additionally you can set PHP directives directly via .htaccess files to control certain functionality of PHP.

The main disadvantage of using the DSO handler is that all PHP scripts will need to be owned and excuted by Apache's "nobody" user. This means that PHP executions can't easily be tracked on a per user basis since they're all run from the one web server user. Also when you use a CMS (Content Management System) such as WordPress or Joomla that requires the ability of these applications to write or modify files, the proper permissions must be set beforehand to allow this to happen. Each time a new file is created by a PHP script, it will be owned by the "nobody" user and can lead to further permission issues.

Another major drawback of the DSO handler is security. Because all of your users on the server are having their PHP scripts executed by the same "nobody" user, if one of your sites is exploited due to a flaw in one of your PHP scripts, the attacker could potentially look at or modify files outside of that user's directory that had the PHP script that was exploitable. So when using the DSO handler it's always very important to keep all of your PHP software up to date with any security patches so they are not exploited.

You might choose DSO as your PHP handler if you only have one user and your primary concern is speed and performance.

FCGI - FastCGI (mod_fcgid)

Using the FastCGI PHP handler is a faster way to serve PHP requests than using suPHP but typically not as fast as using DSO. FastCGI is good at reducing CPU usage by leveraging your server's available RAM to keep PHP scripts in memory instead of having to start up a separate PHP process for each and every PHP request.

The main benefit of using the FastCGI handler is that you can use suEXEC just like with suPHP to allow PHP scripts to be executed by the actual user of the PHP script instead of using the Apache "nobody" user. FastCGI also doesn't require a single PHP process execution per request like suPHP does, so it can be much faster and reduces CPU usage by holding PHP scripts in memory.

The main disadvantage of the FastCGI handler is that it can be very memory intensive. This is because FastCGI keeps PHP sessions opened in the background in memory for quicker access and the ability to use PHP opcode caching can add to the memory usage as well. Additionally FastCGI can encounter an array of errors depending on how your PHP scripts are coded. This can typically require a day or two of setting tweaks, specific to what your PHP scripts are trying to do.

You might choose FastCGI as your PHP handler if you're experiencing slow or excessive PHP executions when using the suPHP handler, and you have available memory to spare on your server.

CGI - Common Gateway Interface (mod_cgi)

Using the CGI PHP handler is not something widely used anymore due to the other PHP handlers benefits. Like suPHP and FastCGI the CGI handler can use suEXEC so that PHP executions are run by the file owner of a PHP script rather than the Apache "nobody" user.

The main benefit of using the CGI handler is that it is very configurable, and supports using suEXEC for making permissions less of a headache.

The main disadvantage of the CGI handler is that it is the slowest handler. The CGI handler is typically not used much anymore.

You might choose CGI as your PHP handler if for some reason suPHP, DSO, or FastCGI wasn't available on your server.

Conclusion

You should now have a decent understanding of the different PHP handlers available to use. Choosing which PHP handler is best for your particular PHP environment can be tricky at times, and generally it's not recommened to change them if you're not having any performance or security issues with your default setup.

If you'd like a recommendation on which PHP handler might be best in your particluar case we would recommend sending an e-mail to (support@inmotionhosting.com) and our system administration team can review your current server configuration for you.

Author: Administrator
Last update: 18-01-2015 23:05


How do you edit your main php.ini on VPS

All servers have a main php.ini file. This is a file that allows you to control the php settings. The main php.ini file controls the settings for the entire server. By placing a php.ini file within a folder, it will override the main server php.ini and allow you to customize settings for the files and folders under it.

Most of the time, editing a php.ini file at a more local level is sufficient, however there are times when you may want to alter the main php.in file to provide the setting change as a default to the entire server. This can only be done with the root access on VPS and dedicated servers. The instructions below walk you through how to do that.

How to change your main php.ini file on VPS and Dedicated servers

  1. Log into your server via SSH.
  2. Use the following command to open the file for editing.
    nano /usr/local/lib/php.ini
  3. Activate the Find feature by pressing crtl+W and then entering desired setting. The interface will scroll to that setting. In our case, we searched for post_max_size.
 
  1. Alter the setting to your desired configuration. We changed the post_max_size setting to 16M.
  1. Save the changes by pressing crtl+O. You will be prompted for a filename, press Enter to keep the same name.
  1. Exit the editor by pressing ctrl+X.
  2. Exit your SSH Client.
Now that your php.ini settings have been saved, they will begin to work for your server.
Note: Those on FastCGI or DSO servers will need to restart Apache for the changes to take place.

Author: Administrator
Last update: 18-01-2015 23:21


How do you login to your server via SSH for VPS/Dedicated Servers

  1. Your account has ssh access.
  2. Your IP address has been added to the firewall.
  3. You have a SSH client.

If you are looking for information on how log in via SSH with a shared server, please see SSH access for Resellers and Shared Servers.


In this tutorial, we're going to be using PuTTY to connect to your VPS or dedicated server via SSH. If you don't already have an SSH client, we recommend that you download PuTTY.

If you are trying to directly connect from a Linux or Mac terminal via SSH, please note the format of the command would need to be in this format:

[Bob ~]$ ssh username@example.com -p 22

If you do not specify the full username such as username@example, the server would instead try to login as your local user, in this case Bob@example.com, and because that user doesn't exist on the server you'd get a login error.

Before we open PuTTY, you'll need the following settings:

Note! Your hostname and username can be found in the Technical Details of your AMP home page.

Host Name: As your hostname, you can use either your server's ip address, your domain, or your server name (as in vps####.inmotionhosting.com ro biz152.inmotionhosting.com)
Username: Use your cPanel username.
Password: Use your cPanel password.

How to connect using PuTTY

In this tutorial, I am using vps801.inmotionhosting.com as the host name, "brad" as the cPanel username, and the ******** as the password.

  1. Open Putty.
  2. Enter your hostname.
  3. Click "Open".

    Can't connect? Getting an error message Network Error: Connection timed out? Be sure to add your ip address to the firewall.

  1. If you get a "PuTTY Security Alert", click yes to continue (If you read the message, this is your server so you should trust it).
  1. You will see "Login As". Please enter your username and then hit Enter.
  1. You will then see username@vps####.inmotionhosting.com's password:. Enter your password and hit enter. For security reasons, PuTTY will not show anything when you type your password, this is normal.
  1. When you have successfully logged in, you'll see username@vps####.inmotionhosting.com [~]#.

    Note! If you get an error stating Shell Access is Not Enabled on your server, you will need to contact tech support to have our higher level of support enable the shell access. If you can access your WHM, you can enable SSH through your WHM.

Congratulations, you have now successfully logged into your server via SSH!

Author: Administrator
Last update: 18-01-2015 23:18


What PHP's Date/Time Functions

date

(PHP 4, PHP 5)

dateFormat a local time/date

Description

string date ( string $format [, int $timestamp = time() ] )

Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given. In other words, timestamp is optional and defaults to the value of time().

Parameters

format

The format of the outputted date string. See the formatting options below. There are also several predefined date constants that may be used instead, so for example DATE_RSS contains the format string 'D, d M Y H:i:s'.

The following characters are recognized in the format parameter string
format characterDescriptionExample returned values
Day --- ---
d Day of the month, 2 digits with leading zeros 01 to 31
D A textual representation of a day, three letters Mon through Sun
j Day of the month without leading zeros 1 to 31
l (lowercase 'L') A full textual representation of the day of the week Sunday through Saturday
N ISO-8601 numeric representation of the day of the week (added in PHP 5.1.0) 1 (for Monday) through 7 (for Sunday)
S English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j
w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)
z The day of the year (starting from 0) 0 through 365
Week --- ---
W ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0) Example: 42 (the 42nd week in the year)
Month --- ---
F A full textual representation of a month, such as January or March January through December
m Numeric representation of a month, with leading zeros 01 through 12
M A short textual representation of a month, three letters Jan through Dec
n Numeric representation of a month, without leading zeros 1 through 12
t Number of days in the given month 28 through 31
Year --- ---
L Whether it's a leap year 1 if it is a leap year, 0 otherwise.
o ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in PHP 5.1.0) Examples: 1999 or 2003
Y A full numeric representation of a year, 4 digits Examples: 1999 or 2003
y A two digit representation of a year Examples: 99 or 03
Time --- ---
a Lowercase Ante meridiem and Post meridiem am or pm
A Uppercase Ante meridiem and Post meridiem AM or PM
B Swatch Internet time 000 through 999
g 12-hour format of an hour without leading zeros 1 through 12
G 24-hour format of an hour without leading zeros 0 through 23
h 12-hour format of an hour with leading zeros 01 through 12
H 24-hour format of an hour with leading zeros 00 through 23
i Minutes with leading zeros 00 to 59
s Seconds, with leading zeros 00 through 59
u Microseconds (added in PHP 5.2.2). Note that date() will always generate 000000 since it takes an integer parameter, whereas DateTime::format() does support microseconds. Example: 654321
Timezone --- ---
e Timezone identifier (added in PHP 5.1.0) Examples: UTC, GMT, Atlantic/Azores
I (capital i) Whether or not the date is in daylight saving time 1 if Daylight Saving Time, 0 otherwise.
O Difference to Greenwich time (GMT) in hours Example: +0200
P Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3) Example: +02:00
T Timezone abbreviation Examples: EST, MDT ...
Z Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. -43200 through 50400
Full Date/Time --- ---
c ISO 8601 date (added in PHP 5) 2004-02-12T15:19:21+00:00
r » RFC 2822 formatted date Example: Thu, 21 Dec 2000 16:01:07 +0200
U Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) See also time()

Unrecognized characters in the format string will be printed as-is. The Z format will always return 0 when using gmdate().

Note:

Since this function only accepts integer timestamps the u format character is only useful when using the date_format() function with user based timestamps created with date_create().

timestamp

The optional timestamp parameter is an integer Unix timestamp that defaults to the current local time if a timestamp is not given. In other words, it defaults to the value of time().

Return Values

Returns a formatted date string. If a non-numeric value is used for timestamp, FALSE is returned and an E_WARNING level error is emitted.

Errors/Exceptions

Every call to a date/time function will generate a E_NOTICE if the time zone is not valid, and/or a E_STRICT or E_WARNING message if using the system settings or the TZ environment variable. See also date_default_timezone_set()

Changelog

VersionDescription
5.1.0 The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer). However, before PHP 5.1.0 this range was limited from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows).
5.1.0

Now issues the E_STRICT and E_NOTICE time zone errors.

5.1.1 There are useful constants of standard date/time formats that can be used to specify the format parameter.

Examples

Example #1 date() examples

<?php
// set the default timezone to use. Available since PHP 5.1
date_default_timezone_set('UTC');


// Prints something like: Monday
echo date("l");

// Prints something like: Monday 8th of August 2005 03:12:46 PM
echo date('l jS \of F Y h:i:s A');

// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " date("l"mktime(000712000));

/* use the constants in the format parameter */
// prints something like: Wed, 25 Sep 2013 15:28:57 -0700
echo date(DATE_RFC2822);

// prints something like: 2000-07-01T00:00:00+00:00
echo date(DATE_ATOMmktime(000712000));
?>

You can prevent a recognized character in the format string from being expanded by escaping it with a preceding backslash. If the character with a backslash is already a special sequence, you may need to also escape the backslash.

Example #2 Escaping characters in date()

<?php
// prints something like: Wednesday the 15th
echo date('l \t\h\e jS');
?>

It is possible to use date() and mktime() together to find dates in the future or the past.

Example #3 date() and mktime() example

<?php
$tomorrow  
mktime(000date("m")  , date("d")+1date("Y"));
$lastmonth mktime(000date("m")-1date("d"),   date("Y"));
$nextyear  mktime(000date("m"),   date("d"),   date("Y")+1);
?>

Note:

This can be more reliable than simply adding or subtracting the number of seconds in a day or month to a timestamp because of daylight saving time.

Some examples of date() formatting. Note that you should escape any other characters, as any which currently have a special meaning will produce undesirable results, and other characters may be assigned meaning in future PHP versions. When escaping, be sure to use single quotes to prevent characters like \n from becoming newlines.

Example #4 date() Formatting

<?php
// Assuming today is March 10th, 2001, 5:16:18 pm, and that we are in the
// Mountain Standard Time (MST) Time Zone

$today date("F j, Y, g:i a");                 // March 10, 2001, 5:16 pm
$today date("m.d.y");                         // 03.10.01
$today date("j, n, Y");                       // 10, 3, 2001
$today date("Ymd");                           // 20010310
$today date('h-i-s, j-m-y, it is w Day');     // 05-16-18, 10-03-01, 1631 1618 6 Satpm01
$today date('\i\t \i\s \t\h\e jS \d\a\y.');   // it is the 10th day.
$today date("D M j G:i:s T Y");               // Sat Mar 10 17:16:18 MST 2001
$today date('H:m:s \m \i\s\ \m\o\n\t\h');     // 17:03:18 m is month
$today date("H:i:s");                         // 17:16:18
$today date("Y-m-d H:i:s");                   // 2001-03-10 17:16:18 (the MySQL DATETIME format)
?>

To format dates in other languages, you should use the setlocale() and strftime() functions instead of date().

Notes

Note:

To generate a timestamp from a string representation of the date, you may be able to use strtotime(). Additionally, some databases have functions to convert their date formats into timestamps (such as MySQL's » UNIX_TIMESTAMP function).

Tip

Timestamp of the start of the request is available in $_SERVER['REQUEST_TIME'] since PHP 5.1.

Author: Administrator
Last update: 19-01-2015 15:56


What is the Rewrite htaccess code for www vs. non-www

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

Author: Administrator
Last update: 20-01-2015 22:32


Joomla » RS Forms

What are RS Forms validation rules

General

  • Name: the name of the form component. This needs to be unique for each form. It can contain only alphanumeric chars. The name of the field is only used for internal reference - it will not be displayed in the front-end area.
  • Caption: the caption or label is the text or HTML that is being displayed in the actual form.
  • Default value: the value will be automatically filled in when displaying the form. Inside the Default Value area you can use custom PHP codes in between the //<code> and //</code> tags.
  • Description: text/HTML area that provides a description of the field. This can be useful for providing explanations or indications for that particular field.

 

Validations

Special mention: The Passphrase validation rule(if enabled), the field will only pass the validation if the typed in value is the same as the one specified in the Default Value area.
  • Required: Yes / No - if this is enabled some text needs to be typed in or a selection to be made.
  • Validation rule: before a form is submitted, the field needs to pass the validation rule.
    • Alpha: only standard letters will be accepted
    • Numeric: only numbers will be accepted
    • Alphanumeric: numbers and letters (ASCII standard) are accepted.
    • Alpha(+ accented characters): only standard letters and accented ones will be accepted
    • Alphanumeric(+ accented characters): numbers, letters and accented letters (ASCII standard) are accepted.
    • Email: if selected, only email valid email addresses (format wise) will pass the validation rule.
    • Email Address /w DNS check: besides the email address format check, RSform!Pro performs an additional email domain check, thus reducing the chance to validate dummy email addresses.
    • Unique Field: if enabled, this validation will only allow a field value that hasn't been submitted before, for that particular form.
    • Unique Field per User: if enabled, this validation will only allow a field value that hasn't been submitted before by the logged in user.
    • USA ZIP Code: only valid ZIP numbers (format wise) can be submitted. Valid formats are 5 numeric values only or 5 numeric along with a dash ("-"), followed by another group of 4 numeric values. Examples of accepted formats: "12345", "12345-1234".
    • Phone Number: only the following phone number format will be validated: "123-456-7890"
    • Credit Card: if selected, credit card numbers from the following vendors will be validated: AMEX, Diners, Discover, Master Card and Visa
    • Custom Validation: this can be used in combination with any other validation rule (apart from "password"). Using this you can validate additional chars. This is particularly useful if your language has special chars - thus these can be validated.
    • Passphrase: the typed in value will be accepted only if it matches with the value specified in the Default Value area. This can also be applied for plain text box fields.
    • IP Address: will only validate valid IP addresses. Example: 192.168.1.1
    • Valid URL: will only validate a valid URL. Example: http://site.com, https://site.com/path/here. Note that the protocol specification is required (http/https).
    • Regex: this can be used for more advanced users to create their own validation patterns. Standard regular expressions specifications can be used.
    • Same Value as Other Field: using this will check if two fields have the same value, selecting this validation another field will appear called "Field Name To Compare With" where you can add that field's exact name you want it to compare to.
  • Validation Message: text / HTML area that will allow you to set up a message that will be displayed if the field validation fails.

 

Attributes

The Attributes area allows you to add JavaScripts triggers, custom style (for that particular field), impose size restrictions, etc. Anything filled in this area, will be added directly to the HTML tag.

  • Size: Sets or returns the width of a text field (in number of characters).
  • Max size: how many chars can be typed in.
  • Additional Attributes: anything filled in this area, will be added directly to the HTML input tag. For example:
    JavaScript: onkeyup="your_function();" - this will trigger a JavaScript function whenever you type in something in that particular textbox.
    CSS: style="color:red" - the text will have a red color.
    Input property: readOnly="readonly" - you will not be able to type into it.

 

Author: parksdesign
Last update: 03-05-2015 21:54


How do you Register and have Automatic login to Joomla

Script called after form has been processed The $thankYouMessage string contains the HTML code of the Thank You Message.
You can modify it by adding a PHP script below. Remember to not include the <?php and ?> tags.
 
$credentials = array();
$credentials['username'] = $_POST['form']['Last_Name'];
$credentials['password'] = $_POST['form']['phone'];
$login_site =& JFactory::getApplication('site');
$login_site->login($credentials, $options=array());

Author: parksdesign
Last update: 03-05-2015 21:59


Label as default value with placeholder

Using the default HTML placeholder property

Simply add placeholder="First Name*" in the Additional Attributes area of your textbox field. This will display First Name* in the text box until at least one character is typed in. Clearing the field will return it to it's original state.

 


 

This is particularly useful when there is a limited space available for a form. You can set the actual name of the field or a example value, so the user can better understand what he/she has to fill in. There are 2 methods available for implementing this:

Using a default value for the field and Javascript

      • Add First Name* in the Default Value property of your textbox field.
      • Add the following script in the Additional attributes property of your textbox field.
 
onfocus="if (this.value=='First Name*') this.value='';"
onblur="if (this.value=='') this.value='First Name*';"
 

The script will need to be placed in the Additional attributes property of your textbox field.

Using this script will cause the default value upon clicking inside the field to disappear. If nothing is filled the original value will be reverted. If this field is set to be required, it will display a validation error.

 

 

Author: parksdesign
Last update: 06-05-2015 15:27


CSS

CSS: stretching background image to 100% width and height of screen

background-image: url("http://URL/images/image.jpg");
background-repeat: no-repeat;
background-size: 100%;

Author: parksdesign
Last update: 25-05-2015 17:17


Web banners | IAB Standardization

What are Web Banners and IAB standards

A web banner or banner ad is a form of advertising on the World Wide Web delivered by an ad server. This form of online advertising entails embedding an advertisement into a web page. It is intended to attract traffic to a website by linking to the website of the advertiser. In many cases, banners are delivered by a central ad server.

When the advertiser scans their logfiles and detects that a web user has visited the advertiser's site from the content site by clicking on the banner ad, the advertiser sends the content provider some small amount of money (usually around five to ten US cents).[citation needed] This payback system is often how the content provider is able to pay for the Internet access to supply the content in the first place. Usually though, advertisers use ad networks to serve their advertisements, resulting in a revshare system and higher quality ad placement.

Web banners function the same way as traditional advertisements are intended to function: notifying consumers of the product or service and presenting reasons why the consumer should choose the product in question, a fact first documented on HotWired in 1996 by researchers Rex Briggs and Nigel Hollis.[1] Web banners differ in that the results for advertisement campaigns may be monitored real-time and may be targeted to the viewer's interests. Behavior is often tracked through the use of a click tag.

Many web surfers regard these advertisements as annoying because they distract from a web page's actual content or waste bandwidth. Newer web browsers often include options to disable pop-ups or block images from selected websites. Another way of avoiding banners is to use a proxy server that blocks them, such as Privoxy. Web browsers may also have extensions available that block banners, for example Adblock Plus for Mozilla Firefox, or AdThwart for Google Chrome and ie7pro for Internet Explorer.

 


 

Standard sizes

Ad sizes have been standardized to some extent by the IAB. Prior to the IAB standardization, banner ads appeared in over 250 different sizes.[9] However, some websites and advertising networks (outside the Eurosphere or North America) may not use any or all of the IAB base ad sizes. The IAB ad sizes are:

 
NameWidth / pxHeight / pxAspect ratio
Rectangles and Pop-Ups
Medium Rectangle 300 250 1.2
Square Pop-Up 250 250 1
Vertical Rectangle 240 400 0.6
Large Rectangle 336 280 1.2
Rectangle 180 150 1.2
3:1 Rectangle 300 100 3
Pop-Under 720 300 2.4
Banners and Buttons
Full banner 468 60 7.8
Half banner 234 60 3.9
Micro bar 88 31 2.84
Button 1 120 90 1.33
Button 2 120 60 2
Vertical banner 120 240 0.5
Square button 125 125 1
Leaderboard 728 90 8.09
Skyscrapers
Wide skyscraper 160 600 3.75
Skyscraper 120 600 5
Half page ad 300 600 2

 

 

Author: parksdesign
Last update: 23-11-2015 20:30


SSH

How do you Connect to a Shared Server SSH with a Mac

The Secure SHell (SSH) command line is available through an Apple Macintosh computer using their Terminal program. A private and public key pair is required before you can connect to the server. These instructions are are intended for use with a shared server. Learn more about SSH Hosting.

Generate Key for Shell Access

  1. SSH/Shell Access

    Login to the cPanel and then go to the SSH/Shell Access icon. Click on it to access section where you can generate the private key.

  2. Manage SSH

    Click on the button labeled Manage SSH Keys

  3. Generate/Manage a new key

    Click on the button labeled Generate a new key

  4. Type in a password (do NOT use the password generator), then confirm it. Make sure to write down the password you used. Leave the key type at DSA and key size at 1024.
  5. If you are creating a key for the first time, click on the Generate Key button.
  6. You should then see a confirmation that the key was generated. Return to the Manage SSH Keys screen
  7. You should see the Public key AND the Private key generated with the name "id_dsa". Click on View/Download for the PRIVATE key. This is the key that you will need to load onto your Mac.
  8. Download the file to your Mac client. To make it simple for this tutorial, copy the file to your desktop.
  9. Key not authorized

    Before we move to the Mac side of things, you should check to see if the PUBLIC key has an authorization status of NOT AUTHORIZED. Click on the Manage Authorization link. This will authorize the key for you! NOTE: If you don't authorize this key, it doesn't matter what you do on the Mac side, you won't be able to login.

The next portion of the process requires that you login to your Mac as an administrator. We will be using the default Terminal program in order to login to SSH using the key that we generated above.

Use Apple Terminal Program to Connect to SSH

  1. Login to your Terminal program. If you don't know how to do this, go the magnifying glass in the OS toolbar (usually at the top right - this is Spotlight) and type in "terminal". You should see Terminal appear as an application. Select it and it will launch. Note that if you are not logged into your Mac as the administrator you will not be able to make these changes.
  2. Go to your desktop where you copied the ID_DSA file. The terminal command is: cd desktop
  3. Make sure that the ID_DSA file is already on your desktop. Then type the following into your terminal:


    cp -frp id_dsa ~/.ssh


    This will copy the key into the .ssh folder.

  4. Next run the following command to add the identity to your computer.

    ssh-add -K id_dsa


    You will then need to type in the password you used to generate the key in cPanel.

  5. You should see a confirmation that the identity has been added to your Mac. When this is complete, you will be able to use the SSH command to login to the server. The cPanel user name will need to be used along with the server name. The command will look like this:


    ssh -p 2222 cpanelusername5@servername.inmotionhosting.com


    Here's an example: ssh -p 2222 user5@ecbiz188.inmotionhosting.com)

  6. If this is the first time you have connected the server, you may see a message stating that it can't identity the server. Just click on "YES" to proceed (just make you're connecting to the right server). The password should automatically work and you should see the terminal connect.

This completes the tutorial for creating a new SSH key to connect your Mac terminal program to the InMotion Hosting shared server SSH. For best security practices, make sure to keep your key private and don't share the password unless necessary.

 


 

****The "permissions are too open" error is usually caused by the permissions level of the private key you are using.

Instead of 644, they should be set to 500. Here is a link to our guide on How to change file permissions and ownership settings while in SSH

 

Author: parksdesign
Last update: 12-08-2016 18:02


How to add your IP Address to the Firewall (for ssh access)

For security reasons, SSH access to your server is blocked at the firewall level. Before you can connect to your account via SSH, you will need to add your local IP address to the firewall.

Adding your IP address to the Firewall

  1. Find your IP address. Visit the following url:

    http://www.inmotionhosting.com/support/ipcheck.php

    Note the IP address that is displayed. This is your IP address as seen by the rest of the internet.

  2. Log into your WHM. (Web Host Manager)
  3. Click the "Add IP to Firewall" link in the left menu.

    Note! This link is one of the last links in the left menu in WHM. You can also type in the search box at the top right "Add IP" and the link will show on the left.

  4. Enter your IP address in the "Allow Rule:" field and click the "Add Rule / Restart" button.

    Note! You cannot view IP addresses in your firewall through the WHM. To view your IP addresses, you will need to look in the following file through shell.
    /etc/apf/allow_hosts.rules

Author: parksdesign
Last update: 12-08-2016 18:03


How do you Connect to a Shared Server SSH with a Mac

The Secure SHell (SSH) command line is available through an Apple Macintosh computer using their Terminal program. A private and public key pair is required before you can connect to the server. These instructions are are intended for use with a shared server. Learn more about SSH Hosting.

Generate Key for Shell Access

  1. SSH/Shell Access

    Login to the cPanel and then go to the SSH/Shell Access icon. Click on it to access section where you can generate the private key.

  2. Manage SSH

    Click on the button labeled Manage SSH Keys

  3. Generate/Manage a new key

    Click on the button labeled Generate a new key

  4. Type in a password (do NOT use the password generator), then confirm it. Make sure to write down the password you used. Leave the key type at DSA and key size at 1024.
  5. If you are creating a key for the first time, click on the Generate Key button.
  6. You should then see a confirmation that the key was generated. Return to the Manage SSH Keys screen
  7. You should see the Public key AND the Private key generated with the name "id_dsa". Click on View/Download for the PRIVATE key. This is the key that you will need to load onto your Mac.
  8. Download the file to your Mac client. To make it simple for this tutorial, copy the file to your desktop.
  9. Key not authorized

    Before we move to the Mac side of things, you should check to see if the PUBLIC key has an authorization status of NOT AUTHORIZED. Click on the Manage Authorization link. This will authorize the key for you! NOTE: If you don't authorize this key, it doesn't matter what you do on the Mac side, you won't be able to login.

The next portion of the process requires that you login to your Mac as an administrator. We will be using the default Terminal program in order to login to SSH using the key that we generated above.

Use Apple Terminal Program to Connect to SSH

  1. Login to your Terminal program. If you don't know how to do this, go the magnifying glass in the OS toolbar (usually at the top right - this is Spotlight) and type in "terminal". You should see Terminal appear as an application. Select it and it will launch. Note that if you are not logged into your Mac as the administrator you will not be able to make these changes.
  2. Go to your desktop where you copied the ID_DSA file. The terminal command is: cd desktop
  3. Make sure that the ID_DSA file is already on your desktop. Then type the following into your terminal:


    cp -frp id_dsa ~/.ssh


    This will copy the key into the .ssh folder.

  4. Next run the following command to add the identity to your computer.

    ssh-add -K id_dsa


    You will then need to type in the password you used to generate the key in cPanel.

  5. You should see a confirmation that the identity has been added to your Mac. When this is complete, you will be able to use the SSH command to login to the server. The cPanel user name will need to be used along with the server name. The command will look like this:


    ssh -p 2222 cpanelusername5@servername.inmotionhosting.com


    Here's an example: ssh -p 2222 user5@ecbiz188.inmotionhosting.com)

  6. If this is the first time you have connected the server, you may see a message stating that it can't identity the server. Just click on "YES" to proceed (just make you're connecting to the right server). The password should automatically work and you should see the terminal connect.

This completes the tutorial for creating a new SSH key to connect your Mac terminal program to the InMotion Hosting shared server SSH. For best security practices, make sure to keep your key private and don't share the password unless necessary.

 


 

****The "permissions are too open" error is usually caused by the permissions level of the private key you are using.

Instead of 644, they should be set to 500. Here is a link to our guide on How to change file permissions and ownership settings while in SSH

 

Author: parksdesign
Last update: 15-08-2016 01:16


How do you Connect to a Shared Server SSH with a Mac

The Secure SHell (SSH) command line is available through an Apple Macintosh computer using their Terminal program. A private and public key pair is required before you can connect to the server. These instructions are are intended for use with a shared server. Learn more about SSH Hosting.

Generate Key for Shell Access

  1. SSH/Shell Access

    Login to the cPanel and then go to the SSH/Shell Access icon. Click on it to access section where you can generate the private key.

  2. Manage SSH

    Click on the button labeled Manage SSH Keys

  3. Generate/Manage a new key

    Click on the button labeled Generate a new key

  4. Type in a password (do NOT use the password generator), then confirm it. Make sure to write down the password you used. Leave the key type at DSA and key size at 1024.
  5. If you are creating a key for the first time, click on the Generate Key button.
  6. You should then see a confirmation that the key was generated. Return to the Manage SSH Keys screen
  7. You should see the Public key AND the Private key generated with the name "id_dsa". Click on View/Download for the PRIVATE key. This is the key that you will need to load onto your Mac.
  8. Download the file to your Mac client. To make it simple for this tutorial, copy the file to your desktop.
  9. Key not authorized

    Before we move to the Mac side of things, you should check to see if the PUBLIC key has an authorization status of NOT AUTHORIZED. Click on the Manage Authorization link. This will authorize the key for you! NOTE: If you don't authorize this key, it doesn't matter what you do on the Mac side, you won't be able to login.

The next portion of the process requires that you login to your Mac as an administrator. We will be using the default Terminal program in order to login to SSH using the key that we generated above.

Use Apple Terminal Program to Connect to SSH

  1. Login to your Terminal program. If you don't know how to do this, go the magnifying glass in the OS toolbar (usually at the top right - this is Spotlight) and type in "terminal". You should see Terminal appear as an application. Select it and it will launch. Note that if you are not logged into your Mac as the administrator you will not be able to make these changes.
  2. Go to your desktop where you copied the ID_DSA file. The terminal command is: cd desktop
  3. Make sure that the ID_DSA file is already on your desktop. Then type the following into your terminal:


    cp -frp id_dsa ~/.ssh


    This will copy the key into the .ssh folder.

  4. Next run the following command to add the identity to your computer.

    ssh-add -K id_dsa


    You will then need to type in the password you used to generate the key in cPanel.

  5. You should see a confirmation that the identity has been added to your Mac. When this is complete, you will be able to use the SSH command to login to the server. The cPanel user name will need to be used along with the server name. The command will look like this:


    ssh -p 2222 cpanelusername5@servername.inmotionhosting.com


    Here's an example: ssh -p 2222 user5@ecbiz188.inmotionhosting.com)

  6. If this is the first time you have connected the server, you may see a message stating that it can't identity the server. Just click on "YES" to proceed (just make you're connecting to the right server). The password should automatically work and you should see the terminal connect.

This completes the tutorial for creating a new SSH key to connect your Mac terminal program to the InMotion Hosting shared server SSH. For best security practices, make sure to keep your key private and don't share the password unless necessary.

 


 

****The "permissions are too open" error is usually caused by the permissions level of the private key you are using.

Instead of 644, they should be set to 500. Here is a link to our guide on How to change file permissions and ownership settings while in SSH

 

Author: parksdesign
Last update: 15-08-2016 01:17


Magento

What is Magento's 2 and 2.1 Directory Structure

I have gone through the directories of Magento 2 and i found that directory structure has changed significantly. It is important to understand these difference between Magento 1.x and Magento 2. In this post i will describe significant changes of directory and file structure.

Root Folder Structure

First let’s compare root folder structure of Magento 1.x and Magento 2. There are major changes applied at root level. Very first thing you will identify is that some new folders are introduced and some of them are removed.

  • media and errors folder are moved to pub folder
  • skin and js folder are moved to pub/static folder. Now it is easy to maintain static content via CDN.
  • js, css, images are again divided into pub/static/adminhtml and pub/static/frontend for backend and frontend area respectively.
  • dev folder contains various tools for developers such as migration tools and tests. shell is moved to dev folder
  • downloader, includes and pkginfo folder are no more with magento 2.
  • setup directory is for installation process
  • get.php, cron.php and index.php files are moved to pub folder.

 

There are 2 index.php files one in Magento root folder and another in pub folder. You can configure your server to run your application through any of this index.php file. Using pub/index.php is a good option as it will stop access of application files and it is good for security.

eav.php

Database connection settings, backend name, session save settings and cache settings are declared in app/etc/env.php

config.php

config.php has list of active and inactive modules

Theme Folder Structure

Magento 2 comes with very drastic changes on the frontend. Significant changes has been apply on theme structure for performance improvements.

As like earlier version magento 1.x base package ‘app/design/frontend/base/’ will no more exists. Each core module in Magento 2 has new folder introduced which is called ‘view’. This ‘view’ folder contains all module specific files like email template, js, layout xmls, phtml for frontend and backend.

Themes are grouped by ‘vendor’ which we known as ‘package’ in magento 1.x. Theme structure in Magento 2 is like ‘app/design/frontend/vendor_name/theme_name’.

 

 

 

Core module

Magento core components are exists in your_magento_web_root/vendor/magento directory.

Module Folder Structure

In Magento 2 app/etc/modules folder is removed and module’s declaration is moved to app/code/Vendor_name/Module_name/etc/module.xml file. Each module has its own registration.php file in its root. This file is for Magento to identify it as a module.

app/code/core, /local, /community folders are removed and module structure becomes like
[root]/app/code/[Namespace]/[Module]

  • Namespace is a name of a module’s vendor
  • Module is a name assigned to a module by its vendor

Next to Controller, Model, Helper, Block, etc Magento 2 has introduced new folders which are:

  • Api
  • i18n – contains module specific translation
  • view – contains module specific layout xmls, phtml

 

 

Author: parksdesign
Last update: 01-12-2016 14:15


HTACCESS

How do you remove multiple slashes in URI HTACCESS

Author: parksdesign
Last update: 01-02-2017 18:51


WordPress

How to Create WordPress Page that redirects to another URL (for google goal taking)

With Wordpress templates, I'm assuming that headers are sent to the browser by WP before your template is even loaded. Because of that, the common redirection method of:

header("Location: new_url");

won't work. Unless there's a way to force sending headers through a template before WP does anything, you'll need to use some Javascript like so:

<script language="javascript" type="text/javascript">
document.location = "new_url";
</script>

Put that in the section and it'll be run when the page loads. This method won't be instant, and it also won't work for people with Javascript disabled.

Now... setup Google traking goal.

Author: parksdesign
Last update: 01-06-2017 14:51