This is a pretty broad topic, and there is no way that I will be able to cover every facet of using indexes in your schema and queries in anything short of a small book, but the first step is getting your feet wet. I will be covering one of the most common causes for queries to run slowly, lack of indexes. This can cause simple queries to run slowly, but it has an exponentially increasing negative impact on performance when used on more complex queries, such as ones that use joins. In order to grasp this topic, it would be extremely helpful if you already have a basic grasp of how to use MySQL. Topics such as creating tables, and running queries should be pretty easy for you already. If you expand your basic grasp with some information on how to optimize those queries using indexing, continue on after the break. Read the rest of this entry »
So, I decided to reboot my Minecraft server mainly because it hadn’t been updated in forever, and there are several new things available in Minecraft with the recent(ish) updates, and I decided that to start nice and super clean, I would just start with a fresh server rebuild. I am going to be doing this on a virtualized server with 1.5GB of ram (java is a little memory hungry).
If you are looking for a way to set up a nice Minecraft server with some fancy schmancy web functionality, this is the article for you, more info after the break.
So this blog post is going to cover some basic security do’s and don’ts. The end goal will be to have an Ubuntu powered server that is not only decently secure, but also not so secure that it is a pain to work with. I will be covering many things that should be done as part of basic security, some general best practices, and I will also hit on one thing that I find to be a HUGE annoyance than many many… many… people do, thinking that it will make their server more secure, when in reality it does next to nothing. I will be targeting an Ubuntu 11.10 server in this article, but everything that I have in here should work on anything 10.04 LTS and up. I am mainly going to be focusing on securing SSH logins. Read on after the break
I have been an ubuntu fan for years now. I have worked as a server administrator on multiple distributions ranging from the Red Hat side doing admin work on RHEL and CentOS to the Debian side doing admin work on straight Debian and Ubuntu boxes and even doing admin work on BSD, Solaris and Suse. I also run a Linux distro on my home PC as well.
For production servers I am definitely a “use what’s stable and secure” kind of person but on my home desktop I tend to be more of a “bleeding-edger”. It is common for me to run beta versions of software, and sometimes even alpha versions, including my distro. Before Ubuntu 10.10 Beta1 came out I was running a minimal install of Ubuntu 10.04 that I then threw gnome-shell on top of… and I really liked it. After Beta1 came out I installed that and was very pleased to find that getting gnome shell on it was as easy as installing the gnome-shell package straight from the repository… everything worked amazingly. It was even possible to switch between Unity and gnome-shell from GDM (the login screen) which was something that never did work properly with gnome-shell in 11.04 (once you went to shell… unity was broken).
Read on to see my experiences so far with it! Read the rest of this entry »
So I am working on making a custom theme and set of plugins for a WordPress blog. I had the need to make sure that users that were logged in were using HTTPS and not just HTTP. I came up with a quick little function that will do just that. I added this block of code to the top of the themes header.php file within php tags and it gave me the desired effect:
// This forces logged in users to use HTTPS
if (is_user_logged_in() && ($_SERVER['SERVER_PORT'] !== '443')){
wp_redirect("https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
}
You may need to adjust the code a little depending on what web server you are running and what headers get set, but this is working great for me running on an nginx web server with PHP 5.3. Basically it just checks to see if the user is logged in and they are on a port other than 443 (443 is the port number used by HTTPS). If both of those are true then it redirects them to the HTTPS version of the page.
Granted you will need to have HTTPS working properly before you can use this, so you need certificates and a proper web server configuration.
Let me know if you have a better way of doing this. And no… the WordPress HTTPS plugin does not count. It is far too heavy for this requirement of just ensuring that all logged in users are on HTTPS at all times. If I needed more fine-tuned control then sure I would go for it
So I need to set up a git server for one of the projects that I work with, so I figured I would document how to do it properly. Even though I am a huge fan of the web server nginx, this server in particular is already set up with apache2 so I will be serving cgit through apache2. Perhaps later I will add in an nginx config for cgit.
I am using a resh install of Ubuntu 10.04 LTS with all updates applies for my testbed while I write this, but the instructions should apply equally well to all versions of Ubuntu up to at least 11.10 (when it releases) and likely versions afterwards as well.
As usual, this is going to be a long one, so catch the rest after the linkeration.. Read the rest of this entry »
Recently I built a server to host the blogs and other PHP powered websites of a few family members. I wanted something lightweight, efficient and fast. With that in mind I threw out the “standard” of Apache and it’s mod_php and instead went with something else entirely. This article is going to be geared at people running a server with Ubuntu 10.10 or newer (sorry LTS fans… php5-fpm isn’t available in your repos… but you can backport it fairly easily). I’m going to be including some config file examples as well, everything you need to get this up and running will be included… and it’s easier than you think
Catch the details after the break Read the rest of this entry »
Doing what I do for a living, I tend to see the same mistakes made over and over. Luckily where I work I am in a position to have a conversation with the person that made the mistakes, offer up a little bit of education, and most times they are very receptive to it. I am also in a position where I can help them to transition from their currently slow and possibly buggy solution to something that gives them the speed and performance that they want. This entire post is going to be targeted at Linux powered servers but many of the points will apply equally as well to Windows powered servers.
This one is a little bit long so if you want the full disk, click the link Read the rest of this entry »
So I just installed the WordPress app for webOS on my HP touchpad. Hopefully now that I can update this thing from anywhere I will post more.
First impressions so far are good. They have done a very nice job with it. The ui is very clean, it makes good use of cards and sliding panes. I can view the blog stats with it (had to install jetpack on the blog for that, but that’s not a big deal).
Now if I can just get people to stop thinking this thing is a friggin iPad, lol.
This will be a two part post, the first part will cover setting up a mail server to act as a local relay (or even relaying mail through an external server). This is useful for adding to a LAMP server (what a LAMP server is, and how to set one up is covered HERE). By the end of the first part, you will have a fully functional mail server which can be used for things like sending emails for user account password resets, new account creations, post notifications etc… This is a piece that you will likely need if you are running a website based on a framework such as WordPress, Joomla, PHPbb or one of many others. You will likely also need one if you are coding your own website from scratch as well.
This walkthrough will be targeted towards Ubuntu 10.04 LTS and my goal is to cover all of the basics to have your mail server be secure, and have some virus and spam protection. Later I will write the second portion which will turn your secure local mail relay into a full mail server with incoming and outgoing mail, mailboxes for users, etc.
It’s pretty long, so catch the link below to read it all.
Read the rest of this entry »