I wanted to check that suPHP was working correctly and executing scripts under a specific user id.

This little PHP script did the trick.

php echo ‘whoim = ‘.exec(‘/usr/bin/whoami’);

That echo’d (outputted) the result of running a file /user/bin/whoami

I don’t know why I’ve never got round to doing this before, but this handy guide will show you how to create an RSA key and stop having to authenticate with a password each time you try to SSH into your server.

https://help.ubuntu.com/community/SSH/OpenSSH/Keys

Suprisingly simple, and great when managing various servers.  Now, why didn’t I get round to doing this when I had 150+ servers in the mid 2000s.

Note:

When I ran into some problems along the way (due to not setting the permissions to 600 on the authorized_keys file, I used:

ssh -v user@host

To get a verbose output and find the problem.

Aside from having RAID-5 storage I want to make sure I have incremental, regular and automated backups in case anything goes wrong.  I will always delete something I shouldn’t along the way, or run a command and mess up some data.

For the MySQL databases I run, the AutoMySQLBackup project looks to be the ticket.

My setup as follows:

  • Mount a network share or create a folder for where to store the backups.  I have chosen a separate storage array for the backups and mounted it with NFS.
  • Download and install AutoMySQLBackup
  • After running and testing the results, add a job to the daily, hourly or whatever suits ‘Crontab’ to execute the process without your intervention.

I now have a regular, automated backup of my MySQL databases running on my Ubuntu server.

Tired of having to prefix command-line tasks with ‘sudo’ on Ubuntu?

sudo make

sudo make install

rm -Rf *

After logging in with your normal user account then type

sudo su – root

And type in the password.

Proceed at your own risk.

This problem keeps hitting me each time I install a fresh wordpress blog.

Not Found

The requested URL /home-network/ was not found on this server.

Every time I have to re-google until I find the solution.

For reference, I’m running Apache2 on an Ubuntu machine.

The content appears correct in the .htaccess file within the base directory:

<IfModule mod_rewrite.c>
RewriteEngine On RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php/$1 [L,QSA]
</IfModule>

The issue falls within /etc/apache2/sites-available/nameoffile.conf

The following must be modified:

AllowOverride None

to

AllowOverride All

You will probably only run into this if you’re a systems administrator, or if your web-host has not set this up correctly.  Changing the wording and issuing:

service apache2 reload

Did the trick for me.  If it didn’t, you wouldn’t see this page.

The following was kindly provided by my friend, James.  You can find his setup at www.donut-tech.com

I wanted to echo (read: output) some system commands to webpages over time.  James has done this as part of a wider project and provided the useful code for TOP.  The TOP command displays the processes running and the CPU and Memory commitments, amongst other things.

This code is for a .php page and will execute and return the outputs of /usr/bin/top

 

<html>
<head><title>Pi</title></head>
<body><h1>Pi</h1><br>
<pre><?
system(“/usr/bin/top -b -n 1”);
?></pre>
</body>
</html>