Posts tagged with ‘apache’

 

This is long overdue work, just one line, okay two lines of code, but it took me two months to get this done. I always wanted to redirect justrealized.com to i.justrealized.com because some people prefer to type ‘justrealized’ and hit CTRL+Enter on their browsers.

Anyway, this is more of a personal note. To do a permanent redirect using htaccess, you create a file called ‘.htaccess’ with the dot in front and upload it to your Apache web server. Make sure you have the modrewrite enabled. Put the following lines into your .htaccess file and change i.justrealized.com to your new domain.

RewriteEngine on
RewriteRule (.*) http://i.justrealized.com/$1 [R=301,L]

301 means permanent redirect. There are lots of ways to do permanent redirects but .htaccess is the most straight forward method if you have the mod_rewrite working for you.

This redirects all your old URLs to your new domain.

 

I’m using Windows Vista and Windows XP. Enabling cURL (Client URL Library) of PHP is really easy and is a matter of uncommenting something only.

Open your php.ini. I use XAMPP for development, XAMPP’s php.ini can be found in C:\xampp\apache\bin\php.ini. You can probably find your copy lurking around there if you use XAMPP.

Do a search of ‘curl’ in the php.ini, there’s probably only one.

extension=php_curl.dll

Uncomment it.

 

My environment is Windows Vista but these instructions work for Windows XP as well.

0. Introduction

Sometimes, we have multiple projects and we would like to access the Project 1’s website by typing ‘http://project1/’ in the browser address bar. And Project 2 may be at ‘http://project2/’. This is how we can configure Windows and Apache to do just that. While this guide is written for XAMPP’s Apache, if the instruction applies pretty much to Apache too. You can put your configuration into ‘httpd.conf’.

1. Add a new host in Windows

First go to your hosts file, it is located at C:\Windows\System32\drivers\etc\hosts for most people. If you’re using Windows Vista, you need to run command prompt as administrator. Type ‘cmd’ into the search bar and right click on the ‘cmd’ search result to point to ‘Run as administrator’. (more…)

 

The easiest way to start developing in PHP is to get XAMPP, the whole package can even be placed in a flash drive.

0. Objective

To get your PHP scripts to send an email out. This guide assumes you have XAMPP or XAMPP Lite. My environment is Windows Vista. (I use XAMPP Lite by the way)

My XAMPP is placed in C:\xampp\, so your configuration may be a little different. The files to be modified are sendmail.ini and php.ini.

1. Modify your sendmail.ini

Your sendmail.ini should be located in C:\xampp\sendmail\sendmail.ini. You only need to be concern with 3 variables here: (more…)

 

Okay, as I was saying, my computer’s getting kinda cluttered and things are just getting harder and harder to find. I use Windows Vista Business, I have multiple copies of Apache, MySQL, Ruby, PHP and other this sort of programs in my computer. If you don’t know what they are, you probably wouldn’t like my blog, maybe you’d be better off at BoingBoing or watching some inspiring videos at TED.

The problem with having multiple copies is that you don’t know when to launch what. Every time I want to - say - launch MySQL, I start thinking really hard which folder should I go into. And when my mind is kinda switching off I often find my mouse pointer moving towards Safari browser icon and visiting Digg.com. Counter-productivity at the very best or worst - you decide.

I always tell myself, okay, next time when I re-setup my computer I’ll do this and that and so on… Each time I re-setup my computer, I always find a flaw with my existing setup. I will restructure my folders again, partition things differently this time. And I always have this optimistic thought that this time I’m really getting it right.

I rarely do. Two months later I would look back at my system thinking of new ways to refine my setup for the future.

Maybe the problem isn’t with me. Maybe the problem is with just the way computers are. All these labyrinth-like hierarchy of folders, it’s more messy than my family tree. Some day, we should kill the ideas of folders, they’re a good way of organizing things but today with people storing more and more files, the concept of folders is hardly a good idea.

 

WordPress powered and Django inspired.
Love and elephants come after.
RSS: Posts and comments.