Import apache virtual host to a virtual server

SYSTEM INFORMATION
OS type and version Ubuntu 22.04
Virtualmin version 7.20.2

What do I have to put to import an apache virtual host to a virtual server in the control panel?
Let me tell you that the site is located in my user’s home directory (/home/matias/proyectos/sindicato) and that the virtual host is located in /etc/apache2/sites-enabled/toba_matias.conf

Have you looked at “Add Servers->Import Virtual Server”? That’s what it’s for. If you have specific questions about that form, that’d be easier to answer.

Yes, I have a question about that form, what do I have to put in domain name considering that this site is in developer mode and I need to access to this site with the URL https://89.116.74.83/matias/toba_editor/3.4 (/toba_editor/3.4 is an alias for apache), and what do I have to put in Home directory considering that DocumentRoot for toba_editor is located at /home/matias/proyectos/sindicato/proyectos/toba_editor/www?
The problem that I’m having is that when I click “Show What Will Be Imported” it shows me that No Apache virtual host matching was found.


How can I solve this issue?
This is the content of toba_matias.conf:


    Alias /toba_matias "/home/matias/proyectos/sindicato/www"
    <Directory "/home/matias/proyectos/sindicato/www/">
		SetEnv TOBA_DIR		"/home/matias/proyectos/sindicato"
		Options MultiViews FollowSymLinks
		AllowOverride None
		<IfModule !mod_access_compat.c>
		#Apache 2.2.x
		##Piense en actualizar la version del web server a Apache 2.4.x al menos
		##Si desea seguir en esta version, descomente las siguientes lineas
		#	Order allow,deny
		#	Allow from all
		</IfModule>
		<IfModule mod_access_compat.c>
			#Apache 2.3.x/2.4.x  back-comp (deprecated)
			Order allow,deny
			Allow from all
		</IfModule>
		<IfModule mod_authz_core.c>
			#Apache 2.4.x 
			Require all granted
		</IfModule>
    </Directory>


	#Configuracion del SP de SAML
	Alias /toba_matias_sp "/home/matias/proyectos/sindicato/php/3ros/simplesamlphp/www"
	<Directory /home/matias/proyectos/sindicato/php/3ros/simplesamlphp/www>
		SetEnv TOBA_INSTALACION_DIR "/home/matias/proyectos/sindicato/instalacion"
		<IfModule !mod_access_compat.c>
		#Apache 2.2.x
		##Piense en actualizar la version del web server a Apache 2.4.x al menos
		##Si desea seguir en esta version, descomente las siguientes lineas
		#	Order allow,deny
		#	Allow from all
		</IfModule>
		<IfModule mod_access_compat.c>
			#Apache 2.3.x/2.4.x  back-comp (deprecated)
			Order allow,deny
			Allow from all
		</IfModule>
		<IfModule mod_authz_core.c>
			#Apache 2.4.x 
			Require all granted
		</IfModule>
	</Directory>

	#Proyecto: toba_editor
	Alias /matias/toba_editor/3.4 "/home/matias/proyectos/sindicato/proyectos/toba_editor/www/"
	<Directory "/home/matias/proyectos/sindicato/proyectos/toba_editor/www/">
		SetEnv TOBA_DIR 		"/home/matias/proyectos/sindicato"
		SetEnv TOBA_PROYECTO 	"toba_editor"
		SetEnv TOBA_INSTALACION_DIR "/home/matias/proyectos/sindicato/instalacion"
		SetEnv TOBA_INSTANCIA	"desarrollo"
		DirectoryIndex aplicacion.php

		AllowOverride None
		<IfModule !mod_access_compat.c>
		#Apache 2.2.x
		##Piense en actualizar la version del web server a Apache 2.4.x al menos
		##Si desea seguir en esta version, descomente las siguientes lineas
		#	Order allow,deny
		#	Allow from all
		</IfModule>
		<IfModule mod_access_compat.c>
			#Apache 2.3.x/2.4.x  back-comp (deprecated)
			Order allow,deny
			Allow from all
		</IfModule>
		<IfModule mod_authz_core.c>
			#Apache 2.4.x 
			Require all granted
		</IfModule>

		#API REST
		RewriteEngine On
   		RewriteBase /toba_editor/3.4
		Options FollowSymLinks SymLinksIfOwnerMatch
		RewriteRule ^rest\/(v[\d\.]+)?\/(.*)$ rest.php/$1/$2 [PT,L,QSA,E=API_NOMBRE:$1]
	  	RewriteRule ^rest/(.*)$ rest.php/$1 [PT,L,QSA]
   		RewriteRule ^rest$      rest.php/   [PT,L,QSA]
		SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
	</Directory>

	#Proyecto: sindicato
	Alias /matias//sindicato/1.0 "/home/matias/proyectos/sindicato/proyectos/sindicato/www/"
	<Directory "/home/matias/proyectos/sindicato/proyectos/sindicato/www/">
		SetEnv TOBA_DIR 		"/home/matias/proyectos/sindicato"
		SetEnv TOBA_PROYECTO 	"sindicato"
		SetEnv TOBA_INSTALACION_DIR "/home/matias/proyectos/sindicato/instalacion"
		SetEnv TOBA_INSTANCIA	"desarrollo"
		DirectoryIndex aplicacion.php

		AllowOverride None
		<IfModule !mod_access_compat.c>
		#Apache 2.2.x
		##Piense en actualizar la version del web server a Apache 2.4.x al menos
		##Si desea seguir en esta version, descomente las siguientes lineas
		#	Order allow,deny
		#	Allow from all
		</IfModule>
		<IfModule mod_access_compat.c>
			#Apache 2.3.x/2.4.x  back-comp (deprecated)
			Order allow,deny
			Allow from all
		</IfModule>
		<IfModule mod_authz_core.c>
			#Apache 2.4.x 
			Require all granted
		</IfModule>

		#API REST
		RewriteEngine On
   		RewriteBase /matias//sindicato/1.0
		Options FollowSymLinks SymLinksIfOwnerMatch
		RewriteRule ^rest\/(v[\d\.]+)?\/(.*)$ rest.php/$1/$2 [PT,L,QSA,E=API_NOMBRE:$1]
	  	RewriteRule ^rest/(.*)$ rest.php/$1 [PT,L,QSA]
   		RewriteRule ^rest$      rest.php/   [PT,L,QSA]
		SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
	</Directory>

	#Proyecto: toba_usuarios
	Alias /matias//toba_usuarios/3.4 "/home/matias/proyectos/sindicato/proyectos/toba_usuarios/www/"
	<Directory "/home/matias/proyectos/sindicato/proyectos/toba_usuarios/www/">
		SetEnv TOBA_DIR 		"/home/matias/proyectos/sindicato"
		SetEnv TOBA_PROYECTO 	"toba_usuarios"
		SetEnv TOBA_INSTALACION_DIR "/home/matias/proyectos/sindicato/instalacion"
		SetEnv TOBA_INSTANCIA	"desarrollo"
		DirectoryIndex aplicacion.php

		AllowOverride None
		<IfModule !mod_access_compat.c>
		#Apache 2.2.x
		##Piense en actualizar la version del web server a Apache 2.4.x al menos
		##Si desea seguir en esta version, descomente las siguientes lineas
		#	Order allow,deny
		#	Allow from all
		</IfModule>
		<IfModule mod_access_compat.c>
			#Apache 2.3.x/2.4.x  back-comp (deprecated)
			Order allow,deny
			Allow from all
		</IfModule>
		<IfModule mod_authz_core.c>
			#Apache 2.4.x 
			Require all granted
		</IfModule>

		#API REST
		RewriteEngine On
   		RewriteBase /matias//toba_usuarios/3.4
		Options FollowSymLinks SymLinksIfOwnerMatch
		RewriteRule ^rest\/(v[\d\.]+)?\/(.*)$ rest.php/$1/$2 [PT,L,QSA,E=API_NOMBRE:$1]
	  	RewriteRule ^rest/(.*)$ rest.php/$1 [PT,L,QSA]
   		RewriteRule ^rest$      rest.php/   [PT,L,QSA]
		SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
	</Directory>

	#Proyecto: toba_referencia
	Alias /matias//toba_referencia/3.4 "/home/matias/proyectos/sindicato/proyectos/toba_referencia/www/"
	<Directory "/home/matias/proyectos/sindicato/proyectos/toba_referencia/www/">
		SetEnv TOBA_DIR 		"/home/matias/proyectos/sindicato"
		SetEnv TOBA_PROYECTO 	"toba_referencia"
		SetEnv TOBA_INSTALACION_DIR "/home/matias/proyectos/sindicato/instalacion"
		SetEnv TOBA_INSTANCIA	"desarrollo"
		DirectoryIndex aplicacion.php

		AllowOverride None
		<IfModule !mod_access_compat.c>
		#Apache 2.2.x
		##Piense en actualizar la version del web server a Apache 2.4.x al menos
		##Si desea seguir en esta version, descomente las siguientes lineas
		#	Order allow,deny
		#	Allow from all
		</IfModule>
		<IfModule mod_access_compat.c>
			#Apache 2.3.x/2.4.x  back-comp (deprecated)
			Order allow,deny
			Allow from all
		</IfModule>
		<IfModule mod_authz_core.c>
			#Apache 2.4.x 
			Require all granted
		</IfModule>

		#API REST
		RewriteEngine On
   		RewriteBase /matias//toba_referencia/3.4
		Options FollowSymLinks SymLinksIfOwnerMatch
		RewriteRule ^rest\/(v[\d\.]+)?\/(.*)$ rest.php/$1/$2 [PT,L,QSA,E=API_NOMBRE:$1]
	  	RewriteRule ^rest/(.*)$ rest.php/$1 [PT,L,QSA]
   		RewriteRule ^rest$      rest.php/   [PT,L,QSA]
		SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
	</Directory>

