0

Why do we have to install Magento 2 in Magento2 folder. Cannot we install Magento on root. How should i work on the ownership of Magento, if i install Magento 2 on root directory.

PS: If i install my Magento2 (127.0.0.1/Magento2) inside a folder, is it possible to run Magento on 127.0.0.1 instead of 127.0.0.1/magento2

Rama Chandran M
  • 3,210
  • 13
  • 22
  • 38
Mek
  • 91
  • 2
  • 11
  • Yes you can run your magento on 127.0.0.1 but for this you need to setup virtual host on Apache which will be represent 127.0.0.1 to your magento directory. Check this link how to create virtual host : https://in.godaddy.com/help/configure-apache-virtual-hosts-centos-7-17338 – Kumar M Mar 30 '17 at 06:14
  • TY, what about Magento Folder Permissions ? – Mek Mar 30 '17 at 06:16
  • You just need to do one thing 644 permission for all file and 755 for all folders, excluding pub and var. For pub and var you can use 777 or 775 . – Kumar M Mar 30 '17 at 06:20
  • is this independent of the user system, as mentioned in the magento docs. I am using dedicated server. – Mek Mar 30 '17 at 06:31
  • @Mek, You can redirect from 127.0.0.1/magento2 to 127.0.0.1 using .htaccess. Check the below link to change the .htaccess file. http://magento.stackexchange.com/a/148340/45181 – Venu Joginpally Mar 30 '17 at 07:06
  • doesn't .htaccess cause further delay in redirection. how can we set the magento2 folder as the main folder, so that we dont require redirections – Mek Mar 30 '17 at 07:21

1 Answers1

1

You can install magento anywhere you want on the server. The only thing you need to do is to define root folder in apache or nginx configuration so the server would search index.php file in the correct folder. So in order for you to use only 127.0.0.1 without /magento is to change vhost configuration. For nginx you need to set something like

root /var/www/magento2/pub;

For apache something like

DocumentRoot "/var/www/magento2/pub"
Zefiryn
  • 5,888
  • 2
  • 25
  • 34
  • Thanks, i need to just add DocumentRoot "/var/www/magento2/pub" in http.conf, what about the permissions of folder. How do i set them. I am using a dedicated server – Mek Mar 30 '17 at 06:15
  • Just to add to it, magento is running on shared server (very slow) but not working on dedicated – Mek Mar 30 '17 at 09:07