Andrew Hudson - Fedora™ Unleashed, 2008 edition

Здесь есть возможность читать онлайн «Andrew Hudson - Fedora™ Unleashed, 2008 edition» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Город: Indianapolis, Год выпуска: 2008, ISBN: 2008, Издательство: Sams Publishing, Жанр: ОС и Сети, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Fedora™ Unleashed, 2008 edition: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Fedora™ Unleashed, 2008 edition»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

Quick Glance Guide
Finding information you need is not always easy. This short index provides a list of common tasks discussed inside this book. Browse the table of contents or index for detailed listings and consult the specified chapter for in-depth discussions about each subject.
left How Do I…?
See…
How Do I…?
See…
left Back up my system?
Chapter 13
Partition a hard drive?
Appendix B, Chapters 1, 35
left Build a new Linux kernel?
Chapter 36
Play MP3s and other music?
Chapter 7
left Burn a CD?
Chapter 7
Print a file?
Chapter 8
left Change a password?
Chapter 4
Read a text file?
Chapter 4
left Change the date and time?
Chapter 32
Read or send email?
Chapter 21
left Compress a file?
Chapter 13
Read or post to newsgroups?
Chapter 5
left Configure a modem?
Chapter 2
Reboot Fedora?
Chapter 1
left Configure a printer?
Chapter 8
Rescue my system?
Chapter 13
left Configure a scanner?
Chapter 7
Set up a DNS server?
Chapter 23
left Configure a sound card?
Chapter 7
Set up a firewall?
Chapter 14
left Configure my desktop settings?
Chapter 3
Set up a web server?
Chapter 15
left Connect to the Internet?
Chapter 5
Set up an FTP server?
Chapter 20
left Control a network interface?
Chapter 14
Set up Samba with SWAT?
Chapter 19
left Copy files or directories?
Chapters 13, 32
Set up wireless networking?
Chapter 14
left Create a boot disk to boot Fedora?
Chapter 1
Shut down Fedora?
Chapter 1
left Create a database?
Chapter 16
Use a spreadsheet?
Chapter 6
left Create a user?
Chapter 4
Use Instant Messaging?
Chapter 5
left Delete a file or directory?
Chapter 32
Watch television on my computer?
Chapter 7
left Get images from a digital camera?
Chapter 7
Edit a text file?
Chapter 4
left Install Fedora?
Chapter 1
Make Fedora more secure?
Chapter 14
left Log in to Fedora?
Chapter 1
Mount a CD-ROM or hard drive?
Chapter 35

Fedora™ Unleashed, 2008 edition — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Fedora™ Unleashed, 2008 edition», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Virtual Hosting

One of the more popular services to provide with a web server is to host a virtual domain. Also known as a virtual host , a virtual domain is a complete website with its own domain name, as if it were a standalone machine, but it's hosted on the same machine as other websites. Apache implements this capability in a simple way with directives in the httpd.confconfiguration file.

Apache now can dynamically host virtual servers by using the mod_vhost_aliasmodule you read about in the preceding section of the chapter. The module is primarily intended for ISPs and similar large sites that host a large number of virtual sites. This module is for more advanced users and, as such, it is outside the scope of this introductory chapter. Instead, this section concentrates on the traditional ways of hosting virtual servers.

Address-Based Virtual Hosts

After you've configured your Linux machine with multiple IP addresses, setting up Apache to serve them as different websites is simple. You need only put a VirtualHostdirective in your httpd.conffile for each of the addresses you want to make an independent website:

ServerName gnulix.org

DocumentRoot /home/virtual/gnulix/public_html

TransferLog /home/virtual/gnulix/logs/access_log

ErrorLog /home/virtual/gnulix/logs/error_log

Use the IP address, rather than the hostname, in the VirtualHosttag.

You can specify any configuration directives within the tags. For example, you might want to set AllowOverridesdirectives differently for virtual hosts than you do for your main server. Any directives that aren't specified default to the settings for the main server.

Name-Based Virtual Hosts

Name-based virtual hosts enable you to run more than one host on the same IP address. You must add the names to your DNS as CNAMEs of the machine in question. When an HTTP client (web browser) requests a document from your server, it sends with the request a variable indicating the server name from which it's requesting the document. Based on this variable, the server determines from which of the virtual hosts it should serve content.

NOTE

