17 May, 2012
Server uptime monitoring
20 January, 2012
Form submission with alert/confirm
In the form add a hidden field and submit button as follows:
<input type="hidden" name="confirm_delete" id="confirm_delete" value="0" />
<input type="submit" name="delete" value="Delete" onClick="confirmDelete(this.form);" />
Add a JavaScript function like this:
function confirmDelete(form) {Then you can handle the confirmed deletion by testing the hidden field
var answer = confirm("Are you sure you want to deleted this?");
if (answer == true) {
form.confirm_delete.value = 1;
form.submit();
}
}
if($_POST['confirm_delete'] == 1){
// do whatever needs doing
}
19 December, 2011
SEO advice
Use title and description meta-tags, ideally varied page by page. Google has an issue with multiple use of the same text for some reason.
Google ignores the 'keywords' meta tag but other search engines pay it some attention so it is worth keeping.
A good 'description' meta-tag is essential.
Also title could be a bit longer (up to 65 characters including spaces)
Get as many people as you can to link to you from blogs, other websites, articles and so on.
Let's see if that elevates c-a-mayer-memorial.org.uk
03 December, 2011
Yesterday's outage
30 November, 2011
Lysandra Press now live
03 November, 2011
Ajax
30 September, 2011
cPanel
05 August, 2011
New client
03 March, 2011
Morethanpictures.co.uk
28 July, 2010
Secure MySQL connection on Godaddy virtual dedicated server
mkdir mysql
then still in SSH change the ownership to the normal owner of the domain with
chown [user] mysql
Now open up the conf directory to the same user with
chown [user] conf
Go to your control panel and create these two files
1. a file in conf called vhost.conf (content below) and
2. a file in mysql called mysql.php (content below)
Finally, either in SSH Restart the server with
/usr/local/psa/admin/bin/websrvmng -a -v
or you can do it from control panel.
content of vhost.conf (where x is the domain)
<directory /var/www/vhosts/x/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/x/httpdocs:/tmp:/var/www/vhosts/x/mysql:"
</directory>
content of mysql.php
<?php
/*
THIS IS THE MASTER DATABASE CONNECTION FILE
IT SHOULD BE STORED ABOVE THE ROOT DIRECTORY IN MYSQL
AND SHOULD BE USED FOR ALL MYSQL CONNECTIONS
*/
mysql_connect("localhost", "[username]", "[password]") or die (mysql_error());
mysql_select_db("[database_name]") or die(mysql_error());
?>
To connect to the database add this in the relevant php scripts
include '/var/www/vhosts/[domain]/mysql/mysql.php';
Hope that helps someone save the time it took me to work it out...
27 March, 2010
Tjsoft.info revamp
Server upgrades
- httpd 2.2.8-1.fc7
- mailman 2.1.9-5.3
- mod_perl 2.0.3-9.1.fc7
- mod_python 3.3.1-3
- mysql 5.0.45-6.fc7
- perl-Apache-ASP 2.59-0.93298
- php 5.2.6-2.fc7
- plesk 9.3.0
- postgresql-server 8.2.9-1.fc7
- ruby 1.8.6.114-1.fc7
- samba 3.0.28a-1.fc7
- spamassassin 3.2.4-1.fc7
- SSHTerm 0.2.2-9.278624
- tomcat 5.5.26-1jpp.2.fc7
- webalizer 2.01_10-32
21 March, 2010
IE non-compliance
04 October, 2009
Upgrade to PHP5
12 February, 2008
crontab tips on GoDaddy
The objective was to create a single php script which a set of scheduled crontab tasks could execute from my GoDaddy virtual dedicated server. I wanted something that ran hourly, daily, weekly and monthly.
The steps I used were:
1. Create your script in the normal way. The key element is the $_SERVER['argv']['1'] variable, which is passed from the crontab line. You could pass more than one. The second would be $_SERVER['argv']['2']. You might add this for a checksum to prevent the script running if the search engines find it. I then used the first variable in a switch group to establish the start and end date for a MySQL query that runs later. So:
switch ($_SERVER['argv']['1']) {
case "hourly": // RUNS AT *:00
$d2 = date("Y-m-d H",time()).":00:00";
$d1 = date("Y-m-d H",strtotime($d2) - 3600).":00:00";
$num = 1;
break;
case "daily": // RUNS AT 00:20
$d2 = date("Y-m-d",time() - 24 * 3600);
$d1 = date("Y-m-d",strtotime($d2) - 24 * 3600);
$num = 2;
break;
case "weekly": // RUNS AT 00:40
$d2 = date("Y-m-d",time() - 24 * 3600);
$d1 = date("Y-m-d",strtotime($d2) - 7 * 24 * 3600);
$num = 3;
break;
case "monthly": // RUNS AT 01:00
$d2 = date("Y-m-d",time() - 24 * 3600);
$d1 = date("Y-m-d",strtotime($d2) - 24 * 3600 * 365.25 / 12);
$num = 4;
break;
}
$query2 = "SELECT *
FROM `".$type[$j]."`
WHERE DATE(`".$col[$j]."`) > '".$d1."'
AND DATE(`".$col[$j]."`) <= '".$d2."'";
2. Chmod this file to 'rwx r-x r-x' to allow it to be executed by the server.
3. Add a scheduled task like this:
10 0 * * * /usr/bin/php /var/www/vhosts/yourdomain/httpdocs/cron/alerts.php hourly
20 0 * * * /usr/bin/php /var/www/vhosts/yourdomain/httpdocs/cron/alerts.php daily
30 0 * * 1 /usr/bin/php /var/www/vhosts/yourdomain/httpdocs/cron/alerts.php weekly
40 1 1 * * /usr/bin/php /var/www/vhosts/yourdomain/httpdocs/cron/alerts.php monthly
I have the file in a directory called cron, but you can put it where you like.
Any HTML output your script creates will then be sent to the email address set in the preferences tab where you set up scheduled tasks. This is for error reporting so make your script produce no HTML if it is working fine.
17 November, 2007
Server migration complete for garfagnana-food and soane.net
30 October, 2007
Server migration
CPU GenuineIntel, Intel(R) Xeon(R)CPU 5148 @ 2.33GHz
Operating system Linux 2.6.9-023stab044.4-smp
Plesk version 8.2.1_build82070918.10 os_FedoraCore 6
I was forever running out of memory on the old one and this will give me more speed and a supported Fedora operating system (Core 6). Also added Plesk 8.2.1, which will give me a bit more functionality over domain hosting, etc.
Transferred my parked domains yesterday.
Will move the active sites over the w/e probably, before closing the old one. Meanwhile all should be as was on the old server.
Now I just need to get to grips with Plesk...