FAQ for Web Sites using the UK Web.Solutions Direct Hosting Service |
|
No Longer MaintainedI no longer use or recommend UKWSD since they decided to ditch their customer forums and disable "catch all" email. So this FAQ is now well out of date I'm afraid. In case you are interested, I now use Dreamhost, a US based service that offers secure shell access (SSH), unlimited domains on an account (including free subdomains of Dreamhosters.com), 200GB of space increasing at 2GB per week (yes, that's no typo - 200 Giga Bytes!), and loads more. They are somewhat slower than UKWSD but the extra features are unbeatable. If you want to sign up to them, please click on the link below to get a discount. ![]() Unofficial FAQ for Web Sites using the UK Web.Solutions Direct Hosting ServiceThe site is used to be hosted by UK Web.Solutions Direct who are were a very good and low cost hosting service. There is a short official FAQ, support forums one of which can be accessed before signing up these were canned by UKWSD, and the people running the service are excellent at answering questions and are very responsive and helpful. None the less, there are plenty of detailed questions and issues that crop up that can be difficult to get immediate answers to without having to bother people so I've set this page up to act as an unofficial FAQ list, at least of the issues and questions that I've needed to get answers to. Please note that questions not covered here should be directed either to the excellent support people at UKWSD or to one of the forums, though I am happy to put the answer here if you think it would benefit others. Web site log filesAre rotated each month so the old ones are lost. Use CPANEL to keep a copy by logging in to your CPANEL, click on "Raw Log Manager" and select "Archive Logs in your home directory at the end of each month" then save. You will then get a copy of last months logs which you can then analyse offline using something like the freeware Analog stats package. You DO get a full SMTP server with the hosting plans. To SEND email from a PC via your server, you will need to authenticate using your user name and password (the same one used for CPANEL). To COLLECT mail from your server, use a POP3 client (I really dislike the HORDE web mail tool that you get access to, it's slow and unwieldy). You can also use CPANEL's mail filtering tool to redirect emails to NULL (useful for spam) or to a script (useful for emailing information INTO a database - see the paragraph on this below). Email SPAM FilteringYou get SpamAssassin for SPAM detection. Do the basic configuration using CPANEL but if you want to do more, edit the user config file directly (/.spamassassin/user_prefs). SA is very powerful so check out the documentation. In particular, you can use one of the headers that SA adds to SPAM in the filter rules in CPANEL to re-direct mail either to NULL (to get rid of it) or to another mail address for checking. You can see more detail about configuring SpamAssassin in my Anti-Spam section under SpamAssassin. Controlling basic access and other Apache .htaccess stuffYou seem to get very comprehensive access to Apache and PHP settings in .htaccess files. In particular, you can use "modRewrite" to do all sorts of clever things. Here is one as an example (based on an early version of what I use on my site). # Override PHP include path to include std folder outside html doc path php_value include_path ".:/home/username/myinclpath:/usr/local/lib/php" # Add .htm files to php processed list to fool search engines # use .php & .htm for php processed, .html for static AddType application/x-httpd-php .php .htm # Ensure that .htaccess files cannot be accessed by web browser <Files .htaccess> order allow,deny deny from all </Files> # Ensure that PHP Include (*.inc) files cannot be accessed by web browser <Files ~ "^\.inc"> Order allow,deny Deny from all Satisfy All </Files> # Redirect errors: 404=No found, 500=Server error ErrorDocument 404 /common/404.php ErrorDocument 500 /common/500.php # Mod Rewrite clever things RewriteEngine on RewriteBase / # rewite spaces to underscores? NB: MUST BE 1ST RULE ##RewriteRule ^(.*)\ (.*)$ $1\_$2 [N] # Redirect pages that were correct on old site to correct pages on new site # NB: Better than redirect statement as non-case & non-host specific RewriteRule ^opalfaq\.htm|html$ /IT/OpalFAQ.htm [R,L] RewriteRule ^nepal1*(\.htm|html)*$ /Travel\ &\ Outdoors/Nepal.htm [R,L] RewriteRule ^nz1*(\.htm|html)*$ /Travel\ &\ Outdoors/New\ Zealand.htm [R,L] RewriteRule ^skiing(\.htm|html)*$ /Travel\ &\ Outdoors/Skiing.htm [R,L] RewriteRule ^walktime(\.htm|html)*$ /Travel\ &\ Outdoors/Walking\ Times.htm [R,L] # Handle broken browsers (that stop at spaces) RewriteRule ^travel(\/*)$ /Travel\ &\ Outdoors$1 [R,L] RewriteRule ^worship(\/*)$ /Worship\ Resources$1 [R,L] # Ensures that requests for index.html files are redirected to .htm RewriteRule index\.html$ index.htm Secure web access (SSL/HTTPS)The basic packages offer shared SSL which is accessed by offering your users a link such as: https://securen.speedynetwork.net/~username/
where n=the server you are hosted on (see cpanel) and username=your user name. Update 2004-Jul-20: There is a community based, none-profit certificate authority called CAcert. I've not tried this but you may be able to make use of it. Using PHP to handle incoming mail automaticallyPHP makes it very easy to send email automatically but how about handling incoming emails. If we could do this, we could have content included on the site by sending an email. The good news is that this can indeed be done. First check out the tutorial "Incoming Mail and PHP". Fortunately, you do not need to mess about with changing the configuration of sendmail as CPANEL provides this facility for us. Under "Email Management\Aliases/Forwarding\Add Forwarder", type in an appropriate email name and in the last box put |/home/[USERNAME]/[MYDIR]/[SCRIPTNAME].php Where [USERNAME] is your UKWSD user id and [SCRIPTNAME] is the name of your script. [MYDIR] should be the name of a folder OUTSIDE your web space (/public_html) so that it is not accessible as a web page. Follow the tutorial from Step 2. Update July 2004: I've now implemented this on my web site so that I can email new content to the site - great when working on a laptop that is not always connected and also for quickly adding new information. Running a PHP scrip from CRONCreate a PHP script as follows:
#!/usr/bin/php
print 'hello';
Note the #!/usr/bin/php at the start, it is this that tells the Linux shell how to execute the script. Obviously, you will want to make your script a bit more complex. Upload this script to your hosting space. I recommend somewhere not under the "public_html" folder since that is visible to the whole world, you will want to keep your script safe. Create a folder under your root and put it in there. Next, set the permissions on the file to 755 so that it can be executed. Finally, use CPANEL to set up the cron job with the command pointing to: /home/<MYHOSTID>/<MYFOLDER>/myscript.php and set the output to go to an email address. To override the output to email, add a pipe to the end of the command such as ".../cron.php>/dev/null" which will send all output to oblivion, or .../cron.php>/home/<MYHOSTID>/<MYFOLDER>/cronlog.txt which will save the output as a file. If you do want to use a script from your public space, there is an alternative using the GET command as follows. GET http://hostname/file.php > /dev/null. But you must be careful what the script does as it is possible for anyone to execute this if they know (or guess) that it is there. Unofficial FAQ for Web Sites using the UK Web.Solutions Direct Hosting ServiceThe site is hosted by UK Web.Solutions Direct who are a very good and low cost hosting service. There is a short official FAQ, support forums one of which can be accessed before signing up and the people running the service are excellent at answering questions and are very responsive and helpful. None the less, there are plenty of detailed questions and issues that crop up that can be difficult to get immediate answers to without having to bother people so I've set this page up to act as an unofficial FAQ list, at least of the issues and questions that I've needed to get answers to. Please note that questions not covered here should be directed either to the excellent support people at UKWSD or to one of the forums, though I am happy to put the answer here if you think it would benefit others. Web site log filesAre rotated each month so the old ones are lost. Use CPANEL to keep a copy by logging in to your CPANEL, click on "Raw Log Manager" and select "Archive Logs in your home directory at the end of each month" then save. You will then get a copy of last months logs which you can then analyse offline using something like the freeware Analog stats package. You DO get a full SMTP server with the hosting plans. To SEND email from a PC via your server, you will need to authenticate using your user name and password (the same one used for CPANEL). To COLLECT mail from your server, use a POP3 client (I really dislike the HORDE web mail tool that you get access to, it's slow and unwieldy). You can also use CPANEL's mail filtering tool to redirect emails to NULL (useful for spam) or to a script (useful for emailing information INTO a database - I need to add more details here). Email SPAM FilteringYou get SpamAssassin for SPAM detection. Do the basic configuration using CPANEL but if you want to do more, edit the user config file directly (/.spamassassin/user_prefs). SA is very powerful so check out the documentation. In particular, you can use one of the headers that SA adds to SPAM in the filter rules in CPANEL to re-direct mail either to NULL (to get rid of it) or to another mail address for checking. You can see more detail about configuring SpamAssassin in my Anti-Spam section under SpamAssassin. Controlling basic access and other Apache .htaccess stuffYou seem to get very comprehensive access to Apache and PHP settings in .htaccess files. In particular, you can use "modRewrite" to do all sorts of clever things. Here is one as an example (based on an early version of what I use on my site). # Override PHP include path to include std folder outside html doc path php_value include_path ".:/home/username/myinclpath:/usr/local/lib/php" # Add .htm files to php processed list to fool search engines # use .php & .htm for php processed, .html for static AddType application/x-httpd-php .php .htm # Ensure that .htaccess files cannot be accessed by web browser <Files .htaccess> order allow,deny deny from all </Files> # Ensure that PHP Include (*.inc) files cannot be accessed by web browser <Files ~ "^\.inc"> Order allow,deny Deny from all Satisfy All </Files> # Redirect errors: 404=No found, 500=Server error ErrorDocument 404 /common/404.php ErrorDocument 500 /common/500.php # Mod Rewrite clever things RewriteEngine on RewriteBase / # rewite spaces to underscores? NB: MUST BE 1ST RULE ##RewriteRule ^(.*)\ (.*)$ $1\_$2 [N] # Redirect pages that were correct on old site to correct pages on new site # NB: Better than redirect statement as non-case & non-host specific RewriteRule ^opalfaq\.htm|html$ /IT/OpalFAQ.htm [R,L] RewriteRule ^nepal1*(\.htm|html)*$ /Travel\ &\ Outdoors/Nepal.htm [R,L] RewriteRule ^nz1*(\.htm|html)*$ /Travel\ &\ Outdoors/New\ Zealand.htm [R,L] RewriteRule ^skiing(\.htm|html)*$ /Travel\ &\ Outdoors/Skiing.htm [R,L] RewriteRule ^walktime(\.htm|html)*$ /Travel\ &\ Outdoors/Walking\ Times.htm [R,L] # Handle broken browsers (that stop at spaces) RewriteRule ^travel(\/*)$ /Travel\ &\ Outdoors$1 [R,L] RewriteRule ^worship(\/*)$ /Worship\ Resources$1 [R,L] # Ensures that requests for index.html files are redirected to .htm RewriteRule index\.html$ index.htm Secure web access (SSL/HTTPS)The basic packages offer shared SSL which is accessed by offering your users a link
such as:
https://securen.speedynetwork.net/~username/
where n=the server you are hosted on (see cpanel) and
username=your user name. Using PHP to handle incoming mail automaticallyPHP makes it very easy to send email automatically but how about handling incoming emails.
If we could do this, we could have content included on the site by sending an email.
The good news is that this can indeed be done. First check out the tutorial
"Incoming Mail and PHP".
Fortunately, you do not need to mess about with changing the configuration of sendmail as CPANEL
provides this facility for us. Under "Email Management\Aliases/Forwarding\Add Forwarder", type in
an appropriate email name and in the last box put
|/home/<USERNAME>/<MYDIR>/<scriptname>.php
Where <USERNAME> is your UKWSD user id and <SCRIPTNAME> is the name of your script. <MYDIR> should
be the name of a folder OUTSIDE your web space (/public_html) so that it is not accessible as a web
page. Follow the tutorial from Step 2. Running a PHP scrip from CRONCreate a PHP script as follows:
#!/usr/bin/php
print 'hello';
Note the #!/usr/bin/php at the start, it is this that tells the Linux shell how to execute the script. Obviously, you will want to make your script a bit more complex. Upload this script to your hosting space. I recommend somewhere not under the "public_html" folder since that is visible to the whole world, you will want to keep your script safe. Create a folder under your root and put it in there. Next, set the permissions on the file to 755 so that it can be executed. Finally, use CPANEL to set up the cron job with the command pointing to: /home/<MYHOSTID>/<MYFOLDER>/myscript.php and set the output to go to an email address. To override the output to email, add a pipe to the end of the command such as ".../cron.php>/dev/null" which will send all output to oblivion, or .../cron.php>/home/<MYHOSTID>/<MYFOLDER>/cronlog.txt which will save the output as a file. If you do want to use a script from your public space, there is an alternative using the GET command as follows. GET http://hostname/file.php > /dev/null. But you must be careful what the script does as it is possible for anyone to execute this if they know (or guess) that it is there.
| |
![]() ![]() |
Page: Updated 2008-03-12 15:15:48, Author Julian Knight |