Install on localhost (laptop) using vhost?

I am trying to get the “Basic” template running (used composer) under /var/www/html/basic-yii using a virtualhost. Can someone point me to a sample config under /etc/apache2/sites-available that will allow me to use basic-yii.localhost to make this work?

Thanks in advance.
J

What operating system are you using? if you are on windows or mac i recommend xampp

if you are on linux apache2 with php8

I am on Linux using apache2 with php 7.4

you should test if you run apache2 from the browser → localhost

I tried this just now.

  1. Make a copy of 000-default.conf e.g. yii.conf
  2. Change like this
	ServerName basic-yii.localhost
...
	DocumentRoot /var/www/html/basic-yii/web
...
	<Directory /var/www/html/basic-yii/web>
  1. From a command line enter: sudo a2ensite yii
1 Like

Thanks for the reply. Ok think I got it configured and working.