Na documentação do apache:
<VirtualHost *:80>
ServerName server.domain.com
ServerAlias server server2.domain.com server2
ServerAlias *.example.com
UseCanonicalName Off
# ...
</VirtualHost>
Como executar um projeto em dois domínios?
Minha tentativa: (mas não está funcionando, apenas o primeiro mydomain.com
work)
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias mydomain.com *.mydomain.com
Alias /static/ /home/ubuntu/myproject/myproject/static/
DocumentRoot /home/ubuntu/myproject/myproject
WSGIScriptAlias / /home/ubuntu/myproject/myproject/index.wsgi
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName otherdomain.com
ServerAlias otherdomain.com *.otherdomain.com
Alias /static/ /home/ubuntu/myproject/myproject/static/
DocumentRoot /home/ubuntu/myproject/myproject
WSGIScriptAlias / /home/ubuntu/myproject/myproject/index.wsgi
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
Na documentação do apache:
<VirtualHost *:80>
ServerName server.domain.com
ServerAlias server server2.domain.com server2
ServerAlias *.example.com
UseCanonicalName Off
# ...
</VirtualHost>
Tags apache-2.2