Vá para a pasta /etc/apache2/sites-available e copie o arquivo 00-default.conf padrão para mysite.conf . Você pode usar qualquer nome exclusivo para o mysite.conf . Nesse caso, você poderia chamá-lo de something-somethingelse-gr.conf (para seu próprio nome pessoal, identificando sua designação para este site virtual.
Em seguida, edite sua nova configuração. Remova o comentário da diretiva ServerName e substitua o www.example.com por something.somethingelse.gr . Você também pode adicionar outros nomes para chamar o mesmo servidor usando a diretiva ServerAlias , conforme descrito abaixo.
Alterar de:
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
Mude para:
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName something.somethingelse.gr
ServerAlias www.something.somethingelse.gr
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
Em seguida, execute isso na linha de comando:
$ a2ensite mysite.conf