Installing and configuring Magento multisite on nginx

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome to another econ guru tutorial today we are gonna look at how you gonna install Magento - on nginx with multi-site feature in order to follow this tutorial you're gonna install these software's nginx Asuna webserver PHP 7.3 my skills 5.7 and composer as your dependency manager apart from the above software requirements you will have to install the PHP modules listed here in order to install and run Magento smoothly we let get into the first activity in this tutorial our first activity is to download Magento - so score from Magento repository you can get the download chrome on from Magento dieudo I will share this URL in the description area so I'm gonna copy this composer c'mon and paste it in my text editor so that I can modify before we take secure I'm gonna download community edition so I'm gonna modify this to community edition and also I'm gonna download Magento to 3.4 version and this is the installing PHP so if you wanna download the Magento source code into the same directory you can have dot here but I'm gonna download it to a new directory called we're all good I'm gonna copy this and go to the terminal I'm gonna navigate to the budget directory see the sides and create a new directory for our new project I'm gonna name it as in two three four okay it is created I'm gonna inside that directory and run the copied composer command here so it will ask you the username and password for Magento repository for that I'm gonna get it from Magento website page enter calm and I have to login I already have logged into the Magento so I'm going to marketplace and then get to my profile from here you can and I get to my profile and you you will get accessories from here so this public key is a username copy it and paste it here the pass the private key is the password and paste it here and it will asks you whether you want to save the credential locally yes it will take some time to download the Magento source code I'm gonna post this video until the download is complete now the source code download has been done so let's move to the next section which is setting the proper file permission in order to install Magento properly you should have to set by permission to the directories listed here in a ATC directory there will be two files generated during the installation process which is en dot PHP which store the local variables like database credentials etc and another file called conflict of PHP which will be storing the module configuration data and in pub steady directory bar directly there will be some auto-generated stored so you will have to shape pipe function for that one SL and also in generator directory it will be storing generated PHP files so you'll have to save right function to all the four directories listed here it will do by the command listed here so I'm gonna copy those commands from Magento do doc which is here and those commands I should navigate to the full directory first and from the command one by one well now we need a MySQL database instance in order to install Magento so I'm going to create it by looking here running this command to create my Skrill database so database has been created I'm exiting from the nice console let's actually you have sample nginx configuration file in Magento default source code so we can open this n9 phpstorm which is my favorite code editor here inside whole directory you can see that sample int index configuration file is here so if you look at line from 8 to 14 here is the sample base nginx configuration file so I'm going to copy this content and navigate to nginx directory CD et Cie in the next sites available so I'm going to create new configuration file for our new website which will be named as M 2 3 4 and I'm gonna paste the copied content here and I will remove the comments I'm gonna modify the main road directory for that I'm gonna open another tab here and navigate into the Magento installation directory CD sides and I'm going to copy this made into rotary art so that I can pass it here directly until next configuration file sample also in the same directory so I'm gonna paste it here as well and set the server name to like do them two three four calm and then we are fine to close it now we need to enable this configuration file we just created in order to do that I am executing this command and then actually it has to be executed with sudo privilege Ln minus s PTC nginx size available in two three four in to et Cie nginx sites enabled it enter so if you go to the if you navigate to the sites enable directory you will see this has been linked let me navigate to the sides and able directly from inland come on you see the new configuration file has been linked here so my next step is to add cost entry into my hosts file for that I'm gonna open first file with sudo privilege in be I am etc' hosts and I'm gonna add new entry for new website one two so on one if the local host the URL will be du dot M two three four close this with saving now all the configurations are done so we need to restart nginx server in order to apply these changes so I'm gonna execute this command with sudo privilege PTC unit D index they stop yes most indicators and it has been restarted properly so at this point we should be able to load the website with the domain name we have configured on browser so I'm gonna open the browser and type my URL so yeah you can see the installation page here which is correct so you can proceed with the installation next few steps of installation with this browser configuration but I am not preferred that I I what I prefer is running the installation through command line so I'm going to do it via command line if I move to the next step actually I have forgot to mention one thing PHP runtime also have to configure on nginx configuration file but if you go to the default configuration my default configuration you will see that PHP runtime has been configured in default file so there is no need for me to configure the same in my nginx configuration let's move to the installation part actually this is the installing Magento installing command which you can see in the book page yeah this is the command so I'm gonna copy installing come on to here and modify it according to my requirement my base URL will be HTTP do dot M 2 3 4 comm DB host will be the localhost which is this URL and DB name which I was created few minutes ago is M 2 3 4 and DB username I'm gonna mention my DB username here and the password [Music] and I'm gonna leave the other parts as defaults and had been email you can modify these according to your comments and I'm gonna copy this command and navigate to the forget directory CD actually and execute in the command from here seem so all good I'm hitting Enter yes it starts to install Magento so it contains actually 985 us so it'll take some time to complete all the 905 all good we have installed Megan toe to on nginx so you can see the website on browser now if you go to the URL where the installation process is complete so you can see the default Magento homepage here now I'm gonna walk you through some important facts in divor Magento installation let me open up the presentation again and the deploy mode the default deploy mode will be default one and that is not recommend that for production of develop develop one n91 in order to develop an environment optimize you will have to set it to developer mode you can do it by executing the be come on in come online so I'm gonna navigate to come online and actually you can see all the available magic Magento console commands in default Magento installation by hon we imagine to come on it exists all the console commands which you can run income online so you can see the deployed mode command here so you can run this command to see what is the current deployment with this command so it has been saved to default what I'm going to do is I'm setting it to developer mode by this command set so developer mode is enabled and if I mention some of the important Magento console commands which you will be used frequently in your development the set up install command which you which we have planned a few minutes ago the setup upgrade come on set up da compile one we should be compiling your core and set up static content deploy command which will deploy the static content and also one thing I should mention there are some short codes which you can use for the console commands like if you need to fund set up upgrade come on you can use s : up come on let me show you by practical been make into this column of we execute setup update comma like this likewise you can use this short commands if you need and in our next section we are going to install sample data into a newly installed Magisto instance for that I'm gonna run this command bean Magento sample data deploy and also for this semester we need to provide the username and password for the Magento repository so I'm gonna copy it from here and paste it so it will download again the media files and required other data files for some setting up sample data on your Magento instance so I'm gonna pause this video until those assets are downloaded from Magento repository now those effects are downloaded and those downloaded as you can see as modules here so in order to activate an execute the data scripts inside those modules we have to run setup update command again so for that I'm executing this command this command and then it will install all the data which we have downloaded a few minutes ago once the setup upgrade command has been completed I'm going to fund cash busca one since I don't want to see the old cached data once this some changes has been done okay I'm gonna reload this page here you go mister we can see that the sample did has been installed this menu has been Auto populated with the category you know imported with sample data and these sections are filled with static content which you have imported sample data and these are the products you can go into a product and see the product pages so that's it the story in sample data let's get into the configuring multi-site now configuring my site actually can be done based on website or the stock and also it can be like in sub domain model and subdirectory model so if you are storing in something for the motor model it will be the URL will be like HTTP which is our base URL and the stokehole like let's say I was talk about this one it will be like this if it is sub domain model it will be like it's deeply HTTP colon slash this can be any domain actually this can be totally new domain or subdomain of T son I'm going to have new domain like - likewise you can have in two different ways of URLs when you have multi websites in Magento so let me consider two stores in Magento in order to do that I'm going to login into the Magento admin do in two three four slash admin which is so back in URL which I was given in installation process here this the admin URL back in funk name so I loaded the login page I'm gonna do the username and password which I have given in installation process here the username is admin and password I was given is admin one two three so it will load the Magento back in from here in this step I will create one new website one new store and one new stove you when you load the Magento admin let me go to create a new website in in stores all stores you can see all the available in stores websites and strawbe use so I'm going to create new website and new store and new whips stop you for our tutorial I'm going to hit on create a new website and I'm going to name it as wave 2 and website code will be with two and so will be one I'm gonna see you this and next step I'm gonna create store I'm going to create a new store from here and it will be on the web - and I'm going to name it like so - and stow code will be - - and the category category I'm gonna select same category as DD photon and I'm gonna show you this and my next step is to create a new stove you for this new store so click on this tree stove you and it is it should be under store - so name it - and the and I'm gonna enable it and mention so that is one which can be any any integer value here and I'm going to show you the newest of you will take few seconds to set up all the stove you configuration and save it so we have done it I'm gonna set up the URLs for this newest website so for that I'm gonna go navigate to the configuration and select beep and you can see the URLs here in base URL section and base URL Security section so these are the default URLs I'm going to change the scope to be two and change my URL to URL and I'm going to copy this paste it here and also I'm using the same URL as secure one as I you don't have setup it's I mean I'm gonna show you this so those changes can be verified in database if you navigate login to the MySQL database I'm gonna use the created database I'm booty-ful and I'm gonna run this come on silly from config data we are like oh this is the base you are it differ for the default website and these are the four URLs we just saved unsecured miss you are unsecured please link URL for website scope so that's it and we have to configure this URL in new nginx configuration in order to load this new website with this URL for that in this step you will have to mention the maids run code which is we used to create the website in in this step like if you go to stores and all stores I'm going to open this website with two and copy this code actually let me I know fair and open our nginx configuration file which is in pseudo sites available in two three four I'm going to post paste the copied copied content here and I'm gonna change my which was M two three four with two I'm gonna pop you my root directory URL from here paste it here and also based it yeah then I'm gonna copy the website code from here and paste it here so antenna configuration has been done I'm gonna save this and close now in order to apply the changes we have made to the engine X configuration file I'm going to register in Teaneck server and our next step is to add this newly created URL into a post file so that I am going to open up because file and then add new URL here in 2 3 4 we comb and I'm going to show you this actually we have one more step to follow for multi-site configuration let me show you that we have to include these 2 lines in our nginx configuration sample file which is in Meghan to document let me copy it from here and open up the antenna configuration sample and you have to find dig section which is the main PHP entry point for the application and you have to input those lines before including the fast CJ params I'm going to put it here and see you made Sun type I have configured made arm type as website and made some code transmits uncor variable which I have configured in main engine X configuration file yeah I have said the matron code which I have used to create the website and might end up in this song and I have edit this two lines so I need to restart engine next server in order to apply the changes I'm gonna register nginx Indian X has been restarted so we should be able to see the new have cilantro so now I'm gonna lot out a website in [Music] yes it looks the same as the default on since we have not configured new index file or the new team but you are the remaining cells M - chief / - it's a step we have configured multi-site you can also see for website in DM two three four so we have two website pointed to the same Magento instance if you have more than one fans so they can use this multi-site feature in order to set those different storefronts like for children playing are you website and Tommy dot-com those two vans belongs to one vendor so they have been to different store funds on same magenta instance and also if you have two different shops for same time then also you can have two different store files like in hna if you go to th direction calm and ID dot hsn.com both of them have same magenta stuffs but to difference no funds so that is about installing Magento multi site on nginx thank you for watching this tutorial keep in touch with us to see more tutorials like this if you still haven't subscribed to my channel please hit on subscribe button to get updates by emails thank you
Info
Channel: Ecom Guru
Views: 1,750
Rating: undefined out of 5
Keywords:
Id: vAvM6Rmupw4
Channel Id: undefined
Length: 38min 36sec (2316 seconds)
Published: Thu Apr 16 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.