Archive for the ‘Linux’ Category

The Changing Operating System of a CS Student

Sunday, May 23rd, 2010

The purpose of this entry is to share my view of three different operating systems and how over time they have changed in my life. Throughout the course of my freshmen and sophomore year of college my preferred operating system changed with my knowledge and need. Freshmen year I would have never touched a Linux computer, I would walk to several computers and select the computer already booted into Windows in the computer labs that had both Windows XP and Ubuntu. My personal computers were a MacBook Pro running OS X 10.5 and a HP Tablet running Windows Vista / 7 RC.

I considered my HP computer running Windows to be “work” computer and my Mac to be my more personal computer. I would use my HP computer during the day to take notes in Microsoft OneNote and Dev C++ for my programming assignments. After classes I would retire to my Mac where all my music, pictures and movies were located. My Mac was slowly becoming my primary machine for personal programming and iPhone development. At this point in time I still had no desire to use any type of Linux system, and I had not fully used the power hidden under Apples OS.

My sophomore year I started becoming more involved in the Open Source Institute, on campus as well as taking a classes on PHP/MySQL, Unix Administration. Slowly Fedora and Ubuntu were becoming part of daily interaction, and my Windows computer was only used for note taking in my math class. My knowledge and uses of these different Operating Systems had changed. Now I had my HP tablet dual booting between Windows 7 and Ubuntu 9.10, and my Mac was now much more than a place to listen to music and watch movies.

Now I have a copy of Windows installed for no other reason then software testing, or the case where the software will run in Windows. My Mac has become a “hybrid computer” mixing entertainment and work. I have my terminal and a powerful layer of OS X many users probably never use, which allows me to easily host a webserver, ssh from anywhere, vnc or screen shareing, and mix between Perl and PHP for quick dirty scripts. When I’m not sshing into a server I’m watching a movie or listening to music all with the eye candy of an Apple product. Linux (Ubuntu) has become the fast, small and powerful OS for my tablet and the OS for all the servers (CentOS or Ubuntu) I manage and I use it equally compared to OS X. Today give me a terminal and a browser window and I’m happy.

Setting up https in Ubuntu 9.10 running Apache 2

Friday, February 12th, 2010

I run a Apache webserver off my hp tablet when I’m not using it, and recently I’ve been wanting to sit down and learn about ssl and https and implement it. I did some googling on the topic and figured out how to go about setting it up. I thought it might be helpful to compile all the information along with the original links so people don’t have to bounce from website to website like I did.

Just for knowledge I am using Ubuntu 9.10 with Apache 2.2.12 and I am running this from within my dorm room where only people on campus can see my server, this might not be a good idea if you are using this on a more public server.

- Getting Started / HTTPS Configuration -

The mod_ssl module adds an important feature to the Apache2 server – the ability to encrypt communications. So what we want to do is run the following command to enable SSL:

sudo a2enmod ssl

There is a default HTTPS configuration file in /etc/apache2/sites-available/default-ssl. In order for Apache to provide HTTPS, a certificate and key file are also needed. To configure Apache to use this we next run this command:

sudo a2ensite default-ssl

All that is left now is to restart Apache so the changes are applied. You can just type the following:

sudo service apache2 restart OR sudo /etc/init.d/apache2 restart

[ Ubuntu's Documentation ]

- Force the browser from HTTP to HTTPS -

Next I wanted to make sure anyone who visited my server would be forced to use https. To do so I did the following, which might not be the best way but it was certainly the easiest way. For more information on why this isn’t the best way consult the links provided.

To enable .htaccess in Apache, you need to edit /etc/apache2/sites-available/default. You want to change the line AllowOverride None to AllowOverride All in the portion of the text as seen below in your default file.


<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

Next just restart Apache with one of the commands as listed above.

[ Enable .htaccess Documentation ]

Finally I just added a .htaccess file to the /var/www with the following:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]