Tag Archives: Hosting - Page 2

CSS Style Overlaps, Duplicates, and Priorities

I sent most of this past weekend trying to get a nice looking responsive table to work. At first I tried to mess with it from scratch. Then someone recommended I look into Twitter Bootstrap. Wow, am I glad I looked into Bootstrap because that has saved a ton of frustration.

Okay, so I have the general framework but now need to make it look the way I want. I created my own custom CSS file and started “prettying up” the look over the table. I ran into a few things though that Bootstrap did by default that I didn’t like. The two big things were that I wanted the column widths a different size on 980px+ browser windows, and I wanted to get rid of the “padding” (technically a left-margin) between the columns.

So, being myself, I started to customize the Bootstrap file. After a while I realized this was a bad idea. So then I took parts of the Bootstrap CSS and moved (copied) it into my existing CSS file and started to modify things. Well, this got pretty messy quickly.

After sending out a tweet for assistance earlier today my buddy Joseph Guadagno lent a hand and pointed me in a much better direction. What I wound up doing was to revert all of my changes and then start overlapping CSS styles. I’m not sure if that’s the right terminology – I didn’t even know it was an option until today. Basically I’d set something like <div style=”style1 style2″> and both styles would be applied. That was great because I could have my formatting style applied and also the Bootstrap style for the responsive table. This was CSS lesson #1 for me today.

But while that helped clean up the mess I was creating, I still needed to override some settings that were in the Bootstrap CSS file. So I duplicated the same attribute but with a different setting to see whether mine or Bootstrap would take effect. Bootstraps did every time – even when I messed with the order of things. I have no idea what determines who wins a fight like that, but while trying to figure it out, I stumbled upon “!important”. What I found out that was when there are multiple values applied to the same item, you can set “!important” just after the value that you want to take precedence over any other values that might exist. Wow! This was CSS lesson #2 for me today.

So now this was great. I had my responsive table; it looked nice; and I could override the Bootstrap settings that I didn’t like and force them to take effect with my handy new “!important” statement.

Score! Now I wish I could have my weekend back. Can anyone help with that? :)

Brad on Google+

Does anyone manually install IIS anymore?

Microsoft has made installing – and doing the initial base configuration of – Internet Information Services (IIS) ridiculously easy by using the Web Platform Installer (WebPI).

Open WebPI, select Products in the top menu bar, then select Server in the left menu bar, then choose the IIS Recommended Configuration. What’s installed/configured with the IIS Recommended Configuration install?

  • ASP.NET
  • Static Content
  • Default Document
  • Directory Browsing
  • HTTP Errors
  • HTTP Logging
  • Logging Tools
  • Request Monitor
  • .NET Extensibility
  • Request Filtering
  • Static Content Compression
  • ISAPI Extensions
  • ISAPI Filters
  • WAS Process Model
  • Management Console
  • WAS Configuration API
  • WAS .NET Environment
  • .NET 4.5 Extended with ASP.NET for Windows 8
  • .NET 3.5 for Windows 8

Let WebPI install all these things for you and you’re pretty much ready to roll. A few other things you might want to install on your web server afterward (also through WebPI) are:

  • Web Deploy
  • URL Rewrite
  • FTP Publishing

Happy hosting!

Brad on Google+

Can you run WordPress on Windows? Sure, it works great!

Did you know that WordPress works – and works great – on Microsoft Windows? Sure, WordPress runs on top of PHP and MySQL, which are commonly thought to be related to Linux, but they work perfectly on Windows Server also. In fact, this blog post that you’re reading right now is running via WordPress on Windows, MySQL, and PHP.

Here’s a blog post by Artur at OrcsWeb showing a walk-through of installing WordPress on Windows Server.

As you can see in the post, Microsoft’s WPI (Web Platform Installer) makes it super-easy even for non-administrators.

Happy hosting!

Extend Your Linux Disk Space

I was pondering an interesting, and likely fairly common, situation last night so this morning I was up early getting my geek on (aka, playing, testing, and troubleshooting).

If someone has a Linux VM (cloud server or whatever) with a set size but then need to add more space to their system and make it usable, what’s the best way to do that?

The first though was to power down the VM, increase the size of the disk, then tinker inside of Linux to get the space expanded. I didn’t spend much time messing with this because the first few resources I found sounded very risky and painful – multiple reboots, deleting and recreating existing partitions, etc.

My second thought was to add a second disk to the system and then figure if it could be added seamlessly into the existing space. Well, guess what, it can!