I need to access all of these aliases in the same way as /toba_editor/3.4.

Let me tell you that the site already exists, is a framework for web development and I cloned it from a github repository

Oh, that’s scary. www-data shouldn’t be used for this! Domains should have their own user. It’s dangerous to have them all owned by the same user.

I’d also need to see how you filled out the form, though I think you don’t have a VirtualHost that can be imported.

Is that really the contents of your vhost file? It doesn’t have VirtualHost blocks? If there’s no VirtualHost, you obviously can’t import a VirtualHost from it.

I think you probably want to just start fresh with a new Virtual Server created in Virtualmin for the domain you want it to live on, and then copy everything into it from the old location. You don’t really have something that Virtualmin can work with there. To import a VirtualHost, it needs to be a VirtualHost, and ideally you should have a user dedicated to that VirtualHost (and no Virtual Server should ever be owned by www-data, I’m surprised it would even let you do that, as it will break Apache, I’m pretty sure, or do something very scary to the security of the system, by allowing a Virtual Server owner to “be” the Apache user and thus able to read/write all other domains data). Since you’re so far from what Virtualmin can best import, it’s probably more work to make it fit than to start over and just copy the files and configuration you need into the new Virtual Server.

I realized that the hard way, then I deleted the virtual server and deleted the database and www-data user and group, what I need to solve is that when I enter the site it doesn’t give me the Forbidden error, do you know how to do that with the content of the file I just posted?
Let me tell you that the .conf file is generated automatically by the framework when you install it with a command in the ubuntu command line.