|
39.
|
|
|
The <emphasis>ServerName</emphasis> directive is optional and specifies what FQDN your site should answer to. The default virtual host has no ServerName directive specified, so it will respond to all requests that do not match a ServerName directive in another virtual host. If you have just acquired the domain name ubunturocks.com and wish to host it on your Ubuntu server, the value of the ServerName directive in your virtual host configuration file should be ubunturocks.com. Add this directive to the new virtual host file you created earlier (<filename>/etc/apache2/sites-available/mynewsite.conf</filename>).
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:238(para)
|
|
40.
|
|
|
You may also want your site to respond to www.ubunturocks.com, since many users will assume the www prefix is appropriate. Use the <emphasis>ServerAlias</emphasis> directive for this. You may also use wildcards in the ServerAlias directive.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:250(para)
|
|
41.
|
|
|
For example, the following configuration will cause your site to respond to any domain request ending in <emphasis>.ubunturocks.com</emphasis>.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:257(para)
|
|
42.
|
|
|
ServerAlias *.ubunturocks.com
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
ServerAlias *.ubunturocks.com
|
|
Translated by
Andika Triwidada
|
|
|
|
Located in
serverguide/C/web-servers.xml:263(programlisting)
|
|
43.
|
|
|
The <emphasis>DocumentRoot</emphasis> directive specifies where Apache2 should look for the files that make up the site. The default value is /var/www/html, as specified in <filename>/etc/apache2/sites-available/000-default.conf</filename>. If desired, change this value in your site's virtual host file, and remember to create that directory if necessary!
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:269(para)
|
|
44.
|
|
|
Enable the new <emphasis>VirtualHost</emphasis> using the <application>a2ensite</application> utility and restart Apache2:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:278(para)
|
|
45.
|
|
|
sudo a2ensite mynewsite
|
|
|
|
sudo a2ensite mynewsite
|
|
Translated by
Andika Triwidada
|
|
|
|
Located in
serverguide/C/web-servers.xml:284(command)
|
|
46.
|
|
|
sudo systemctl restart apache2.service
|
|
|
|
sudo systemctl restart apache2.service
|
|
Translated by
Andika Triwidada
|
|
|
|
Located in
serverguide/C/web-servers.xml:285(command) serverguide/C/web-servers.xml:303(command) serverguide/C/web-servers.xml:544(command) serverguide/C/web-servers.xml:553(command) serverguide/C/web-servers.xml:612(command) serverguide/C/mail.xml:994(command) serverguide/C/lamp-applications.xml:238(command) serverguide/C/lamp-applications.xml:462(command)
|
|
47.
|
|
|
Be sure to replace <emphasis>mynewsite</emphasis> with a more descriptive name for the VirtualHost. One method is to name the file after the <emphasis>ServerName</emphasis> directive of the VirtualHost.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:289(para)
|
|
48.
|
|
|
Similarly, use the <application>a2dissite</application> utility to disable sites. This is can be useful when troubleshooting configuration problems with multiple VirtualHosts:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:296(para)
|