Category Archives: Server Administration

phpmyadmin: Drag And Drop File Upload

I use phpMyAdmin to manage mySql databases quite often and I find myself uploading / importing SQL files. I’ve gotten a little spoiled with WordPress’ HTML5 drag and drop ajax style uploader. Every time I go to use phpMyAdmin I start wishing that it had a HTML5 style drag-and-drop file uploader, something like this: I think it would be fairly easy to write a plugin and implement this idea but I have not done it yet. Leave a comment if the lack of a drag and drop HTML5 file uploader for phpMyadmin bugs you too.

Posted in Server Administration, Tech Opinion, Web Development | Tagged , , , , , | Leave a comment

Nagios: Monitor SSL Certs

Nagios has the ability to monitor SSL certificates for expiration. Here’s how to do it: Steps for Nagios to Monitor SSL Certs Download the check_ssl_certificate plugin from the nagios exchange site Update:A better / updated version of the plugin is available for download here ( it is mentioned on previously mentioned nagios plugins page ) Installation: Edit the script, replacing the line: use lib “/usr/lib64/nagios/plugins”; with the path to your nagios plugins directory (where utils.pm is located). For me on Ubuntu 10.04 this was use lib “/usr/lib/nagios/plugins”; Also edit the line: my $openssl = “/usr/bin/openssl”; with the path to your openssl binary. Then copy the script into your nagios plugins directory, for Ubuntu 10.04 it was /usr/lib/nagios/plugins I also updated line 155 – 158 of the script, because it has a bug that allows expired certificates to show up as passing: if ($daysLeft < 0) { print “$PROGNAME: CRITICAL – $cn expired ” . abs($daysLeft) . ” day(s) ago.\n”; exit $ERRORS{‘CRITICAL’}; } elsif ($daysLeft <= $critical) { The key part is adding in this line: exit $ERRORS{‘CRITICAL’}; To monitor a site, you will need to set up a configuration, using something like this (edit to suit your needs): define command { command_name check_ssl_certificate command_line /usr/lib/nagios/plugins/check_ssl_certificate -H $HOSTNAME$ } define service{ use generic-service host_name www.yoursite.com service_description check ssl check_command check_ssl_certificate contact_groups admins }

Posted in Server Admin, Server Administration | Tagged , , , | Leave a comment

STOMP Server

A STOMP Server is a “Streaming Text Oriented Messaging Protocol” server. A STOMP Server provides an interoperable wire format that allows STOMP clients to talk with any STOMP Message Broker supporting the protocol. STOMP is thus language-agnostic, meaning a broker developed for one language or platform can receive communications from client software developed in another language. From wikipedia

Posted in Server Admin, Server Administration, Software, Web Development | Tagged , | Leave a comment

AWS Marketplace Launches

The other day I was looking at the Bitnami stacks and was thinking how incredible it is that you can create an amazon AMI image and share, deploy, and instantly launch a web server. This has interesting repercussions for software and copyright holders, imagine installing a licensed operating system like Redhat or Microsoft Windows and then giving hundreds of thousands of others the ability to instantly clone it. Oops. Amazon Web Services is pleased to announce AWS Marketplace, an online store where customers can find, buy, and quickly deploy software that runs on AWS. AWS Marketplace includes pay-as-you-go products, free software (AWS infrastructure fees still apply), and hosted software with varied pricing models. CA Canonical Couchbase Check Point IBM Microsoft SUSE Red Hat SAP Many widely used open source offerings, including WordPress Drupal MediaWiki This certainly will make software as a service companies and providers – I’m thinking cheap web hosting for wordpress, for example, have to take another look at their product / services model and pricing tiers. You’ll be charged for what you use, by the hour or month, and software charges will appear on the same bill as your other AWS services. When you find the software you’d like to purchase, you can use AWS Marketplace’s 1-Click deployment to quickly launch pre-configured server images, or deploy with familiar tools like the AWS Console.

Posted in Linux, Marketing, Server Admin, Server Administration, Software, Tech Opinion | Tagged , , , , | Leave a comment

fix “max_allowed_packet” on MySql

MySQL Error 1153 – Got a packet bigger than ‘max_allowed_packet’ bytes To fix this I ran these two commands in mySQL before executing the queries that were giving me the error message about the max allowed packet bytes. set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;

Posted in Server Admin, Server Administration, Tech Tips, Web Development | Tagged , , | Leave a comment

iPower: The server encountered an unexpected condition which prevented it from fulfilling the request.

iPower: The server encountered an unexpected condition which prevented it from fulfilling the request. If you’re getting this error on iPower you need to enable CGI / scripts. Sometimes your account will show you that this is enabled, even if it is not. Contact iPower support to get them to resolve it for you. Even if in your control panel homepage CGI / PHP is showing up as active, click on the server configuration tab and you probably will see that CGI is in fact inactive:

Posted in Server Admin, Server Administration, Web Development | Tagged , , , , , , | Leave a comment

LookupException in API_Linux.cpp:98: Could not lookup username “wwwrun”

In order to get suPHP to run you’ll need to edit the config file, which is by default stored in /etc/suphp/suphp.conf If you’re getting the error LookupException in API_Linux.cpp:98: Could not lookup username “wwwrun” it means specifically that you probably have not uncommented the line webserver_user in that config file. If you’re on an Ubuntu server you will probably set that line to www-data but on other systems it perhaps needs to be set to apache or nobody. You can view your list of users by using the command cat /etc/passwd, which will give you several lines in this format: www-data:x:33:33:www-data:/var/www:/bin/sh If you’re on Ubuntu you should see the line above, which shows the entry for the user www-data which has a user id and group id of 33 (the first two numbers). If you see that then you should probably change your suphp.conf file to have the webserver_user set to www-data and also you should change the Minimum UID and Minimum GID to the matching numbers, probably 33 and 33… webserver_user=www-data ; Minimum UID min_uid=33 ; Minimum GID min_gid=33 A decent guide for setting up suPHP on Ubuntu 11 can be found at http://websoftserbia.com/en/ubuntu/66-install-suphp-on-ubuntu-11-04.html I would recommend walking through that guide first, so you know what you’re doing, but I’ll also give you an example of a configured suphp.conf file: [global] ;Path to logfile logfile=/var/log/suphp.log ;Loglevel loglevel=info ;User Apache is running as webserver_user=www-data ;Path all scripts have to be in ;docroot=/var/www:${HOME}/public_html ;Security options allow_file_group_writeable=true allow_file_others_writeable=false allow_directory_group_writeable=true allow_directory_others_writeable=false ;Check wheter … Continue reading

Posted in Linux, Server Admin, Server Administration, Web Development | Tagged , , , , | Leave a comment

ec2 server create syntax (man page)

This is the knife create syntax page. I was trying to launch an instance of Chef with the “knife create” command that chef’s knife provides. The documentation page gives this example for how to launch a web server on Amazon’s EC2 server, but without much explanation of the terms: knife ec2 server create -r “role[webserver]” -I ami-2d4aa444 –flavor m1.small -G www,default -x ubuntu -N server01 After doing some searching I just ended up digging into the code and found this information quite helpful, and so I am sharing it: -f FLAVOR ( or –flavor FLAVOR ) The flavor of server (m1.small, m1.medium, etc) default: m1.small -I IMAGE ( or –image IMAGE ) The AMI for the server -G X,Y,Z ( or –groups X,Y,Z ) The security groups for this server default: “default” -Z ZONE ( or –availability-zone ZONE ) The Availability Zone default: us-east-1b -N NAME ( or –node-name NAME ) The Chef node name for your new node -S KEY ( or –ssh-key KEY ) The AWS SSH key id -x USERNAME ( or –ssh-user USERNAME ) The ssh username default: root -P PASSWORD ( or –ssh-password PASSWORD ) The ssh password -i IDENTITY_FILE ( or –identity-file IDENTITY_FILE ) The SSH identity file used for authentication –prerelease Install the pre-release chef gems –bootstrap-version VERSION The version of Chef to install -d DISTRO ( or –distro DISTRO ) Bootstrap a distro using a template default: ubuntu10.04-gems –template-file TEMPLATE Full path to location of template to use –ebs-size SIZE The size of … Continue reading

Posted in Linux, Server Admin, Server Administration, Tech Tips, Web Development | Tagged , , , , , , | Leave a comment

10 Amazon EC2 Alternatives

Amazon EC2 Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is dersigned to make web-scale computing easier for developers. Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment. Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change. Amazon EC2 changes the economics of computing by allowing you to pay only for capacity that you actually use. Amazon EC2 provides developers the tools to build failure resilient applications and isolate themselves from common failure scenarios. http://aws.amazon.com/ec2/ Digital Ocean Deploy an 512MB RAM and 20GB SSD cloud server in 55 seconds for $5/month. Simple, fast, scalable SSD cloud virtual servers. This competitor was recently featured on Uncrunched and the site boasted, “Digital Ocean v. AWS: 10x Performance For 1/3 Cost”. I am floored at how fast their servers are (if you know linux try doing something like du or updatedb or even find / -iname “*firefox*” – each command takes about 1 second! https://www.digitalocean.com/ Slicehost / Rackspace Create Cloud Virtual Servers in minutes and pay per usage. Get a Windows or Linux Cloud Server with root access. 1 to 50 servers in minutes. Choose a server size and pay for what you use. Accessible … Continue reading

Posted in Server Admin, Server Administration, Tech Opinion, Tech Tips, Web Development | Tagged , , , , , , , | 8 Comments

How to Monitor Canon Printers with SNMP

I’m working to set up monitoring of Canon printers with SNMP, and I’m having a hard time finding resources around the internet on how to go about doing this, so this article will be collecting the resources I’ve found and putting them in once place. Commands for Monitoring Canon Printers with SNMP One of the problems that I had to look into was monitoring of CANON printers, and properly modifying Nagios config files for that: Once you understand a little how NAGIOS works you will understand what I am trying to show you here in example: in /usr/local/nagios/etc/objects/commands.cfg I added a command: define command{ command_name check_snmp_canon command_line $USER1$/check_snmp -H $HOSTADDRESS$ -l STATUS -C public $ARG1$ $ARG2$ } then in: /usr/local/nagios/etc/objects/printer.cfg you define host and service like this: define host{ use generic-printer host_name SOMECANONPRINTER alias SOMECANONPRINTER Alias address “IP of the printer goes here” hostgroups network-printers } define service{ use generic-service host_name SOMECANONPRINTER service_description Printer Status check_command check_snmp_canon!-o hrDeviceStatus.1 -r “2|3” normal_check_interval 10 retry_check_interval 1 } via http://mariuszgal.com/blog/?p=93 Some of the commands I’ve tried to execute directly from the command line use something like this: /usr/lib/nagios/plugins/check_snmp -H 192.168.0.105 -C public -o hrDeviceStatus.1 snmpwalk -v <snmp version, typically ‘2c’> -c <community string> <agent address, e.g. ‘192.168.3.141’> 1.3.6.1 snmpwalk -v 2c -c public 192.168.0.104 What is SNMP Simple Network Management Protocol (SNMP) is a set of standards for managing network devices, network devices are monitored by a SNMP manager which connects to an SNMP agent on network devices. Data which the SNMP agent … Continue reading

Posted in Linux, Server Administration, Tech Tips | Tagged , , , , , , , , , | 8 Comments