2

I am using magento 2 with multiple websites, need to enable production mode. But it getting error with _custom.less can't able to read my theme package.

Thanks

1

When you are creating multi website in magento2 or further versions, you need to follow some basic points:

1. Di compilation
2. Symlinks for multi websites

assume that you already know how to access your Shell or SSH Access using Terminal (MAC) or Putty software.

Common problems on creating symlinks are usually caused by syntax error on command line-interface, incorrect file patch to the server, and incorrect commands.

If you can see this similar command line when browsing any tutorials via the internet like what you can see below

ln -s ../public_html/app ./app

This is actually an incorrect file path from the server.

ln the command line stands to creating links – files which “point” to other files or directories in the filesystem.

Thus, the command line should look like this

ln -s existingPath pointingtoExistingPath

existingPath literally means that this path or folder is existing and pointingtoExistingPath is the path in which your symlinks or symbolic links will be created.

So to be exact, your symlinks command will look like this

ln -s /home/username/public_html/app /home/username/public_html/Newstore/app Username is usually the username you used when accessing your cPanel Newstore folder and app subfolder will be automatically created when you provide a correct path.

To check if you are accessing the correct path, just type

ln /home/username/public_html/app

and you will get this similar message

“hard link not allowed for directory” Finally we hopefully derived a correct command line/path

ln -s /home/username/public_html/app /home/username/public_html/Newstore/app
ln -s /home/username/public_html/lib /home/username/public_html/Newstore/lib

ln -s /home/username/public_html/pub /home/username/public_html/Newstore/pub
ln -s /home/username/public_html/var /home/username/public_html/Newstore/var

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.