So… first an assumption. I’m starting out with a CentOS server (running in VMware, not that it matters) that has a standard /boot mapped but then has the rest of the space in a logical volume currently mapped to /. I won’t be surprised if someone comments to tell me how that isn’t ideal, but hey, that’s how I was already set up and it works perfectly with my disk-expansion solution.

Here’s what my disk system looked like during the installation:

Initial CentOS disk configuration

So you can see that I started out with a 20 GB (20,480 MiB) drive, assigned 500 MB to /boot and the rest set as a logical volume group containing two logical volumes – swap of 2 GB and / with the remaining (almost) 18 GB.

Here’s what it looks like from inside the system:

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       18G  3.2G   14G  20% /
tmpfs                 495M  112K  495M   1% /dev/shm
/dev/sda1             485M   33M  427M   8% /boot

While some people might not like this, and perhaps for good reasons, I do like it because it seems to be the most flexible, with all of the space allocation to / I don’t have to worry about the size of /home folders or web content in /var or logs in /var or anything else. The space is available where needed.

Okay, so, I have a 20 GB drive and I want a total of 40 GB. Rather than increasing the size of the current drive I added a second drive from within VMware. The drive was added “hot” (while the VM was live online and running) but the system didn’t recognize the drive until after a reboot.

Once rebooted, the system showed the new drive (via fdisk -l) but it wasn’t in any usable state. I found a few resources online that said to run fdisk in interactive mode for the first step of preparing this new disk. I’m not a fan of interactive mode when using the command line so when possible I try to avoid it. After some research I stumbled on parted command, which allowed me to avoid fdisk in my process.

So, I’m going to just jump straight into it. Note that when I ran fdisk -l the new (unusable) disk showed up as /dev/sdb – you’ll want to double-check your own system to see how it gets assigned before running any of the following commands.

First I needed to create a new partition out of the idle drive that was sitting around unavailable. As mentioned earlier, my drive was showing up as /dev/sdb. Here’s the command I ran:

parted -s -a optimal /dev/sdb mklabel gpt -- mkpart primary ext2 1 -1

I then needed to create a physical volume on that new partition:

pvcreate /dev/sdb1

Next I needed to add the newly created volume to my existing volume group – the name of which (VolGroup) was specified during the install (and is shown in the image above) and is also noted in the df -h output.

vgextend /dev/mapper/VolGroup /dev/sdb1

Okay, now I need to actually extend the volume that I want to have the additional space (in this case, / – which I named “root” in LVM). To know how large to make the new volume, I had to check the existing group to see how much free space it had, and then check the existing volume to see how much space it was taking. I did this by running the two commands below and taking note of the number of extents reported.

lvm vgdisplay|grep 'Free PE'

That showed 5119 free extents in the volume group.

lvdisplay /dev/VolGroup/lv_root | grep 'Current LE'

That showed 4498 extents were currently being used by the “root” volume.

So, 5119 plus 4498 equals 9617 – which is the new size I want the volume to be – essentially telling it to consume all the available space.

lvresize -l 9617 /dev/VolGroup/lv_root

Now that the volume has been extended, the space still doesn’t show. One last step is needed and that is to extend the file system to take up all of the space in the volume:

resize2fs /dev/VolGroup/lv_root

After that last step I ran another df -h and got this output:

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       37G  3.2G   32G   9% /
tmpfs                 495M  276K  495M   1% /dev/shm
/dev/sda1             485M   33M  427M   8% /boot

From that output you can see that the / directory that was originally 18 GB above is now 37 GB. Yeah, I know, 37 GB-18 GB doesn’t equal 20 GB. That’s normal though and explainable but beyond the scope of this post. :-)

Happy hosting!

Manually Remove the W3 Total Cache WordPress plugin

I installed the W3 Total Cache plugin last night and enabled about 1/2 of the features. Everything seemed fine initially so I left it alone. Today I went to write a post and noticed my site was down. Yikes! No idea how long it was down because no one bothered to tell me (thanks for nothing readers! :>).

Since the last thing I changed was adding the W3TC plugin, I decided to remove that. Since I couldn’t get the site to load, I had to figure out a way to do this manually. Thankfully I stumbled across this post:

http://www.tech-recipes.com/rx/36504/wordpress-manual-uninstall-of-w3-total-cache/

I followed the directions there (minus the .htaccess steps since I’m running on Windows/IIS versus Linux/Apache) then killed all the PHP and W3WP processes related to my site that were running. They kept popping up new ones so I stopped the app pool, then tried again and was able to kill them all. After that I restarted the app pool and hit the URL – all better! Yeah!

I think I’ll avoid that plugin now. :)