Virtualization

Today instead of an “Operation” we will do a more normal Blog post and the topic is Virtualization. So what does Virtualization mean? Well first something that is Virtual is like the real thing but not quite. Like a reproduction of a famous painting it’s not the original but still looks good. Another term you hear associated with Virtualization is Virtual Machine . A Virtual Machine is a Virtual computer. It’s not what you see next to your desk and you don’t have a physical way to turn on a Virtual Machine. A Virtual Machine is like any other program you have on your computer.  Like any program you double click an icon on your desktop and Voilà a virtual computer starts running within your computer. In the window that pops up after you double click the Virtual Machine you will see a computer booting up, just like when you start your real computer!

So why on earth would I want a Virtual Computer when I have the real thing?

Advantages of Virtual:

  • You can have many different computers on one computer.  More specifically you can have many different Operating Systems running on one computer.  So if you want to try out Macintosh® but your physical computer is a Windows® machine you can install a virtual Macintosh® to try it out!
  • Virtual Backups are easier than a real computer backup.  To backup a Virtual Machine is as easy as backing up a File.
  • Portability; once you backup your virtual machine to a file you can then take your virtual machine backup file and go run it on your friend’s computer.  Every thing you keep in the virtual computer will be accessible!

Disadvantages of Virtual:

  • Virtual computers aren’t as fast as real computers.  Because the virtualzation program has to make a virtual home for your new Virtual computer (Virtual Machine) it takes away some of the computer’s raw power.  This is particularly noticed in resource intensive tasks like playing a video game.
  • Vendor Lock in.  Your Virtual Computer will only run on one Virtualization software package.  So if you want to share your computer with a friend they would have to install the same Virtualization Software.  The good news is there are many free Virtualization software packages.

I want to play with Virtualization, where do I get started?  (We have experience with the first two only):

Share
Posted in Uncategorized | Leave a comment

WordPress and FTP

We self host WordPress and during our installation we came to a difficult part…setting up FTP.  The way the WordPress “update automatically” features work is through an FTP account.  You setup an FTP user for WordPress to use so it can FTP into your web server and update/install plugins, themes or even WordPress itself!  The “automatic” part of this feature is so nice that we decided we should install an FTP user.  This post will walk you through the exact steps operationlinux had to take, enjoy.

We run Very Secure FTP, the service was already running on our CentOS machine so this example will not go into installing vsftp.

Create an ordinary UNIX user. But set the shell to nothing and the home directory to where you have the WordPress files hosted. We set the shell to nothing aka "/sbin/nologin" for security reasons, see (R1) for details.

[root@ns1 blog2]# useradd -d /var/www/operationlinux/blog2/ -s /sbin/nologin wpftp

In our example the FTP user is "wpftp" and we host the files at "/var/www/operationlinux/blog2/".

Give your new user a password (just follow the prompts).

[root@ns1 blog2]# passwd wpftp

Now you have a UNIX user who exists on the system but who is harmless because they can’t login to the machine through a shell. Next we have to add them to the vsftp config files.

/etc/vsftpd$ vi user_list

# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.

wpftp

As you can see we appened the newly created user.

Test that it works.
operationlinux@greeny:~/learn$ ftp operationlinux.com
Connected to operationlinux.com.
220 Welcome to operationlinux.com.
Name (operationlinux.com:operationlinux): wpftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls

References
R1: http://www.faqs.org/docs/securing/chap29sec295.html

Share
Posted in Linux | 2 Comments

Install jEdit

The easiest way to install JEdit on my Kubuntu is to use apt, like so:

root@greeny:~# apt-get install jedit
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
ca-certificates-java icedtea-6-jre-cacao java-common libaccess-bridge-java libaccess-bridge-java-jni openjdk-6-jre
openjdk-6-jre-headless openjdk-6-jre-lib tzdata tzdata-java
Suggested packages:
default-jre equivs icedtea6-plugin sun-java6-fonts ttf-sazanami-gothic ttf-kochi-gothic ttf-sazanami-mincho
ttf-kochi-mincho ttf-telugu-fonts ttf-oriya-fonts ttf-kannada-fonts ttf-bengali-fonts
The following NEW packages will be installed:
ca-certificates-java icedtea-6-jre-cacao java-common jedit libaccess-bridge-java libaccess-bridge-java-jni
openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib tzdata-java
The following packages will be upgraded:
tzdata
1 upgraded, 10 newly installed, 0 to remove and 313 not upgraded.
Need to get 37.8MB of archives.
After this operation, 122MB of additional disk space will be used.
Do you want to continue [Y/n]? n
Abort.
root@greeny:~#

But it installs a lot of dependencies and maybe a Java edition you don’t want.  Since I install Java manually I’ll show you how to install JEdit with a custom Java install.

-Go to jEdit’s download page http://jedit.org/index.php?page=download
-Click the “Java-based installer” it will download a jar, then run it:

operationlinux@greeny:~/Downloads$ java -jar jedit4.3.2install.jar

-A nice GUI will popup, it’s default values are pretty good, but you can change it to install it wherever you like.
-Note the handy command line commands!

-Now that might not be enough, you have to make sure your PATH variable can resolve the ‘jedit’ you just installed.  I had to do the following:

operationlinux@greeny:~$ vi ~/.bashrc
export PATH=$PATH:~/bin
#That’s assuming your executable is in your ~/bin directory.
operationlinux@greeny:~$ . ~/.bashrc
Now “jedit” will work from anywhere on my system.

Next I’ll show you how to make a nice GUI icon you can click.

Share
Posted in Java, Linux | Leave a comment

Obtain standard Java…and then put it in a standard place.

OBTAIN .bin file
-Go to http://www.oracle.com/technetwork/java/javase/downloads/index.html
-The JRE is sufficient (if you’re asking you won’t need the JDK) part way down the page is “Download JRE”, click it.
-On the next page you’ll see a Platform drop down, since this blog is all about Linux I’m installing on “Linux x64″
-Download the non-rpm edition, in my case it’s called “jre-6u23-linux-x64.bin”

INSTALL in a standard location
Now that you downloaded the .bin file above follow these steps
-Become the root user
-Place the bin file in /usr/local
-Run it:
Before you can run the file it has to be executable (done with chmod)

root@greeny:/usr/local# chmod a+x jre-6u23-linux-x64.bin
root@greeny:/usr/local# ./jre-6u23-linux-x64.bin

on the next screen you’ll see a license repeatedly hit <enter> (or ‘f’ to skip) until you see
Please enter “yes” or “no”.

Do you agree to the above license terms? [yes or no]

Type yes <enter> if you agree, then you see it basically “unzip” the file into a directory
…inflating: jre1.6.0_23…
-Create a symbolic link (more on why, later)

root@greeny:/usr/local# ln -s jre1.6.0_23/ java

ALLOW YOUR SHELL TO USE THIS NEW JAVA

operationlinux@greeny:~$ vi ~/.bashrc
export JAVA_HOME=/usr/local/java
export PATH=$JAVA_HOME/bin:$PATH
Source your bashrc, reloads variables.
…or could just launch a new shell
operationlinux@greeny:~$ . .bashrc

TEST YOUR SHELL CAN USE JAVA

operationlinux@greeny:~$ java -version
java version “1.6.0_23″
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode)
operationlinux@greeny:~$

SUCCESS

“Oracle and Java are registered trademarks of Oracle and/or its affiliates.”

Share
Posted in Java, Linux | Leave a comment