Answer the question
In order to leave comments, you need to log in
Automatic addition of VirtualHosts in apache2 [Ubuntu Server]?
Good evening!
I'm trying to make a local server in a virtual machine. I don't have much experience, so the questions are probably simple and stupid.
It is necessary to automatically read the names of directories in a certain directory when starting the server and create virtual hosts for Apache with the names of these directories. In principle, creating a virtual host does not cause problems for me. The problem is bash.
I figured out how to create a virtual host for a specific directory in bash, knowing its name. How can I read all directory names in a loop? However, their number may change. Maybe you don’t need to write your own script and somewhere there is a ready-made solution?
And one more follow-up question. Is it necessary to enable rewrite after creating hosts or is it not important?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question