Red Hat LINUX 7.2 Reference Manual page 219

Hide thumbs Also See for LINUX 7.2:
Table of Contents

Advertisement

Section 13.5:Using Virtual Hosts
The configuration directives for your secure server are contained within virtual host tags in the
httpd.conf file. If you need to change something about the configuration of your secure server,
you will need to change the configuration directives inside virtual host tags in the httpd.conf file.
If you want to enable certain features (for example, server side includes) for your secure server, they
will need to be enabled within the virtual host tags that define your secure server.
The non-secure Web server is configured as the "non-virtual" host in the httpd.conf file. In
other words, the non-secure Web server's configuration options are outside of the virtual host tags
in httpd.conf. If you want to change something about your non-secure Web server, you will need
to change the configuration directives in httpd.conf outside of the virtual host tags.
By default, both the secure and the non-secure Web servers share the same DocumentRoot, a con-
figuration directive specified in httpd.conf. In other words, the secure and the non-secure Web
server look in the same place for the HTML files that they provide in response to requests. By default,
the DocumentRoot is set to /var/www/html.
To change the DocumentRoot so that it is no longer shared by both the secure server and the non-se-
cure server, change one of the DocumentRoot directives in httpd.conf. The DocumentRoot
outside the virtual host tags defines the DocumentRoot for your non-secure Web server. The Doc-
umentRoot within the virtual host tags that define your secure server is for your secure server.
If for some reason you want to disable the non-secure Web server on your machine, you can. Your
secure server listens on port 443, the default port for secure Web communications, while your non-
secure Web server listens on port 80, the default port for non-secure Web communications. To stop
the non-secure Web server from accepting connections, in httpd.conf, find the line which reads:
Port 80
Change the above line so that it reads:
Port 443
Then comment out the Listen 80 line.
After these two steps, your Web server will be accepting connections on port 443, the default port for
secure Web communications. However, your server will not accept connections on port 80, the default
port for non-secure communications, so the non-secure Web server will be effectively disabled.
13.5.2 Setting Up Virtual Hosts
Most people will probably use their Web server as it is configured. Therefore, they will be using
the built-in virtual hosts capability, but they will not have to do any manipulation of the virtual hosts
directives in httpd.conf. However, if you would like to use the virtual hosts capability for some
other reason, you can.
219

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the LINUX 7.2 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Linux 7.2

Table of Contents