![]() | A virtual server allows you to have several servers running on the same port. For example you can have www.foo.com and www.foo.org running on the same port and machine. This is why it is called virtual server. |
To create your first server, log into the web based CIF.. Click on the tab, then the button.
Here, you are prompted for the server name:
Type in an easily identifiable name. You also have to select the configuration type. Depending on the configuration you choose, your server will have a different set of modules. In other words, your server will have different capabilities. For your first server, choose Basic server, and click .Now you'll see the Virtual Servers page again. As you can see, you have two different folders to work on: (Figure 4-1) and (Figure 4-2).
Server variables contain the URL of your site, and the port on which it will be available. File system describes the files/directories containing the .html and other files you want Caudium to serve.In server variables, go into
and choose . Use the default values, choose , and click . Now select the URL of your site, and select . You can now go back to the page displaying all of your modules, that is, where you were before you had gone into Server Variables.Under your server name, you'll see the status of your server. If it contains the word "Open" in blue everything is okay, and you can continue with configuring the file system.
If it contains the words "Not open" in red, there is a problem. You can go
into the Event Log via the CIF. tab to investigate. If you have an error
Failed to open socket on 0:80 (already bound ?), you may have another
program or Caudium itself already running on this port. To fix the problem,
identify the program which is using this port, and restart Caudium
[1].
To restart Caudium, go into -> -> -> . Wait a few seconds, and when prompted, select . Now select your
server, and you should have the word "Open" in blue.
![]() | In the CIF. you may wonder what are those two different protocols http and http2? |
---|---|
The difference is that http2 uses Caudium's internal memory cache while http is plain Pike http subsystem. So http2 is faster than http as you might expect. However, there are some issues on some specific sites. |
Example 4-1. Your user filesystem.
/home/customers/customer1 /home/customers/customer2 /home/customers/bigcustomer3 /home/friends/franck /home/friends/bertrand /home/friends/didier |
And suppose your URL is http://www.iteam.org/.
You can now launch your favorite browser to the URL of your site and enjoy.
.www_browsable - the directory will always be browsable .www_not_browsable - the directory will never be browsable |
The Figure 4-3 shows the output you should have.
![]() | If you created these files/directories after you point Caudium to your site, it is safe to go in the Actions tab, then to Cache -> Cache status -> Flush caches. |
Example 4-2. A simple virtual hosting regular expression.
www\.virtualhost\.com www.virtualhost.com |
Example 4-3. A better and quicker regular expression.
^www\.virtualhost\.com$|^virtualhost\.com$ www.virtualhost.com |
# echo "127.0.0.1 www.virtualhost.com" >> /etc/hosts. |
Change the file system root and /tmp in File system -> NONE/ mounted on / -> Paths -> Search path.
If you have an error telling you www.virtualhost.com is unknown check your host file.
For more information about virtual hosting, see the Virtual-Web Mini-HOWTO available at the LDP or in /usr/share/doc/HOWTO or /usr/doc/HOWTO under Debian GNU/Linux.
[1] | To identify you can use lsof(8). If you want to know which programs listen on port 80 just issue the following command as root
Here is the result:
|