I install Magento 2.4.2 but I have got 404 page not found, please give any suggestions for run M2.4.2 without a virtual host because I want to work on multiple Magento at a time so the virtual host is not suitable for me.
-
Are you using apache ? It will took max 10 min to create virtual host! Also You can create Single virtual host and run multiple magento inside main host folder!– PawanAug 13, 2021 at 4:32
-
Refer :rohanhapani.com/…– Rohan HapaniAug 13, 2021 at 4:34
-
@Pawan but I don't want to make virtualhost– Rutvik MonparaAug 13, 2021 at 4:51
-
@RohanHapani I won't solution without creating a virtual host– Rutvik MonparaAug 13, 2021 at 4:54
3 Answers
Yes, you can run Magento without virtual host. for this follow these steps
- keep your magento root directory inside /var/www/html like this /var/www/html/your_magento_directory
- then inside core_config_data define your url as localhost/your_magento_directory/pub OR 127.0.0.1/your_magento_directory/pub
- then go to your browser and write same path like http://localhost/your_magento_directory/pub
Now check your Magento is running successfully.
Note: in older versions of Magento you don't need to hit pub folder just give path till Magento root directory and you Magento will be working fine. because in older version index.php file is in root directory and in later versions index.php file is inside pub folder.
Try https://github.com/davidalger/warden. You run Magento as a docker instance.
-
I am currently using a Linux system so I don't want to use docker. Aug 13, 2021 at 6:52
You can try this suggestion and install magento instances installed in subfolders. This solution suggestion refers to usage of Apache webserver, I am not sure if it will fit your purpose (if you use nginx, for example).