Square One Support FAQ

Search the FAQ


#1 2006-12-14 10:53:00

admin
Administrator
Registered: 2006-11-09
Posts: 8

Can I set up more than one web site on Square One?

Since Square One's web service is Apache Web Server, it is possible to set up multiple web sites on the same Square One using Apache's "virtual hosts" feature. To set up virtual hosts, you will need to edit Apache's configuration file located at /hdd/1/apache/conf/httpd.conf.

For each web site, create a subfolder of /hdd/3/htdocs and put all the site files in that subfolder. (For example, you might have /hdd/3/htdocs/site_a and /hdd/3/htdocs/site_b, each with its own set of site files.)

Then, in httpd.conf, add a VirtualHost directive for each site, and one NameVirtualHost directive to enable the virtual hosts.

Here's an example:

Code:

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName www.example-a.com
  DocumentRoot "/hdd/3/htdocs/site_a"
</VirtualHost>

<VirtualHost *:80>
  ServerName www.example-b.com
  DocumentRoot "/hdd/3/htdocs/site_b"
</VirtualHost>

Don't forget to stop and restart the web service to make the changes effective.

For complete documentation on Apache virtual hosts, please refer to http://httpd.apache.org/docs/1.3/vhosts/. (Note that only name-based virtual hosts can be used with Square One, since each Square One can only have one public IP address.)

Offline