Technology

Fixing and removing corrupted Apache configs in Plesk

Today I ran into an interesting problem with Plesk. It had gotten it’s Apache configuration so messed up that when you ran httpdmng reconfigure for any domain, it would throw errors about not being able to find include files. For example: apache2: Syntax error on line 227 of /etc/apache2/apache2.conf: Syntax error on line 7 of /etc/apache2/conf.d/zz010_psa_httpd.conf: Syntax error on line 15 of /opt/psa/admin/conf/generated/14099869670.15839100_horde.include: Syntax error on line 56 of /opt/psa/admin/conf/webmail_horde_bootstrap.conf: Could not open configuration file /opt/psa/admin/conf/generated/14099802590.70236400_domain_com_webmail.include: No such file or directory The fix for this involves some MySQL work. Go into the “psa” database in MySQL. You’ll see a “Configuration” […]

Fixing and removing corrupted Apache configs in Plesk Read More »

Iterators iterators iterators!

Managing lots of CloudFormation stacks can be a pain through the AWS Console. Stacks are paginated so you’ll need to keep clicking that “View more stacks” button until you get to the stack you want. Performing tasks through the AWS PHP SDK makes it a little easier, but you’ll still need to deal with tokens. Take the following code snippet for example: [code lang=php] $client = \Aws\CloudFormation\CloudFormationClient::factory($config); $stackstatus = array('CREATE_COMPLETE'); // First run $result = $client->listStacks(array( 'StackStatusFilter' => $stackstatus, )); $stacks = $result['StackSummaries']; $token = $result['NextToken']; foreach ($stacks as $stack) { echo "$stack[StackName] – $stack[StackStatus]\n"; } // Subsequent runs while ($token !=

Iterators iterators iterators! Read More »

Apache, Akamai, and True-Client-IP

You’re running a site behind Akamai, but can’t see the real client’s IP address, only that of your load balancer and/or Akamai’s IP addresses. Therefore you can’t act on it, ban IP’s….etc. Akamai does pass the true IP address of clients, but not through the standard X-Forwarded-For header. It uses one named True-Client-IP. Apache doesn’t understand True-Client-IP so it doesn’t pass this along internally to logging and other modules like PHP. There exists an Apache module named mod_remoteip which was introduced in Apache 2.4. A lot of sites don’t run Apache 2.4 yet as of the time of this article,

Apache, Akamai, and True-Client-IP Read More »

The one thing that will save the most battery

There are a lot of ways to get more battery time out of your iPhone. Turn off Airdrop, Bluetooth, Location services, Background App Refresh, so on and so on. While they do work, they don’t make a significant difference. The single most thing that will make a dramatic impact to your iPhone’s battery life i’ve found …… is the brightness setting. With it set at the lower 1/3rd end of the brightness bar in a brightly lit room, I can end a 16 hour day on around 44% battery life with my iPhone 5 (iOS 7). That’s with Bluetooth on,

The one thing that will save the most battery Read More »

P2V old linux distributions with VMware Converter

Just the other day, I had the “privilege” of P2V’ing some really old CentOS 3.7 and 3.8 physical servers. The process certainly had it’s challenges. Here is how I did it. Very old distributions of Linux will not support any of the virtual SCSI controllers provided to the guest by vSphere. You need to firstly convert the disks to IDE, then modify GRUB to boot the OS from the converted IDE disks. P2V the server When till the process is completes, or errors at at the end. We will now convert the disks to IDE. Edit the VM’s Settings and

P2V old linux distributions with VMware Converter Read More »

Scroll to Top