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.
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.
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).