Some older browsers are unable to see name-based virtual hosts because this is a feature of HTTP 1.1 and the older browsers are strictly HTTP 1.0-compliant. However, many other older browsers are partially HTTP 1.1-compliant, and this is one of the parts of HTTP 1.1 that most browsers have supported for a while.

Name-based virtual hosts require just one step more than IP address-based virtual hosts. You must first indicate which IP address has the multiple DNS names on it. This is done with the NameVirtualHostdirective:

NameVirtualHost 212.85.67.67

You must then have a section for each name on that address, setting the configuration for that name. As with IP-based virtual hosts, you need to set only those configurations that must be different for the host. You must set the ServerNamedirective because it's the only thing that distinguishes one host from another:

ServerName bugserver.gnulix.org

ServerAlias bugserver

DocumentRoot /home/bugserver/htdocs

ScriptAlias /home/bugserver/cgi-bin

TransferLog /home/bugserver/logs/access_log

ServerName pts.gnulix.org

ServerAlias pts

DocumentRoot /home/pts/htdocs

ScriptAlias /home/pts/cgi-bin

TransferLog /home/pts/logs/access_log

ErrorLog /home/pts/logs/error_log

TIP

If you're hosting websites on an intranet or internal network, users are likely to use the shortened name of the machine rather than the FQDN. For example, users might type http://bugserver/index.htmlin their browser location fields rather than http://bugserver.gnulix.org/index.html. In that case, Apache would not recognize that those two addresses should go to the same virtual host. You could get around this by setting up VirtualHostdirectives for both bugserverand bugserver.gnulix.org, but the easy way around it is to use the ServerAliasdirective, which lists all valid aliases for the machine:

ServerAlias bugserver

For more information about VirtualHost, refer to the help system on http://localhost/_manual.

Logging

Apache provides for logging just about any web access information in which you might be interested. Logging can help with the following:

► System resource management, by tracking usage

► Intrusion detection, by documenting bad HTTP requests

► Diagnostics, by recording errors in processing requests

Two standard log files are generated when you run your Apache server: access_logand error_log. They are found under the /var/log/httpddirectory. (Others include the SSL logs ssl_access_log, ssl_error_log, and ssl_request_log.) All logs except for the error_log(by default, this is just the access_log) are generated in a format specified by the CustomLogand LogFormatdirectives. These directives appear in your httpd.conffile.

A new log format can be defined with the LogFormatdirective:

LogFormat "%h %l %u %t \"%r\" %>s %b" common

The common log format is a good starting place for creating your own custom log formats. Note that most of the available log analysis tools assume that you are using the commonlog format or the combinedlog format — both of which are defined in the default configuration files.

The following variables are available for LogFormatstatements:

%a Remote IP address.
%A Local IP address.
%b Bytes sent, excluding HTTP headers. This is shown in Apache's Combined Log Format (CLF). For a request without any data content, a - is shown instead of 0.
%B Bytes sent, excluding HTTP headers.
%{VARIABLE}e The contents of the environment variable variable.
%f The filename of the output log.
%h Remote host.
%H Request protocol.
%{HEADER}i The contents of header; header line(s) in the request sent to the server.
%l Remote log name (from identd, if supplied).
%m Request method.
%{NOTE}n The contents of note NOTEfrom another module.
%{HEADER}o The contents of header; header line(s) in the reply.
%p The canonical port of the server serving the request.
%P The process ID of the child that serviced the request.
%q The contents of the query string, prepended with a ? character. If there's no query string, this evaluates to an empty string.
%r The first line of request.
%s Status. For requests that were internally redirected, this is the status of the original request — %>s for the last.
%t The time, in common log time format.
%{format}t The time, in the form given by format, which should be in strftime(3)format.
%T The seconds taken to serve the request.
%u Remote user from auth; this might be bogus if the return status ( %s) is 401.
%U The URL path requested.
%V The server name according to the UseCanonicalNamedirective.
%v The canonical ServerNameof the server serving the request.

You can put a conditional in front of each variable to determine whether the variable is displayed. If the variable isn't displayed, — is displayed instead. These conditionals are in the form of a list of numerical return values. For example, %!401udisplays the value of REMOTE_USER unless the return code is 401.

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Fedora™ Unleashed, 2008 edition»

Представляем Вашему вниманию похожие книги на «Fedora™ Unleashed, 2008 edition» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Fedora™ Unleashed, 2008 edition»

Обсуждение, отзывы о книге «Fedora™ Unleashed, 2008 edition» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x