12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Configuring the Server 335virtual host means that a different IP address exists for each website served. Most configurationsare named-based because it only requires one IP address, which is the typediscussed in this section.Virtual hosts are configured one at a time usually at the end of the httpd.conf file. Anexample is shown in Listing 15.3.LISTING 15.3Example Virtual Host#Enable name-based virtual hostingNameVirtualHost *.80ServerName www.example.orgDocumentRoot /var/www/example.org#add other directives hereNotice the NameVirtualHost directive must be set to enable name-based virtual hosting.The * in the value (and in the values) means requests are answered fromall server IP addresses that the Apache HTTP server is configured to listen on with theListen and SecureListen directives.15Most of the directives that can be configured in the main server section can be configuredin a virtual host section. The ServerName and DocumentRoot directives are required in avirtual host section so the server knows which website the virtual host is for and wherethe files being served for the site are located.Loading ModulesThe Apache HTTP server supports the loading of modules to implement additionalfeatures. Examples include mod_log_config for customizing log files, mod_alias for URLredirection, and mod_cgi for executing CGI scripts.NOTEFor a list of modules available for version 2.2 of the Apache HTTP server, go tohttp://httpd.apache.org/docs/2.2/mod/.For each module you want to load, add a line similar to the following in the globalconfiguration section of httpd.conf (replace module_name and module_filename.so):LoadModule module_name modules/module_filename.soAfter listing the module with the LoadModule directive, include any of the directives fromthe module in the appropriate httpd.conf sections.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!