skip to Main Content

I am new to Magento 2 and was using composer to install it. Have already cloned the repo from Magento GitHub account.

One thing I couldn’t find information about was when installing Magento 2 on localhost do I need to place it under this docroot /var/www/magento2 or can it live outside this folder structure? Fro example just under magento2?

6

Answers


  1. You can place it anywhere on your system just update the Apache HTTP server configuration accordingly. The default docroot is /var/www/html or /srv/www/htdocs depending upon your os distribution. And update the apache config file. For example for ubuntu

    @@ -219,3 +219,7 @@
    IncludeOptional sites-enabled/*.conf
    
     # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    +ServerName localhost
    +<Directory "/var/www/html">
    +AllowOverride  All
    +</Directory>
    
    Login or Signup to reply.
  2. If you’re using Apache2, don’t change any setting and try to move the folder magento2 in /var/www/html/public_html/.

    Then, in your browser, go to localhost/public_html/magento2

    Login or Signup to reply.
  3. Depends wich folder you use to guide your domain. If you use mamp,wamp the easiest way is to directly put it in de www folder and unzip. Check you php versions and myql.

    Login or Signup to reply.
  4. Typical setups are /var/www/html. This is dependent upon your vhost files, PHP and MySql setups.

    Login or Signup to reply.
    1. When you are using the Apache Server the document root was default set to /var/www/html
    2. When you are using the Xampp server the document root default is /opt/lampp/htdocs

    After coming in the current directory run the composer command to install the magento :

     composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition:<version> <install-directory-name>
    

    After successful installation you can browse the url to open magento :

    localhost/<install-directory-name>/
    

    install-directory-name its may be magento2 or any other else.

    Login or Signup to reply.
  5. Actually it really depends on your server configuration (Apache, Nginx).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search