Archive

Archive for the ‘Technical Information’ Category

Install Composer on a Dreamhost VPS Instance

I have started to experiment with web development tools again and quickly ran into frameworks and tools which utilize Composer and there is mixed information on how to use composer with Dreamhost in a VPS environment, so I’m creating a blog post here. I’ll also add how to provision additional specific frameworks as we explore them as well.

  1. Through the Dreamhost console, verify which version of PHP you’re running.
    1. Domains > Manage Domain
    2. Look for the domain and you’ll see the PHP version, such as 5.6
  2. SSH into your VPS server
  3. The Phar extension for PHP must be enabled, do this by:
    1. verify you’re in the correct directory by typing “pwd”
    2. it should respond that you’re at /home/{{username}}
    3. Create a new directory “mkdir .php” – if you receive an error that it already exists, that is okay
    4. Move into that directory “cd .php”
    5. Now you’ll create a directory with the same name as your PHP version, in this case I’ll name it “mkdir 5.6”
    6. Move into that directory “cd 5.6”
    7. Now we’ll create (or edit) a file named phprc by typing “nano phprc”
    8. This will now have a full screen text editor, copy and paste the following into the editor:
      extension = phar.so 
      suhosin.executor.include.whitelist = phar
    9. To save changes you’ll press control-x, then Y, then {{enter}}
    10. You’ll be back at the command prompt.
    11. Test it by typing: “php -m | grep Phar” – the results should simply say “Phar”. If it just returns you to the command prompt without anything, then double-check your steps above.
  4. Enter the following to return back to your home directory: “cd ~”
  5. Now you’ll enter the website you want to use composer with, for example for my website http://www.sample.com you’ll enter “cd http://www.sample.com”
  6. Now you can install Composer here, or if necessary move into a subdirectory, if necessary.
  7. To install composer, simply type: “curl -sS https://getcomposer.org/installer | php”

Now to use it, whenever you are referred to use Composer, simply go into this directory and you’ll need to use the command “php composer.phar” followed by whatever you’ve been prompted to use composer for, such as:

  • You’re instructed to use:
    composer require twbs/bootstrap
  • What you’ll type is:
    php composer.phar require twbs/bootstrap

     

This is based on the assumption that you’ll only use Composer for one or two things, but if you’re a developer or will be using composer a lot of times, you’ll want to checkout how to make it available globally: https://help.dreamhost.com/hc/en-us/articles/214899037-Installing-Composer-overview

Note that about 90% of the information for this was based on that dreamhost.com hosted article, however how some finer elements were missing, and certain assumptions about using linux were made that not everyone will necessarily know. Additionally, the part about how to convert the composer call that most websites reference into the php composer.phar part is also missing.

 

Enjoy!

 

100,000 Mark

100thousand

I recently was reviewing some of the statics and discovered we have over 100,000 views not including search engine crawling. A couple of more interesting statistics:

Thank you to all of my readers who are enjoying all of the posts, and finding them valuable!  It has been a lot of fun sharing the technical information I have with everyone and helping give back to the online community which has taught me so much…

Also, just to throw this random tidbit out there… Beyond being an IT Professional, both on the network and systems side, as well as some management and director level experience. I have been working on the creative side with helping people plan vacations, and it is a lot more exciting and enjoyable than I expected. While it is only a part time gig, it is a serious and professional enterprise. So if you need any vacation planning or travel assistance (such as technical conferences), go ahead and check out my blog over at http://www.ReddingTravelPro.com

~ Enjoy!

XenServer – Pool Master Recovery (The Missing Part 1 to XenServer Hosts in Halted Mode)

In July of 2012 I wrote a “part 2” regarding XenServer Hosts in halted mode — however I seem to have misplaced part 1 – which I’ve rewritten after having to need to reference these steps again recently.

There are several events which can cause a XenServer Pool to become corrupt. In a recent instance of mine, the pool master was unable to communicate with the HA storage repository (SR) and fenced. I also had another instance where several shutdown unexpectedly, and the pool master was among them. Here are the steps I performed to recover the Pool Master.

  1. Work on recovering the pool, elect the server you want to become the master, and on that box run “xe pool-emergency-transition-to-master”
  2. Once that is completed, on the newly elected/transitioned master, run “xe pool-recover-slaves”
  3. Once that is complete, you should be able to run “xe host-list” and see all of your hosts listed

Enjoy

Based in part on information from: XenServer System Recovery Guide

Hung VM, unable to force reboot/shutdown

