Red Hat LINUX 7.2 - OFFICIAL LINUX CUSTOMIZATION GUIDE Guida di Installazione Pagina 199

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 282
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 198
Chapter 15. Apache 199
15.5.1. The Secure Web Server Virtual Host
The default configuration of your Web server runs a non-secure and a secure server. Both servers use
the same IP address and host name, but they listen on different ports, and the secure server is a virtual
host. This configuration enables you to serve both secure and non-secure documents in an manner.
Setting up the secure HTTP transmission is very resource intensive, so generally you will be able to
serve far fewer pages per second with a secure server. You need to consider this when you decide what
information to include on the secure server and the non-secure server.
The configuration directives for your secure server are contained within virtual host tags in the
httpd.conf file. If you need to change anything about the configuration of your secure server, you
will need to change the configuration directives inside virtual host tags.
The non-secure Web server is configured as the "non-virtual" host in the httpd.conf file. If you want
to change something about your non-secure Web server, you will need to change the configuration
directives outside of the virtual host tags.
By default, both the secure and the non-secure Web servers share the same DocumentRoot. To change
the DocumentRoot so that it is no longer shared by both the secure server and the non-secure server,
change one of the DocumentRoot directives. The DocumentRoot outside the virtual host tags defines
the DocumentRoot for your non-secure Web server. The DocumentRoot within the virtual host tags
that define your secure server is for your secure server.
The secure Apache server listens on port 443, while your non-secure Web server listens on port 80.
To stop the non-secure Web server from accepting connections find the line which reads:
Port 80
And change it to read:
Port 443
Then comment out the Listen 80 line.
15.5.2. Setting Up Virtual Hosts
To create a virtual host, you will need to alter the virtual host lines, provided as an example in
httpd.conf or create your own virtual host section.
The virtual host example lines read as follows:
#
VirtualHost ip.address.of.host.some_domain.com
# ServerAdmin [email protected]_domain.com
# DocumentRoot /www/docs/host.some_domain.com
# ServerName host.some_domain.com
# ErrorLog logs/host.some_domain.com-error_log
# CustomLog logs/host.some_domain.com-access_log common
#
/VirtualHost
Uncomment all of the lines, and add the correct information for the virtual host.
In the first line, change ip.address.of.host.some_domain.com to your server’s IP address.
Change the ServerName to a valid DNS name to use for the virtual host.
You will also need to uncomment one of the NameVirtualHost lines below:
#NameVirtualHost 12.34.56.78:80
#NameVirtualHost 12.34.56.78
Next change the IP address to the IP address and port, if necessary, for the virtual host.
Vedere la pagina 198
1 2 ... 194 195 196 197 198 199 200 201 202 203 204 ... 281 282

Commenti su questo manuale

Nessun commento