Monday, July 20, 2009

Putty BASH commands

I found that while trying to install a copy of Magento the files would corrupt and due to the size timeout all the time, so I uploaded the tar.gz file to the server and used the following to extract the files.

Note: Make sure that the tar.gz file is above the level where the store is to be located, i.e. dropping it into the root folder will mean that the store files will be located at /magento until you pull some strings to get the webserver to point at that folder (therefore bringing the store-front to be the root, but I don't even know if this is possible!?) It would be nice if they supplied the tar.gz file with all the files at the top level and not in a "magento" folder but perhaps there is a limitation.

So, log into your SSH program, I use Putty, and get through to the folder that contains the tar.gz file:
cd /www/vhtdocs/folder/folder/

Then you need to decompress the file:
tar -xvzf magento.tar.gz

If it throws a load of errors up try changing the write permissions of the folder you are in with something like:
cd ..
chmod 777 folder
cd folder
And try again... in Putty you can just push the up arrow a few times to get the unzip script back.

If it works you can then install Magento by going to your website /magento, but this will be your store URL so change this now if you want something different (unless you installed to ROOT) for this I just used FTP.

There are a few files anf folders that need write permissions so just navigate arround using "cd .." to go up a level and "cd foldername" to go into folders, but remember you chmod the folder from the folder above - don't try and use "cd foldername1" and "chmod foldername1" because you are trying to alter a folder that you are in (imagine painting a box while sitting in it, difficult, but probably possible).

I store these more as notes to myself, but I hope that this helps you achieve things faster.

No comments: