Creating virtual Servers in Apache2 using Webmin

I like Webmin. I can edit configuration files, but I have to confess that I don’t memorize the syntax and options, so I only edit configuration files when I need to copy and change something quick.

If I am going to start from scratch, then Webmin is my tool of choice.

I won’t cover in detail how to install Webmin, but here is the short version:

Using apt-get

sudo sh -c 'echo "deb http://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list' wget -qO - http://www.webmin.com/jcameron-key.asc | sudo apt-key add - sudo apt-get update sudo apt-get install webmin

If you use Yum:

(echo "[Webmin] name=Webmin Distribution Neutral baseurl=http://download.webmin.com/download/yum enabled=1 gpgcheck=1 gpgkey=http://www.webmin.com/jcameron-key.asc" >/etc/yum.repos.d/webmin.repo; yum -y install webmin)

I recently created a few WordPress sites, and I had to create the Virtual Servers for it, and I run into a tiny problem where it was not working correctly. It drove me crazy, but I took some notes.

Using Webmin is easy to create virtual Server. The process is documented in the Wiki at http://doxfer.webmin.com/Webmin/Apache_Webserver#Creating_a_new_virtual_host

However, we all know that we can’t read that much.

To create a Virtual host (virtual Server) go to Servers>Apache Webserver. Then click the tab that says “Create virtual host” (yes, to create a Virtual Server, you create a virtual host).

The options here are pretty simple. VERY SIMPLE!!

Handle connection to address. Basically this is for multi-homed servers more than anything. If you have an IP address per site, here is where you specify it.

Port: This is the tricky part. You would be tempted to put any right? Here most of the time you actually need to listen the port, which most of the time will be port 80.

Why? Well, because in my case I am using a specific server name, and in most cases you would too, so it seems to work better when you set the port instead of just using default (at least with WordPress).

If you need to use https, then you will have to have a certificate per site, and also a IP address per site. So that will change the previous setting. Adding SSL is similar, but the port would be 443, and you need to have mod_ssl enabled too.

Next enter the root location for the site (for WordPress for example it is /usr/share/wordpress).

After that enter the server name. This would be thisismywebsite.com for example

The Add virtual server to file section should be as it is. The default is to add to sites-available, and then it creates the link in sites enabled.

Finally you can copy directives if needed (this is useful when you have special folders, or if using SSL with a wildcard certificate).

Then click on Create Now, and then apply changes. Your site should be working now.

There are more settings, and it is a good idea to refer to Webmin documentation, or the Apache documentation for them, but my most used settings are

Alias and Redirects. I use it when I have sites located under a master root, but the folders are in other parts of the system. I do this a lot to save files in a separate partition.

In Networking and Addresses you can add alternate virtual server names.

Directory indexing is another section you might change, if you need to edit access to files.

Edit directives is basically a quick access to the configuration file for the site. So also useful.

That is it!!! Were you expecting something more complex? You can do more complex, but it is always good start simple, and then more from there. The 2 things to watch out for is port 80 instead of any, and dedicate an IP address per site when using SSL.

Of course there are a ton of configurations changes and mix and match settings, but this way you can quickly have multiple sites running.

Advertisements

Puppy Grub2 boot menu and Atom netbook

I have an Asus Atom netbook/tablet

http://www.newegg.com/Product/Product.aspx?Item=N82E16834220661

http://www.asus.com/Eee/Eee_PC/Eee_PC_T91MT/

Nice right? It has multi touch screen and windows 7 Home Premium so the multi touch screen actually works.

So, why install Linux? well, it work so slow on Windows 7

I wanted a Windows 7 tablet because that way I can install some software that we use at work that only runs on Windows, but it is so slow, that we don’t use the netbook. So finally I decided to put some new life into it and install Linux Mint 11.

Now, Linux Mint 11 works great, even the touch screen works. Not the multi-touch, and it is not perfect yet. The mouse pointer for example does not follow the screen, but at least the netbook is still useful. I even got Onboard (screen keyboard) working

Ubuntu with Unity on the other hand would have been better since the screen is made for tablet, but it would not install (problems with the Intel video drivers).

So, here comes Puppy. It works awesome. It runs fast. It does not work with touch screen except for the click itself, so it is not for tablets. What it does do, and does it really well is run fast. It boots up quick, it shuts down even quicker, so I don’t even need to put the netbook to sleep. I can just shut it down.

What I wanted was a quick Linux distro to browse the web, after all the network cannot do much more than that. I could run Puppy from a USB, or SD card, and have a persistent state since it was designed for that, but I don’t carry either with this netbook, and since it only takes about 500 MB (even less, but I installed more pets) I wanted in the hard drive (SSD drive), so I did a frugal install.

