Menu

Setting up a Magento VM (maintenance purpose)

31. juli 2015 - Linux, Notater, Web

A client recently asked me to move their Magento to another host. A problem arise since the new host do not provide shell access thus maintaining Magento patches became an issue.

I found and forked this from
Credit where credit is due.
https://www.nerdoncoffee.com/uncategorized/setting-up-a-magento-vm-and-allowing-remote-access/

Grab the VMDK from here

https://bitnami.com/stack/magento/virtual-machine

As I don’t really care about this little vm (its just for dev purposes) I threw it in the DMZ zone (make sure it has a static IP – I just did a dhcp reservation and set the mac of the vnic)

ServerName magento.example.com

ServerAlias www.magento.example.com

DocumentRoot “/opt/bitnami/apps/magento/htdocs”

#

Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”

#
ServerName magento.nerdoncoffee.com
ServerAlias magento.nerdoncoffee.com www.magento.nerdoncoffee.com
DocumentRoot “/opt/bitnami/apps/magento/htdocs”
Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”

#

ServerName magento.example.com

ServerAlias www.magento.example.com

DocumentRoot “/opt/bitnami/apps/magento/htdocs”

SSLEngine on

SSLCertificateFile “/opt/bitnami/apps/magento/conf/certs/server.crt”

SSLCertificateKeyFile “/opt/bitnami/apps/magento/conf/certs/server.key”

#

Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”

#

ServerName magento.nerdoncoffee.com
ServerAlias magento.nerdoncoffee.com www.magento.nerdoncoffee.com
DocumentRoot “/opt/bitnami/apps/magento/htdocs”
SSLEngine on
SSLCertificateFile “/opt/bitnami/apps/magento/conf/certs/server.crt”
SSLCertificateKeyFile “/opt/bitnami/apps/magento/conf/certs/server.key”

Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”
[/text] OR
[text] ServerName magento.nerdoncoffee.com
ServerAlias magento.nerdoncoffee.com
DocumentRoot “/opt/bitnami/apps/magento/htdocs”
Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”

#

ServerName magento.example.com

ServerAlias www.magento.example.com

DocumentRoot “/opt/bitnami/apps/magento/htdocs”

SSLEngine on

SSLCertificateFile “/opt/bitnami/apps/magento/conf/certs/server.crt”

SSLCertificateKeyFile “/opt/bitnami/apps/magento/conf/certs/server.key”

#

Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”

#
ServerName magento.nerdoncoffee.com
ServerAlias magento.nerdoncoffee.com
DocumentRoot “/opt/bitnami/apps/magento/htdocs”
SSLEngine on
SSLCertificateFile “/opt/bitnami/apps/magento/conf/certs/server.crt”
SSLCertificateKeyFile “/opt/bitnami/apps/magento/conf/certs/server.key”

Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”
[/text]

nano /opt/bitnami/apps/magento/conf/htaccess.conf

at the bottom in the directories node

[text] SetEnvIf Host www.magento.nerdoncoffee.com MAGE_RUN_CODE=magento.nerdoncoffee.com
SetEnvIf Host www.magento.nerdoncoffee.com MAGE_RUN_TYPE=website
SetEnvIf Host ^magento.nerdoncoffee.com MAGE_RUN_CODE=magento.nerdoncoffee.com
SetEnvIf Host ^magento.nerdoncoffee.com MAGE_RUN_TYPE=website
[/text] Now uncomment the following file in /opt/bitnami/apps/magento/conf/htaccess.conf
[text]

you can put here your magento root folder

path relative to web root

RewriteBase /magento/
[/text] Restart apache in your vm

sudo /opt/bitnami/ctlscript.sh restart apache

References
* https://bitnami.com/stack/magento/virtual-machine
* https://wiki.archlinux.org/index.php/Bridge_with_netctl
* https://wiki.bitnami.com/Virtual_Appliances_Quick_Start_Guide
* https://wiki.bitnami.com/Virtual_Appliances_Quick_Start_Guide#How_to_enable_sshd.3f