Centos

XDebug your IDE

in xdebug, PHP, Linux, centos, Apache, phpstorm

With most languages, when you develop you get the (wonderfully helpful) option of setting breakpoints, stepping through your code, adding watches and inspecting the overall state at any specific point in time. PHP differs in that, being a scripted language hosted in another process (eg Apache) it normally doesn't offer that. Here's how to enable your IDE to do get all the nifty features.

Read more »

Managing Windows server DNS records from Linux commandline

in dns, Linux, centos, windows, active directory, PHP

I've been in the process of automating the creation of Apache VirtualHosts from the command line for some time now. What always annoyed me, was that after the vHost was generated, I had to manually add the DNS entry on our Windows server. Well…. No more!

Read more »

CentOS 7 server installation

in centos, centos 7, Linux, installation, guide

CentOS 7 is out, and it brings some much needed features for web developers! For starters, MySQL is replaced by MariaDB (much better performance for InnoDB, and a better client), and PHP is 5.4 out of the box. In addition, multitudes of tweaks have been made to the system, making it more responsive.

The following is a guide (with screenshots) for installing a basic LAMP stack with the new OS, on an empty machine (in this case, a virtual machine), using the NetInstall image (Minimal is not yet available, but being worked on).

Read more »

Why is my system CPU so high?

Had some performance issues with a client, recently. The server is an absolute beast, and should be able to easily handle the single website hosted on it. Alas, pages took forever to load (D7). A simple top showed that load was at about 60, and CPU utilization was at 10% for user and ... 95% for system. Wait what?

Read more »

Upgrading Redmine to MariaDB

in Redmine, ruby, MySQL, centos

On a stock CentOS installation ( DB wise, ie MySQL 5.1 ) we decided to roll out MariaDB. And it was wonderful, as all our LAMP apps didn't even seem to notice that something has changed. Not the same could be said about Redmine though...

Read more »

Recovering InnoDB tables from ibd and frm files

in MySQL, innodb, recovery, Linux, centos, ibd, frm, shell

First day of the year in the office, and a call came up "site isn't working". Browsing to the site, I noticed it couln't connect to the database. Thinking it was probably some glitch, I logged in remotely to the server, to find that the filesystem was readonly. After trying to figure out why me, being root, could not do anything to the filesystem... it rebooted. My first filesystem crash.

Read more »

Protecting your cache folders

I spent the past few days in the VERY unpleasant situation where I had to remove tons of spam-sending scripts from a couple of websites I host. These were in relation to unsecured, unmaintained Joomla! installations, and exploited the cache folder. I won't bother you with the why or how, just know that the vulnerability existed, and has been fixed for versions 2.x and up -- NOT 1.x. Here's the simple way to secure yourself without changing the Joomla site code.

Read more »

Debugging Active Directory in CentOS

Having a Linux server querying Windows Active Directory for credentials gives your users a wonderful, unified experience - they only need a single logon for the intranet, and their machine. However, sometimes you need to browse the AD tree to see if/what is going on. Two things I've learned while debugging follow.

Read more »

Making a connection from PHP to Oracle in CentOS 6.4

in PHP, oracle, oci, centos, 6.4

There are times, when you need to make your app(s) work in a corporate environment. And when you combine corporate with databases, you usually end up with Oracle. In my case, I need to make a connection from PHP 5.3 ( CentOS default ) to Oracle 11g (on a different host). With some luck, this will help others trying the same.

Read more »