Installing Magento 1 on Hypernode
Do you want to install Magento 2? Installing Magento 2 on Hypernode can be done by following the steps in the article: Installing Magento 2 on Hypernode
Table of contents
- 1 Standard Magento install on every new Hypernode
- 2 Installing Magento 1
Standard Magento install on every new Hypernode
With a new Hypernode comes a standard Magento installation. The default Magento installation is located in the /data/web/public directory. It is configured to use a database named YOURAPPNAME_preinstalled_magento and database credentials from the ~/.my.cnf file. The Magento admin and database credentials will be e-mailed to you when your Hypernode is ready.
We use the tool Magerun to perform the installation. By default, Magerun installs Magento using settings (such as admin details, currency, timezone…) from a ~/.n98-magerun.yaml file. We created this file using information from the domain owner. Also, the base urls have been set to “http://YOURAPPNAME.hypernode.io”, and Redis has been configured as a cache backend. Although not all Magento versions can be downloaded through Magerun, our installation uses the highest Magento-CE version available. We did our best to ensure this installation gets all green lights in our Monitor and new MageReport tool, for example, by hiding the admin access page behind a custom URL.
Optional: Uninstall the default Magento installation
With a new Hypernode comes a standard Magento install. The default Magento installation is located in the /data/web/public directory. In order to uninstall this default Magento installation, run the following command:
n98-magerun --root-dir=/data/web/public uninstall --installationFolder=/data/web/public --force
This will delete the default database (YOURAPPNAME_preinstalled_magento), and recursively delete the /data/web/public directory. Any instances of Magento installed in other directories will not be touched.
More information can be found on our article about deleting your magento installation.
Installing Magento 1
Create a new database
The first step should be to create a database. Luckily there is a file where most of the database credentials are already stored: .my.cnf. You connect to your database with the following command:
Create a database by using the next command:
create database DATABASENAME;
After this you exit mysql, write down your database name or add it to the .my.cnf (located in /data/web/) file. Just make sure you can use it later.
Installing Magento with n98-magerun
- To install the latest Magento you’ll have to go to your public(cd public) folder. Use the following command to install Magento through n98-magerun:
php -d memory_limit=1024M /usr/local/bin/n98-magerun install --magentoVersionByName=byte-mag-mirror-latest
- Choose which version you wish to install. The first option  is the most recent version * of Magento. Press “Enter”.
- Insert the installation folder and press ENTER. Magento will now download the files of the installation.
- Enter your database credentials:
- database host
- database username
- database password
- database name
- database port
- table prefix
- Press “y” or “n” if you want to install sample data. If you told the script you’d like to have some sample data, better grab a cup of coffee or tea. This might take a while 😉
- You’re asked to fill in some information to finish the installation. You have to submit the following information:
- session save
- admin frontname
- default currency code
- locale code
- admin username
- admin password
- admin’s firstname
- admin’s lastname
- admin’s email
- base url
- After this, the script will install Magento for you.
- When the installation is complete, you’re asked if you want to write the base-url to your .htaccess file, Press “n” and the script will reindex all data in your shop.
- The installation is complete. You’re presented with all the checks the script did to ensure Magento was successfully installed on your Hypernode.
NB:If our magerun version doesn’t support the latest version of Magento, you’ll have to install the latest dev version of magerun and use this to install Magento. You use the following commands to get the latest version of magerun and install Magento:
wget https://raw.githubusercontent.com/netz98/n98-magerun/develop/n98-magerun.phar -O ~/magerun chmod +x ~/magerun ~/magerun install
Move the Magento files to the right folder
If you followed this guide, your magento files are now located in /data/web/public/magento . Move these files to the /data/web/public folder and delete the magento folder after this. You can use the following commands to do this:
cd public/magento mv * .. mv .htaccess .. mv .htaccess.sample .. cd .. rm -rf magento rm -rf index.html
Your shop will now be visible through your Hypernode URL.
NB: Nginx doesn’t support .htaccess files but Magento needs them to work properly. That’s why we don’t delete the .htaccess files 😉
Optional: Change your base-url
If for some reason you change your mind about which base-url Magento should listen to, you can use the following commands to change the base-url settings:
n98-magerun config:set web/unsecure/base_url URL n98-magerun config:set web/secure/base_url URL
NB: Change URL to the url you want Magento to listen on. In case you want to use your appname as a base-url (when you’re still testing) use http://domein.hypernode.io .
Configure Redis as Cache Backend
Follow the steps mentioned in article Configure Redis to configure Redis as your cache backend.
Optional: configure Lesti::FPC
If you’d like to use Lesti::FPC on Hypernode, please follow the steps mentioned in article Configure Lesti::FPC .