2009年9月17日星期四

Install/Setup SmartSVN in Ubuntu

How To: Install/Setup SmartSVN in Ubuntu
----------------------------------------

This is a simple guide to install and setup SmartSVN in Ubuntu 7.04 (Feisty Fawn). You’ll need to have Java-6-Sun already installed first since it won’t run on GCJ. I don’t know if it’ll work on gcj or not.

Download SmartSVN
-----------------
1. Please download the ‘Generic’ archive from the SmartSVN download page (currently the latest version is 3.0.1).
2. Extract the archive (right click on it, click on Extract Here)
3. [optionally] Move SmartSVN to your ‘Apps’ folder. I usually copy download-and-extract kind of apps to ~/Apps. You can place the application anywhere you like, perhaps in your home directory.

Add to Applications Menu
------------------------
1. Right click on the Applications menu
2. Click on Edit Menus
3. Select the Programming Category (the category is up to you but Programming seems right to me)
4. Click on the New Item button. The ‘Create Launcher’ window sholuld appear:
1. Select type: “Application”
2. Enter Name: “SmartSVN”
3. Select Command: “[YourSmartSVNFolder]/bin/smartsvn.sh”
4. Click on the icon button. It should load the browse icons window
5. Click on browse and point it to “[YourSmartSVNFolder]/bin/”
6. The list will now display several SmartSVN icon previews.
7. Select smartsvn-32×32.png and click on OK to close the browse icon window
8. Click on OK
5. Click on Close.

Note: Replace [YourSmartSVNFolder] with where your SmartSVN folder is.

Now SmartSVN should be easily accessible via Applications > Programming > SmartSVN. Actually this section of the guide is pretty generic and should work on other download-and-extract kind of applications.

Setting Up SmartSVN
-------------------
First of all start SmartSVN via the Applications menu.

1. Edit > Preferences > External Tools
2. Enter File Pattern: “*”
3. Enter Command: “gnome-open”
4. Enter Arguments: “${filePath}”
5. Click on Insert
6. Click on Directory Command in the left pane (right under External Tools)
7. Check on “Enable Open Directory Command”
8. Enter Command: “gnome-open”
9. Enter Arguments: “${directoryPath}”

This will allow SmartSVN to open files/folder using the right applications. Double clicking on folders will open a Nautilus window and text/code files will load up gedit (or whatever it is associated with on your PC)

Please tell me if anything is confusing, missing or just plain wrong.
Have Fun!

2009年9月7日星期一

AMP setup

1.Download & Unpack

Download and install PHP from http://www.php.net/downloads.php, you should grab the newest 5.x.x Windows Binaries zip package that will work on apache.

My file was named: php-5.2.9-1-Win32.zip

2. Unzip php. In my case, I unzipped to:
C:\php\
3. Rename C:\php\php.ini-dist it to php.ini

4.Edit your php.ini
Open php.ini in a text editor and scroll down about halfway through the file and look for doc_root then change it to point to whatever your Apache DocumentRoot is set to. In my case: doc_root = "C:\public_html"

Scroll down about 7 more lines and change the extension_dir from extension_dir = "./" to the location of the ext directory after you unzipped PHP. in my case: extension_dir = "C:\php\ext"

If you are going to be using your server for testing, i recommend (this is optional) you search and change the error reporting to give you info on any errors, notices, or bad coding. If you want to enable this type of stuff, search for error_reporting for and change:
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
to
error_reporting = E_ALL | E_NOTICE | E_STRICT

5. Editing Apache Conf File
Using Notepad open httpd.conf (should be start-menu shortcut "Apache HTTP Server 2.2 > Configure Apache Server > Edit the Apache httpd.conf Configuration File"). Either at the very beginning or end of the file add the following lines: (NOTE: be sure to change BOTH C:/php parts to the directory you installed your php to)

LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"


Note: If you installed the older Apache 2.0, instead of the above lines, you will need to use the lines listed on the bottom step of the Apache 2.0 tutorial.

6.[OPTIONAL] Editing Apache Conf File (part 2)
To get apache to automatically look for an index.php, search httpd.conf for DirectoryIndex (about line 212) and add the files you want apache to look for when a directory is loaded (if it doesn't find any of these files, it displays folder contents). Mine looks like:


DirectoryIndex index.php index.html default.html


7. Testing
Restart Apache if it is already running (if it doesn't start or you get errors, use your Apache "Test Configuration" shortcut in the Start Menu to see why).

To test your PHP simply create a test.php file in your Apache "DocumentRoot" folder (E:\public_html\ in my case). In your test.php file, type these 3 lines and then load the file in your browser like http://localhost/test.php (you should get a whole long list of php variables, settings, etc):

phpinfo();
?>

8.Documentation Suggestion
One weird thing I have noticed about PHP is that it does not come with documentation of any kind. If you are a php developer/programmer, I suggest you download the documentation. Downloads can be found on http://www.php.net/download-docs.php and I personally recommend the "English - Windows HTML Help" (chm) version as the search is so handy, although they all contain the same information.