Pages

Showing posts with label Installation. Show all posts
Showing posts with label Installation. Show all posts

Sunday, November 30, 2014

Installing Magento 1.9.1 on Bitnami Nginx Stack

First download the Bitnami Nginx Stack Magento.
Install the Bitnami Stack where you like, called by me root_nginx_stack.

After installation copy the demo project to the apps folder and remove htdocs folder
  1. cd root_nginx_stack
    cp -r docs/demo/ apps/magento
    rm -rf apps/magento/htdocs
    unzip magento-1.9.1.0.zip
    mv magento root_nginx_stack/magento/apps/htdocs
  2. change in root_nginx_stack/magento/*.conf all reference 'demo' to 'magento'
  3. in root_nginx_stack/nginx/conf/bitnami/bitnami-apps-prefix.conf add the line
    include "root_nginx_stack/apps/magento/conf/nginx-prefix.conf";
  4. in root_nginx_stack/magento/nginx-vhosts.conf add the lines below before the include directive
    
        location / {
            index index.html index.php; ## Allow a static html file to be shown first
            try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
            expires 30d; ## Assume all files are cachable
        }
        
        location @handler { ## Magento uses a common front handler
            rewrite / /index.php;
        }
    
  5. in root_nginx_stack/magento/nginx-app.conf replace the location part with the lines below and set your root_nginx_stack path.
    location ~ \.php$ {
        if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
    
        expires        off; ## Do not cache dynamic content
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_read_timeout 300;
        fastcgi_pass unix:/root_nginx_stack/php/var/run/www.sock;
        fastcgi_index index.php;
        fastcgi_param  SCRIPT_FILENAME $request_filename;
        include fastcgi_params;
    }
    
        ## These locations would be hidden by .htaccess normally
        location ^~ /magento/app/                { deny all; }
        location ^~ /magento/includes/           { deny all; }
        location ^~ /magento/lib/                { deny all; }
        location ^~ /magento/media/downloadable/ { deny all; }
        location ^~ /magento/pkginfo/            { deny all; }
        location ^~ /magento/report/config.xml   { deny all; }
        location ^~ /magento/var/                { deny all; }
    
        location /magento/var/export/ { ## Allow admins only to view export folder
            auth_basic           "Restricted"; ## Message shown in login window
            auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
            autoindex            on;
        }
    
        location  /magento. { ## Disable .htaccess and other hidden files
            return 404;
        }
    
    
        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
            rewrite ^(.*.php)/ $1 last;
        }
    
  6. create a database for your magento installation:
    /root_nginx_stack/mysql/bin/mysql -uroot -p
    ...
    create database bitnami_magento;
    grant all privileges on bitnami_magento.* to 'bn_magento'@'localhost' identified by 'MAGENTO_PASSWORD';
    
  7. restart nginx and type in your browser: http://localhost:8080/magento/index.php
    your magento installation starts now!
I got the references for this config from Bitnami Wiki and Magento Wiki.
It's not production ready but helps as a starting point.

Saturday, July 12, 2014

How to download extensions from Magento Connect manually

Usually you need to install at some point extensions for your Magento shop.
Best practice is to install it manually. That's to keep control and check, whether the extension is ok without breaking your shop installation. There are two ways to do it.

Either you go to freegento.com/ddl-magento-extension.php and enter the extension key from Magento Connect. As result, you get a download link for your module.


Or you use mage, a shell provided by Magento.
Got to the root of your test store

orion:~ user$ cd /Users/user/dev/magento/latest


If you use it the first time, you need to adapt the permissions

orion:~ user$ chmod 550 mage
orion:~ user$ ./mage

Connect commands available:
===========================
channel-add          Add a Channel       
channel-alias        Specify an alias to a channel name
channel-delete       Remove a Channel From the List
channel-info         Retrieve Information on a Channel
channel-login        Connects and authenticates to remote channel server
channel-logout       Logs out from the remote channel server
clear-cache          Clear Web Services Cache
config-get           Show One Setting    
config-help          Show Information About Setting
config-set           Change Setting      
config-show          Show All Settings   
convert              Convert old magento PEAR package to new format
download             Download Package    
info                 Display information about a package
install              Install Package     
install-file         Install Package Archive File
list-available       List Available Packages
list-channels        List Available Channels
list-files           List Files In Installed Package
list-installed       List Installed Packages In The Default Channel
list-upgrades        List Available Upgrades
package              Build Package       
package-dependencies Show package dependencies
package-prepare      Show installation information of package
sync                 Synchronize Manually Installed Packages
sync-pear            Synchronize already Installed Packages by pear
uninstall            Un-install Package  
upgrade              Upgrade Package     
upgrade-all          Upgrade All Packages
If you get the command list above, everything works as it should.
Now you can download your extension, like

orion:~ user$ ./mage install http://connect20.magentocommerce.com/community extension_name