Ciao a tutti vi linko una domanda che ho fatto anche su stackoverflow.
https://stackoverflow.com/q/64750906/10176701
In pratica ho creato un virtual host con apache2 del Mac e fin qui tutto ok... il problema si presenta se ne vado ad inserire un altro, quando vado a scrivere il dominio mi fa sempre il redirect a quello precedente, come se non lo trovasse e backupasse a quello prima. Se invece rimuovo il primo e lascio il secondo riprende a funzionare. Lascio anche qui la conf di https.vhosts.conf:
https://stackoverflow.com/q/64750906/10176701
In pratica ho creato un virtual host con apache2 del Mac e fin qui tutto ok... il problema si presenta se ne vado ad inserire un altro, quando vado a scrivere il dominio mi fa sempre il redirect a quello precedente, come se non lo trovasse e backupasse a quello prima. Se invece rimuovo il primo e lascio il secondo riprende a funzionare. Lascio anche qui la conf di https.vhosts.conf:
Bash:
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
DocumentRoot /var/www/sites/
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/sites/sito1.local/htdocs
ServerName sito1.local
ServerAlias www.sito1.local
ErrorLog "/private/var/log/apache2/sito1.local-error_log"
CustomLog "/private/var/log/apache2/sito1.local-access_log" common
<Directory /var/www/sites/sito1.local/htdocs>
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/sites/sito2.local/htdocs
ServerName sito2.local
ServerAlias www.sito2.local
ErrorLog "/private/var/log/apache2/sito2.local-error_log"
CustomLog "/private/var/log/apache2/sito2.local-access_log" common
<Directory /var/www/sites/sito2.local/htdocs>
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>