Dieses Blog durchsuchen

Samstag, 2. Juli 2016

Install magento via commandline on a linux machine

1) Install composer on your machine


at the moment you have to have installed php 7.0.2 minumum
if you do not have a lamp stack installed, follow this very good guide
https://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-on-ubuntu-16-04-lamp/

add a mysql user with needed rights
GRANT ALL on *.* to 'peter'@'localhost' identified by 'yoursecretpassword';


install needed php extensions
apt-get install php7.0-gd php7.0-xml php7.0-mcrypt php7.0-curl php7.0-intl php7.0-mbstring php7.0-zip php7.0-mysql

 
get composer
follow https://getcomposer.org/download/

Create project with composer
2)composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /var/www/html/magento2

this downloads and installs magento2 under /var/www/magento2

Username / Password repo.magnto.com
during the installation your are ask for username and password to repo.magento.org

You have to create an account on https://marketplace.magento.com and create access keys.
After you have created private and public key, you have to use the public key as username and the privatekey as the password


make cli executable
cd /var/www/magento2 && chmod +x bin/magento

Database
create a database named magento2

navigate to installdir
cd /var/www/magento2

set accessrights (all for the first time)
chmod -R 777 *

execute installcommand
bin/magento setup:install --base-url=http://magento2.localhost/pub/ --language=en_US --backend-frontname=admin --db-host=localhost --db-name=magento2 --db-user=root --db-password=DBPASSWORD --admin-email=max@mustermann.de --admin-user=youradmin --admin-password=PASSWORD --admin-firstname=Max --admin-lastname=Mustermann

add sampledata and activate additional modules
bin/magento sampledata:deploy 
bin/magento setup:upgrade

you will be asked for username and password again. user your pubkey as username and private key as password 

enable devoloper-mode to see all php problems and get more information during runtime
bin/magento deploy:mode:set developer

deploy static content, otherwise styles are missing
bin/magento setup:static-content:deploy 


add domain to your /etc/hosts
nano etc/hosts
127.0.0.1 magento2-shop.local 

add apache-vhost entry to your installation
keep sure, you link into the pubditectory, otherwise the css files arent found


<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName magento2.localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/magento2_webroot/pub
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/html/heroku">
AllowOverride All
</Directory>
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
view raw vhost hosted with ❤ by GitHub




this article is based on:
http://alanstorm.com/magento-2-frontend-files-serving

and 

https://www.integer-net.de/magento-2-installation/





Keine Kommentare:

Kommentar veröffentlichen