|
29.
|
|
|
The server also reads a file containing mime document types; the filename is set by the <emphasis>TypesConfig</emphasis> directive, typically via <filename>/etc/apache2/mods-available/mime.conf</filename>, which might also include additions and overrides, and is <filename>/etc/mime.types</filename> by default.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:160(para)
|
|
31.
|
|
|
This section explains Apache2 server essential configuration parameters. Refer to the <ulink url="http://httpd.apache.org/docs/2.4/">Apache2 Documentation</ulink> for more details.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:169(para)
|
|
32.
|
|
|
Apache2 ships with a virtual-host-friendly default configuration. That is, it is configured with a single default virtual host (using the <emphasis>VirtualHost</emphasis> directive) which can be modified or used as-is if you have a single site, or used as a template for additional virtual hosts if you have multiple sites. If left alone, the default virtual host will serve as your default site, or the site users will see if the URL they enter does not match the <emphasis>ServerName</emphasis> directive of any of your custom sites. To modify the default virtual host, edit the file <filename>/etc/apache2/sites-available/000-default.conf</filename>.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:177(para)
|
|
35.
|
|
|
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/mynewsite.conf
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:204(command)
|
|
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)
|
|
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)
|
|
46.
|
|
|
sudo systemctl restart apache2.service
|
|
|
|
(no translation yet)
|
|
|
|
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)
|
|
54.
|
|
|
The <emphasis>ErrorDocument</emphasis> directive allows you to specify a file for Apache2 to use for specific error events. For example, if a user requests a resource that does not exist, a 404 error will occur. By default, Apache2 will simply return a HTTP 404 Return code. Read <filename>/etc/apache2/conf-available/localized-error-pages.conf</filename> for detailed instructions for using ErrorDocument, including locations of example files.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:350(para)
|
|
55.
|
|
|
By default, the server writes the transfer log to the file <filename>/var/log/apache2/access.log</filename>. You can change this on a per-site basis in your virtual host configuration files with the <emphasis>CustomLog</emphasis> directive, or omit it to accept the default, specified in <filename> /etc/apache2/conf-available/other-vhosts-access-log.conf</filename>. You may also specify the file to which errors are logged, via the <emphasis>ErrorLog</emphasis> directive, whose default is <filename>/var/log/apache2/error.log</filename>. These are kept separate from the transfer logs to aid in troubleshooting problems with your Apache2 server. You may also specify the <emphasis>LogLevel</emphasis> (the default value is "warn") and the <emphasis>LogFormat</emphasis> (see <filename> /etc/apache2/apache2.conf</filename> for the default value).
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:360(para)
|
|
57.
|
|
|
<Directory /var/www/html/mynewsite>
...
</Directory>
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:381(programlisting)
|