I have been working with a few vendor provided VM’s which run Linux. For some reason this specific set of Linux VMs do not properly respond when issuing reboot or shutdown commands when they VMs are hung. This is even true of force-shutdown. The following process works great for virtual servers that are non-responsive in a XenServer environment, after normal reboot/shutdown attempts have failed.

  1. “xe vm-list name-label={vm logical name}” to get the uuid of the VM that is hung
  2. “list_domains” to list the domain uuid’s so you can determine the domain # of the VM above by matching the uuids from this output with the uuid for your VM from the previous command.
  3. “/opt/xensource/debug/destroy_domain -domid XX” where XX is the domain number from the previous command
  4. “xe vm-reboot name-label={vm logical name} –force”

Enjoy

 

Based in part on information from: http://www.r2dtop.com/xenserver-6-virtual-machine-crash-and-hang-issue/

 

Sysinternal: Ctrl2cap

I am beginning a new series on the Sysinternal tools which is now part of Microsoft Technet tools. This series of posts will highlight both interesting and useful tools available as part of the Sysinternal suite of tools. The most common tool, and perhaps the most important is ProcMon, but we’ll get to that later. Today we’ll review the first tool posted, Ctrl2cap.

Ctrl2Cap was designed to help transition users from old Unix style keyboards where the control key is where the caps-lock key is on a standard windows keyboard. Installing this tool will capture keyboard inputs and will swap control and caps-lock keys to enable an easier transition for Unix administrators to a windows environment. I encounter the inverse-situation when I am at a Unix style workstation, or an AS400 and they are using a Unix style keyboard and am accustom to a standard windows keyboard layout.

Additional information directly from Microsoft on this tool:

On Win2K Ctrl2cap is a WDM filter driver that layers in the keyboard class device’s stack above the keyboard class device. This is in contrast to the Win2K DDK’s kbfiltr example that layers itself between the i8042 port device and the keyboard class device. I chose to layer on top of the keyboard class device for several reasons:

  • It means that the Ctrl2cap IRP_MJ_READ interception and manipulation code is shared between the NT 4 and Win2K versions.

  • I don’t need to supply an INF file and have the user go through the Device Manager to install Ctrl2cap – I simply modify the appropriate Registry value (the keyboard class devices’s HKLM\System\CurrentControlSet\Control\Class UpperFilters value).

More information and the download of this tool can be found at: http://technet.microsoft.com/en-us/sysinternals/bb897578.aspx

 

Some mail server networking best practices

I was reminded this week about the importance of some good best practices when handling the networking portion of a mail server. While a server or exchange administrator will do a great job handling all of the best practices of configuring the software itself, it is not uncommon for the networking portion to be overlooked. Here is a summary of a couple of networking or firewall related best practices…

  • Your Mail Server should be NAT’ed to an IP address different than your general internet traffic. This ensures that malicious activity taking place on your general internet traffic, or an infected pc, or even a guest system does not impact your ability to send email. If I guest laptop on your wireless network has a virus and is sending out spam, it might result in your IP address being blacklisted, and it will cascade onto your mail server. With a public IP address dedicated to your mail server, you can be assured that if you’re blacklisted, it is because of traffic through your mail server, and not from another source.
  • Block outbound port 25 from everything except your mail server. In general, the only device that should be sending mail outside of your network is your mail server, and if another device needs to send email, such as your MFP or other device, it should relay off your mail server, and not send out directly.
  • If you are using some form of hosted inbound spam or mail filtering, such as MXLogic or Reflexion, you should source IP filter your inbound port 25 traffic, or better yet, consider using an alternate port. If you don’t lock this down, it permits people to bypass your hosted mail hosting, and directly send spam to your mail server.
  • Ensure that your firewall has application aware protection in place for SMTP traffic, however if you have an older Cisco PIX firewall and an Exchange mail server, consider turning FIXUP off for SMTP since there is a long history of documented problems.
  • Be on the lookout for a mail administrator who assigns a public IP address on their mail server directly, thereby bypassing the firewall or other edge protection. If they really want to dual home the mail server, have them place it on a DMZ instead.

Enjoy

 

Disabled Mailbox is not showing in Disconnected Mailbox Area

May 21, 2013 1 comment

In Exchange, when you delete an active directory user account, it does not delete their mailbox automatically. Instead it considers the mailbox to be in a “disconnected” state. The mailbox exists but it is no longer associated to an active directory user account. There are several reasons why you might want to keep the mailbox around and perhaps eventually reconnect it. Today I was working on a very corrupt user account in AD, but the mailbox itself was fine. I simply deleted the user account from AD (after ensuring proper backups were taken), and then recreated a new user account. Now even though the username is the same as the one I just deleted, they contain a different GUID, so they are, in fact, different users. After creating the AD user account, I went over to the Exchange Management Console and the users mailbox was missing from both the Mailbox list, as well as the Disconnected list. The reason for this is because these are moved during a mailbox maintenance process. However you can speed this up.

 

Launch the Exchange PowerShell and run the following

Clean-MailboxDatabase

After that is complete, go back to the Disconnect Mailbox list and refresh the page, and you will find your mailbox.

 

Enjoy!