Monday 1 October 2012

Magento Development: Magento Setup with Secure Shell (SSH):



Magento Development is increasing by leaps and bounds. With a view to develop an elegant ecommerce store, Magento is most popular.

In this article, we will know how to install the most recent Magento versions using the code via SSH. This will also include the process of Magento installation with or without specimen data.

Here, we will discuss Magento installation with or without sample information in the main directory or sub directory. The main directory refers to what appears right away while accessing the domain. By default, magento is installed in the sub directory.

With SSH, Magento Setup can be quick and simple. It works best when used to frame up an entire store with sample facts and figures. This type of establishment requires 40MB of data to be downloaded and then re upload to the website. SSH provides the benefit of connecting to the server to capture the files.

Below mentioned are some of the ways to download Magento with SSH:

Magento Setup in the Web Directory (Document root):
1.  wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz
2.  tar -zxvf magento-1.7.0.2.tar.gz
3.  mv magento/* magento/.htaccess .
4.  chmod -R o+w media var
5.  chmod o+w app/etc

Along with the setup, we have to delete the downloaded file and empty the directory from the extracted files:

rm -rf magento/ magento-1.7.0.2.tar.gz

After applying this SSH Code, the web based installation process is to be followed.

Using Pear Downloader to install Magento in the Website Document Root:-

To ease the Magento Development process and with a view to get the latest Magento version installed conveniently, Pear Downloader is the best option. It has an intelligible mechanism to download recent magento versions. Being a minor download, it is updated less frequently as compared to the complete magento package.

Magento Setup in sub directory:

It’s very easy, just replace the current “subdirectory “twice with the name of the subdirectory in which Magento is to be installed.

1.  mkdir SUBDIRECTORY
2.  cd SUBDIRECTORY
3.  wget http://www.magentocommerce.com/downloads/assets/1.7.0.0/magento-downloader-1.7.0.0.tar.gz
4.  tar -zxvf magento-downloader-1.7.0.0.tar.gz
5.  rm -rf magento-downloader-1.7.0.0.tar.gz
 
Magento Setup with Sample Data:
 Installing Magento with Sample data is beneficial to the business owners who wish to get accustomed with Magento and know how products and categories are setup in the store.

Again, here it can be established either in root directory or sub directory:

Magento Setup in Main Directory: 

It is very similar to installing magento without data in subdirectory as mentioned above.  Here, directory name is not required to be known. The things that are to be replaced are: DBHOST, DBNAME, DBUSER and DBPASS.

1.  wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz
2.  tar -zxvf magento-1.7.0.2.tar.gz
3.  wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
4.  tar -zxvf magento-sample-data-1.6.1.0.tar.gz
5.  mv magento-sample-data-1.6.1.0/media/* magento/media/
6.  mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql magento/data.sql
7.  mv magento/* magento/.htaccess* .
8.  chmod -R o+w media var
9.  mysql -h DBHOST -u DBUSER -pDBPASS DBNAME < data.sql
10. chmod o+w var var/.htaccess app/etc
11. rm -rf magento/ magento-sample-data-1.6.1.0/ magento-1.7.0.2.tar.gz magento-sample-data-1.6.1.0.tar.gz data.sql

Magento Setup in Sub directory:
Five main points are to be kept in mind before carrying out this process. These are as follows:
·         Name of Subdirectory in which Magento installation is to be done.
·         Hostname of Database, for which local host works.
·         Database name which is to be used by magento.
·         Username which has access to the database.
·         Password of the User.

After getting this information, it is to be copied and replaced with the information in the commands.

In other words, we can say the subdirectory, where Magento is to be setup will be replaced twice as above and also DBHOST, DBNAME, DBUSER and DBPASS are changed.

1.  mkdir SUBDIRECTORY
2.  cd SUBDIRECTORY
3.  wget http://www.magentocommerce.com/downloads/assets/1.7.0.0/magento-downloader-1.7.0.0.tar.gz
4.  wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
5.  tar -zxvf magento-downloader-1.7.0.0.tar.gz
6.  tar -zxvf magento-sample-data-1.6.1.0.tar.gz
7.  mv magento-sample-data-1.6.1.0/media/* magento/media/
8.  mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql magento/data.sql
9.  mv magento/* magento/.htaccess .
10. chmod -R o+w media
11. mysql -h DBHOST -u DBUSER -pDBPASS DBNAME < data.sql
12. ./pear mage-setup .
13. ./pear install magento-core/Mage_All_Latest-stable
14. touch var/.htaccess | mkdir app/etc
15. chmod o+w var var/.htaccess app/etc
16. rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
17. rm -rf magento/ magento-sample-data-1.6.1.0/
18. rm -rf magento-downloader-1.7.0.0.tar.gz magento-sample-data-1.6.1.0.tar.gz data.sql

Finishing the Installation via Web Based Installer:
Once the Magento installation via SSH is completed, the business owners can proceed with web based installer. All database details will remain same in that as well.

This work can also be carried out using Command Line Interface (CLI) instead.
Alternatively, SSH script can also be used to automate both the main steps as well as CLI installer.

Trouble Shooting:

Magento Development is not a child’s play. To sort out the issues faced while installing magento, certain recommendations can be followed which are as follows:

·         Incorrect or Insufficient Permissions:
If any problem persists due to incorrect permissions then it can be sort out using the below mentioned commands:

1.  find. -type f -exec chmod 644 {} ;
2.  find. -type d -exec chmod 755 {} ;

Using this command will provide 644 permissions to files and 755 permissions to the directories.
·         URL not available :
If any error message is received stating the unavailability of URL, then it can be solved as following:
1.  ./pear mage-setup .
2.  ./pear install magento-core/Mage_All_Latest-stable
After making these changes, Magento can be upgraded to the latest version via web based installer.

·         404 Error on Specimen Products:
While selecting any product on main page, if it shows “error 404 page not found”, then it can be solved as follows:

·         To solve this error, the user has to login in the backend system of magento and go to:
System -> Cache Management
Another way is to click on the “Refresh Button” in the catalogue section. This will fix the URL structure for the categories as well as the products.

·         Magento Connection Download from Archived section:

For some reasons, if you wish to download the archived extension, it can be done as follows:

TYPE” must be replaced with real extension type, EXTENSION_NAME with real extension name and X.X.X. must be replaced with real version number.
To know the real type and real machine Extension name, check the extension key and consider its format Magento Type/ Extension Name.

Zesttech Solutions provides all the sort of the magento installation methods including the above mentioned ones. Get the best of Magento Services, from an expert Magento Development Company, London, UK.

No comments:

Post a Comment