Pengaturan

Gambar

Lainnya

Tentang KASKUS

Pusat Bantuan

Hubungi Kami

KASKUS Plus

© 2024 KASKUS, PT Darta Media Indonesia. All rights reserved

daniel8115Avatar border
TS
daniel8115
Install the server to run the Storefront
There are a lot of methods to configure the server to run the exact store but the two most popular methods:
Method 1: Specific directories for every website use subdomains
  • Demonstrate the domain you want to point to the server.
  • Build a subdomain for your new store.
  • Using either FTP or SSH, copy the .htaccess [size={defaultattr}]and [/size]index.php files from your Magento settings to the document root of your new domain
  • [size={defaultattr}]Choose the [/size]index.php file that you just copied and edit the last lines of the file as below:

Notes: Convert new store to the code that you wrote down when you built the new website atop.
Replace:
Code:
[color=#333333][size=2][font=Menlo, Monaco, Consolas, "courier new", monospace][php]$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);


/** @var \Magento\Framework\App\Http $app */
$app = bootstrap->createApplication('Magento\Framework\App\Http');


$bootstrap->run($app);
[/php][/font][/size][/color]


With:
Code:
[color=#333333][size=2][font=Menlo, Monaco, Consolas, "courier new", monospace][php]require __DIR__ . '/app/bootstrap.php';
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'newstore';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);
[/php][/font][/size][/color]


  • Using SSH, create the represent links in the document root or your new domain and replace the path below with the full path to the document root of your Magento Installation:


Code:
[color=#333333][size=2][font=Menlo, Monaco, Consolas, "courier new", monospace][php]ln -s /home/example/example.com/html/app/ app 
ln -s /home/example/example.com/html/lib/ lib

ln -s /home/example/example.com/html/pub/ pub
ln -s /home/example/example.com/html/var/ var
[/php][/font][/size][/color]


  • When the installation was successful, your new domain will run in your system and you can easily make the changes you want for your store


Method 2: Directories are shared for all stores using pointer domains
Notes: This method is only used for Magento version 1.4.0.1 and higher versions
  • Demonstrate the domain you want to point to the server.
  • Build a server alias pointer domain for your new store. The pointer domain will point to the main domain of your Magento installation.
  • Edit the

  • PHP Code:
    .htaccess 


  • [size={defaultattr}]file in the document root of your Magento settings and type the below just above the line[/size]

  • PHP Code:
    RewriteEngine On 


  • [size={defaultattr}]:[/size]

    • Replace
    • PHP Code:
      .*newstore.* 

    • with the domain name of your new store, keeping the dots and asterisks.
    • Determine that MAGE_RUN_CODE matches the code you wrote down when you built the new website above.
    • PHP Code:
      Newstore 

    • specifies the domain name of your new store, and
    • PHP Code:
      websitecode 

    • identifies the store code generated in Magento




Code:
[color=#333333][size=2][font=Menlo, Monaco, Consolas, "courier new", monospace][php]SetEnvIf Host .*newstore.* MAGE_RUN_CODE=newstore
SetEnvIf Host .*newstore.* MAGE_RUN_TYPE=website or store
[/php][/font][/size][/color]


  • When the installation was successful, your new domain will run in your system and you can easily make the changes you want for your store.

Source: https://www.mageplaza.com/kb/how-con...-frontend.html
0
1.5K
0
GuestAvatar border
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru
GuestAvatar border
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru
Komunitas Pilihan