Bytemark VHost Webhosting Setup
The website hosting part of the Bytemark virtual hosting collection uses Apache2 to serve websites, and comes complete with support for PHP5. (The most common PHP5 modules are enabled by default, if you find one missing that you'd like to use please do let us know!)
Getting Started
The configuration of websites is extremely straight-forward. To get started hosting new site example.com simply execute this command:
mkdir -p /srv/example.com/public/htdocs
Once this command has been executed the webserver will serve the contents of that directory when requests for http://example.com, or http://www.example.com are made against it.
Uploading Content
You might be interested in viewing seeing how to enable FTP access for your domain - although we do suggest you use SCP to upload content instead. It is more secure, and means you need run one less service. The WinSCP client for Microsoft Windows is a great graphical client for uploading content over SCP.
CGI Access
If you wish to execute CGI scripts for your domain simply create a cgi-bin directory, by running the following command:
mkdir -p /srv/example.com/public/cgi-bin
Any executable commands in that directory will now be treated as CGI scripts for your domain. For example if you created the file
/srv/example.com/public/cgi-bin/test.cgi
This would be referred to as:
* http://example.com/cgi-bin/test.cgi
SSL Support
When the Bytemark Vhost packages are installed a new SSL certificate is generated, and this is used to provide secure access to any hosted sites. This is a "self-signed" certificate, which means that it will not be trusted by any client browser without confirmation though.
If you'd like to host additional SSL sites you'll need to first get in touch with Bytemark support and ask for an additional IP address - one for each SSL site that you wish to host.
Once you have an extra IP address, or two, you should be ready to configure SSL hosting.
Statistics
Each hosted website will have visitor statistics automatically generated and accessible at http://example.com/stats/. These statistics will be updated once per day, and the raw access logs will be made available as /srv/example.com/public/logs/
Testing new websites
You can view new websites before any DNS changes are made.
For example, if the virtual machine example.vm.bytemark.co.uk is hosting www.example.com, (i.e. the directory /srv/example.com/public/htdocs has been created), the website can immediately be viewed at http://example.com.testing.example.vm.bytemark.co.uk.
There are some important things to note though:
- There is no www part added to the domain name -- it is just the directory name prepeneded to .testing.example.vm.bytemark.co.uk.
- This testing alias isn't guaranteed to work in all cases, for complex site setups it might not work entirely as expected.
- The testing alias only allows the testing of websites. FTP logins, email delivery, or checking is explicitly unsupported.
