Chapter 15: Shared Tomcat Hosting For example, on

Chapter 15: Shared Tomcat Hosting For example, on Linux, using the ifconfig command adds a virtual interface and configures the NIC with an IP address at the same time. If an Ethernet interface named eth0 has already been configured, it is simple to add an aliased interface called eth0:1 (in Linux, virtual Ethernet interfaces are named with the syntax
:), using the following command: $ ifconfig eth0:1 netmask Configuring IP -Based Virtual Hosting in Apache Adding IP-based virtual hosts in Apache is trivial. Merely add a block to Apache s httpd.conf file for each corresponding Web site, and a few associated parameters. Let s look at a sample configuration: Listen 80 … ServerName europa.dom DocumentRoot /home/websites/europa.dom/web ServerAdmin support@europa.dom ErrorLog /home/websites/europa.dom/log/error TransferLog /home/websites/europa.dom/log/access ServerName callisto.dom DocumentRoot /home/websites/callisto.dom/web ServerAdmin support@callisto.dom ErrorLog /home/websites/callisto.dom/log/error TransferLog /home/websites/callisto.dom/log/access Here, two IP-based virtual hosts, europa.domand callisto.dom, are configured to run on the IP addresses 192.168.1.2and 192.168.1.20, respectively. The Listen directive listed in the beginning causes Apache to listen on port 80 on all network interfaces 192.168.1.2, 192.168.1.20, plus any others configured on this server machine. If you need to have it listen on specific network interface only, you can specify an IP address as a part of the directive as shown: Listen 192.168.1.2:80 Listen 192.168.1.20:80 In this example, Apache is configured to listen on port 80; this means it needs to be started as root. To be able to run Apache as non-root, change the port number to 1024. Each of the virtual hosts is defined in a section: . The ServerName directive sets the domain name to be served by this virtual host. . The DocumentRoot directive points to the base directory to be used for serving pages for this domain. . The ServerAdmin directive lists the e-mail address of the Web server administration personnel. . TransferLogand ErrorLog point to the log files to be used for Web site access and Web site error messages, respectively.

If you looking for unlimited one inclusive web hosting plan please check web hosting plan website.

Comments are closed.