Monthly Archives: April 2014

Hosting a website on a personal computer

It is possible to host a website on a personal computer for testing purposes by installing the Apache Webserver, and accessing the site via the loopback address: http://127.0.0.1 or http://localhost.

If the computer is connected to a local area network, it may be possible to access the site using the host computer’s IP addresss – usually 192.168.XXX.YYY.  If the computer is connected directly to the internet, it may be possible to access the site on the web using the computer’s (external) IP addresss.  However, some internet service providers block web hosting from residential accounts.

For Mac users:

http://igerry.com/desktop/apple-os/enable-apache-web-server-os-x-mavericks.html

For Windows users:

http://www.wikihow.com/Install-the-Apache-Web-Server-on-a-Windows-PC

 

Irregular button shapes/transparency

Use transparency to create irregularly shaped buttons:

Examples – click the links then the icons:

http://imc.nigelalbrooks.com/logo/?page_id=5

Note: this site uses a custom theme that has been modified to display a logo:

http://wordpress.org/support/topic/how-to-add-a-logo-to-the-site-template

Tips:

http://studioconnections.net.au/Navigation/Navigation09/Navigation09.html

http://www.computerhope.com/issues/ch000979.htm

Example of code to upload a file to a webserver

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>

<?php
$target = “”;
$target = $target . basename( $_FILES[‘uploaded’][‘name’]) ;
$ok=1;

//This is our size condition
if ($uploaded_size > 50000000)
{
echo “Your file is too large.<br>”;
$ok=0;
}

//Limit file type condition
if ($uploaded_type ==”text/php”)
{
echo “No PHP files<br>”;
$ok=0;
}

//Check that $ok was not set to 0 by an error
if ($ok==0)
{
Echo “Sorry your file was not uploaded”;
}

//If everything is ok, try to upload it
else
{
if(move_uploaded_file($_FILES[‘uploaded’][‘tmp_name’], $target))
{
echo “The file “. basename( $_FILES[‘uploadedfile’][‘name’]). ” has been uploaded”;
}
else
{
echo “Upload a file to the website – limit 50MB.”;
}
}
?>
<br /><br /><br />
<html>
<form enctype=”multipart/form-data” action=”index.php” method=”POST”>
Please choose a file:<br /><br /> <input name=”uploaded” type=”file” /><br /><br /><br />
<input type=”submit” value=”Upload” /><br /><br /><br />
</form>
</html>

Note: security controls need to be built around this code.  This code is for .php server side processing.

Try it:

http://imc.nigelalbrooks.com/upload/

 

 

WordPress demo site

The WordPress demonstration site is at:

http://24.249.164.180/wordpressblog/

aliased as:

http://imc2.nigelalbrooks.com/wordpressblog – DNS record:

Screen Shot 2014-04-15 at 12.28.34 PM

 

aliased as:

http://lsvr.techknowpartners.com/wordpressblog – DNS record:

Screen Shot 2014-04-15 at 12.29.47 PM

techknowpartners.com main site – DNS record:

Screen Shot 2014-04-15 at 12.36.10 PM

nigelalbrooks.com main site – DNS record:

Screen Shot 2014-04-15 at 12.37.59 PM