Unfortunately the frugal install has instructions for Grub, which is almost not used anymore.

Well, Grub2 I found out is actually easier to configure.

Simply go to /etc/grub.d/

in here you will see several files. These are the grub2 config files. Grub will load them in alphabetical order, starting with 00_header and so on. But the file we want to change is 40_custom, so open that file

$ sudo nano /etc/grub.d/40_custom

Add at the end

menuentry “Puppy 528 frugal on sda5” {

set root=(hd0,5)

linux /puppy528/vmlinuz psubdir=puppy528

initrd /puppy528/initrd.gz

}

EOF

That is all.

Of course, the menuentry is the name you want to give it in the boot menu. I like to put the version number and the drive it is booting from.

set root sets the hard drive that puppy is booting from. In grub2, the drives match now. sda5 is the fifth partition on the first drive drive. hd0 would be the first drive, and the ,5 is the fifth partition. So, if you installed puppy to sda3 it would be hd0,3, If installed in sdb2 it would be hd1,2.

The next 2 lines are the locations of vmlinuz and initrd.gz The one trick is the psubdir entry. I didn’t add it first and puppy wasn’t booting. But try it first without it

Remember to close the entry using } (you opened { after the menu entry)

The EOF (end of File) is also very important. Even if you have everything else right it will now boot without it

 

NOTE: This is an old post that I worked on a while ago. I now have Bodhi Linux in the netbook, which runs great, but I need to switch sessions to see the login screen (ctrl+alt+F1 and then ctrl+alt+f7 to go back to GUI)

How to Recover Files From a Dead Computer

Broken Laptop Screen
Broken Laptop Screen

I receive a newsletter from How-To Geek. It has a lot of good articles so I will share them as I see them.
DehcTech can do recovery of hard drives. We use similar techniques as described here, and we can also recover with recovery software when the data has been overwritten for example.
If you are familiar with computers than this tips will help you recover data.

(from How-To Geek)[Original Article]
Uh-oh, your computer isn’t booting anymore. Maybe it’s a problem with Windows, or maybe the computer’s hardware is fried. If you have important files trapped inside your malfunctioning computer, this guide will help you recover them.

There’s no guarantee your data is recoverable. If your computer isn’t working because the hard drive died, there may be no recovering the files — not without some sort of expensive professional data recovery service, at least

Continue reading “How to Recover Files From a Dead Computer”

PC Cleaning Apps are a Scam: Here’s Why and How to Speed Up Your PC

PC Cleaning Apps are a Scam: Here’s Why and How to Speed Up Your PC.

I get this question a lot, and I clean up a lot of computers after users use a cleanup tool.

Anyhow, this article has it explained simple and quick, and even shows what to do if you want to really speed up your PC.

Defragmentation is automatically scheduled in Windows Versions newer than Vista.

I want to remind you, that the best way to keep your PC running fast, is not to have unnecessary programs, making sure it is up to date, and running antivirus and antimalware often.

Computers will get a little slow over time, just because the Operative System (Windows/OSX/Linux) has updates and gets heavier, but also because our perception of what a fast computer is.

10 years ago web pages were 10 time smaller than they are now. So even web browsers are getting heavier.

Solving problems the analytical way

We all have problems, and worst, we have problems all the time. Our life itself is a problems. However problems are not negative. Problems are challenges, they makes us think, and best of all, it keeps our lives interesting. However the word “problem” has unjustly being associated with a negative situation for a long time. Why is it that we think about problems only when we can’t solve them. We are taking decisions constantly, and these are problems. We are usually analyzing these decisions to take the best action, hence we are doing problem solving.

Computer seems to have a very bad rep with problems. People say, “I have a problem, my computer won’t start up!” I say, we have a challenge, we have a computer that is refusing to start up and we will find out WHY!

This is a little chart describing engineering problem solving

Please, don’t try to use WD-40 inside the computer, although I have used WD-40 to rejuvenate rollers in copier (we are talking $15K printers, where we fix paper jams with just WD-40).

However the flowchart does bring up an excellent point. When we take the analysis of the problem to the simplest term, it get easier. Here is were people get frustrated. Lets talk about the computer problem. And this is a real case that happen to me.

Phone call…..ring, ring

User: David, My computer is not working, I need you to come here and fix it.

David (me): I can’t come, you are 2 hours away, and unfortunately I have a lot of work today, what is the problem exactly?

User: The computer is not working! I told you already. I don’t understand computers (and I don’t want to deal with it) [the last part is what I heard “between the lines”]

David: Ok, give me a minute while I check some things.

At this point I was a little upset with the response that I received. I am helping the user, but I need him to help me help him. Think about this when you call for support Winking smile

I go and get a cup of coffee, and while I am doing that I am relaxing and thinking…Ok, so the user is frustrated, he probably won’t help unless I can calm him down, what can I do first?…….Lets check to see if the computer is really not online, and check the router remotely, and see if I can find anything in the log archive….Do I have a log archive for that PC?…

So, here I go back to my desk and check the computer to see if it is online (logmein) and sure it is. So I connect to it and it is working. So now I pick up the phone

David: Ok, I can see the computer online and working. Do you still don’t see anything on screen?

User: NO! The COMPUTER IS NOT WORKING!

David: Ok, but it is possible the computer is working and something else is not working. Do you see the box that has the CD-ROM? Does it have LED lights on? probably green?

User: I don’t know, it is under the desk with a mess of cables papers and boxes.

David: I think it would be a good idea if after we get the computer working fine if you clean around the computer, this way you can access it faster in case you need to put a DVD in, or to turn it on. Also this way it is easier to clean, and when the computer is clean it runs faster (This is true BTW, dirt gets stuck in fans and vents, which causes the computer to overheat and then slow down)(also note how I pointed out that doing this will benefit the user, it is an option)

User:  Ok, give me a minute while I clean the area. I will put you on speaker phone

David: Great, I will wait. While you are doing that, could you also check if the monitor is on, the power cable to the monitor is connected, and that the cable to the monitor is secured in the back of the computer?

User: I will check, but the first thing I did was turn on the monitor, on and off a couple of times and always complained about no signal

At this point I already knew what was the problem…Do you?

About a minute later I hear, there are lights on this part of the computer. I will move it to see it better…..

I hear a couple of knocks, and about 5 minutes later …

User: Thanks for your help David. I am sorry to have bother you. I got it working

So, what was the problem? The monitor cable was not connected to the computer. Computer was working, Monitor was working. But there was no image. The problem was that the user had a predetermined attitude about computers “I don’t understand it, I don’t want to work on it

With computers or anything else in life, this attitude can lead to frustration. For example I am not a mechanic, but that does not mean I do not check the tire pressure, and fluids level in my car. You only need common sense for that. However I know a lot of people that don’t and won’t check the bare minimum in a car. The car is a tool, and you need to know how to use it. Same with the computer (except that most likely you won’t kill someone for not using it correctly)

Another analytical problem that amuses me what people say is when they tell you “I don’t know where to connect this cable to and what is a USB?”

Simplified but true. USB have a specific shape (then there is blue USB, which is USB 3), network cables (the blue cable here) has a specific shape, and the speakers, well it is another common and specific connector.

The issue here is that people get intimidated by the amount of connections, but you need to connect them the same way a professional does, grab one cable at a time and connect it where it fits well, unless you are OK with paying a minimum of $60, plus trip to a technician to come home and connect it.

The consortiums that set the shape of the connector actually do a lot of research to make sure the connectors are unique.

With that I leave you with this summary. Problems are there to be solved. Simplify it, analyze it, and most likely it will be something simple the solution that will save you time and money.

I know I joke a lot about it, but a lot of “issues” that reach me, could have been solved in less than 5 minutes if the user had simplified the problem. At the very minimum, this will help you to be in a better mod when you need to ask for help, either from IT, tech support, sales, or even customer service at the grocery store

Office solution: How to quickly add numbers in Word without a table

From TechRepublic

Last week, we were looking for a quick and easy way to add values in a Word document, without resorting to a table and table formulas. It would be nice if Word displayed the sum in the Status bar, similar to Excel. Well, it does!

Msphoto was the first to mention the Calculate command, which is the solution I had in mind. It isn’t readily available, so some users don’t know about it. You can use Calculate to sum a series of values when you don’t need a more complicated solution, such as a table or linking to Excel. Fortunately, it’s easy to add the command to the QAT (or Quick Access Toolbar):

  1. Choose More Commands QAT dropdown.
  2. In the resulting dialog, choose All Commands from the Choose Commands From dropdown.
  3. Select Calculate from the resulting list.
  4. Click Add and then click OK. Word will add the command to the QAT.

If you’re using Word 2003, do the following to add the Tools Calculate command:

  1. Choose Customize from the Tools menu.
  2. Click the Commands tab and choose All Commands from the Categories list.
  3. Choose ToolsCalculate from the Commands list.
  4. Drag ToolsCalculate to the toolbar.

To use the Calculate (Tools Calculate) command, you’ll need a series of numbers. Simply separate values with a comma, select the values, and then click Calculate to display their sum in the Status bar (which temporarily usurps the other indicators). You can also press [Ctrl]+V to paste the sum into your document.

New Year, New You – Managing and sharing your photos

I am trying to clean up my PC at home a little and organize pictures, so I did a little search and I found this.

While not exhausting it has great tips to accomplish things quickly and we like that Smile

From the Windows Experience blog

I have over a decade’s worth of digital photos on my PC. I love taking photos. I love capturing the moment where ever that might be – with friends and family over the holidays or out in the middle of no-where in eastern Washington State. Most people have tons of digital photos on their PC scattered around – and Windows Live Photo Gallery makes it super easy to manage those photos, edit them, and then share them out to anyone you want. In a post earlier today, Kristina shared 3 super easy tips for shaping up your technology habits in 2012. She included a tip on the batch people tag feature in Photo Gallery. I thought I would share a few more tips specific to Photo Gallery that will help you better manage your photos in 2012!

Tip #1: Organizing

By default, whenever you import photos into Photo Gallery from your camera, it puts the photos in your “My Pictures” folder under your user profile in Windows. I like to keep ALL my photos in this folder. And Photo Gallery makes managing this folder of your photos super easy – allowing you to create sub-folders and to drag and drop your photos into any folder you like. You can organize your photos exactly the way you want them to be organized on your PC. By default, when you import photos from a camera in Photo Gallery, it creates a folder with whatever you name the photos you are importing. For example: if you name the photos you are importing “Beach”, a folder called “Beach” is created with those photos inside. For a lot of folks, this might work out fine. But for me, it doesn’t. For me – I like to have everything organized by date.

3

So I change the default behavior by clicking on “More options” on the “Import Photos and Videos” screen.

2

For “Folder name”, I change it to be “Date Taken + Name”. That means for any photos I import from my camera in Photo Gallery, Photo Gallery will detect the date taken from the camera and combine that date with whatever name I give the photos I am importing. For example: if you name the photos you are importing “Beach” and they were taken on 1/3/2012, a folder is created called “2011-01-03 Beach” with those photos inside. This allows me to automatically organize any photo I import from my cameras in Photo Gallery by date! In the left-hand navigation you’ll see something that looks like this:

4

Tip #2: Panoramic Stitch

I love creating panoramic stitches in Photo Gallery. Everywhere I go with my camera, I am always thinking about what series of shots will make the best panoramic photo when stitched together. Creating a panoramic stitch is easy:

1. Where ever you’re at with your camera, just stand in one spot and pan from left to right taking a series of photos one by one.

2. Then, import your photos into Photo Gallery from your camera.

3. Select the series of photos you took at that spot go to the “Create” tab in the ribbon at the top of Photo Gallery.

4. Click the “Panorama” button.

And Photo Gallery will stitch together your photos and create a panoramic shot. Now, after your panoramic stitch is created, it might look like this (notice the black areas around the borders?):

DSC02020 Stitch

The black areas can be easily removed by simply using the “Crop” feature in Photo Gallery under the “Edit” tab in the ribbon. You can crop your panoramic stitch however you like.

1

The end result should be something like this:

DSC02020 Stitch (2)

Creating panoramic stitches is something that can be done with almost any camera – from a little point-and-shoot to a DSLR. You can even use photos from your Windows Phone and stitch them together too!

Tip #3: Sharing

Organizing and editing your photos is just one element to Photo Gallery. It also makes it easy to share those photos with the people you want to share them with. You can share your photos to Facebook, Flickr, or of course SkyDrive simply by choosing any of these options under the “Share” section of the ribbon on the “Home” tab in Photo Gallery. Early this last summer, we introduced a major update to SkyDrive (and it wasupdated again this last fall) to make it the best place to access and share your content – including your photos.

5

SkyDrive displays your photos in a “mosaic” layout and displays the photos in their original aspect ratio. There also infinite scrolling – meaning for folders in SkyDrive with tons of photos, you won’t have to navigate from page to page!

6

When you click on a photo, it puts the photo front-and-center – displaying your caption (description of the photo), tags, comments and more!

7

SkyDrive is an absolutely awesome way to share photos with friends and family!

I hope these tips help you organize and share your photos with Windows Live Photo Gallery, your PC and SkyDrive in 2012. Download Windows Live Photo Gallery today!