Saturday, June 28, 2008
DIY Macro Photo Studio
Friday, June 13, 2008
Part 6 - Installing PHPMyadmin
6.0 Installing and configuring PHPMyadmin
- Extract the downloaded file into E:\ server\.
- Change the folder name from phpMyAdmin-2.6.2-pl1 to phpmyadmin or any other name you like.
- If you had followed step by step from the tutorial, your E:\server directory will look like this.
E:\server
+Apache2
+mysql
+php
+phpmyadmin
+www --> default directory - Because phpmyadmin folder is outside of our default directory, we cannot display or get any files or information from this folder when we typed http://localhost/phpmyadmin.
- Now, open httpd.conf file.
- Add this line:
Alias /phpmyadmin "E:/server/phpmyadmin/"
Order deny,allow
Deny from all
Allow from 127.0.0.1 - The first line is to point /phpmyadmin as E:/server/phpmyadmin/, so every time we type http://localhost/phpmyadmin, we will be point to E:/server/phpmyadmin.
- Line in
is for security reason. Phpmyadmin can only be open by localhost which have IP 127.0.0.1. (This IP if I’m not mistaken is especially for localhost, so other computer cannot open this directory). - Restart your Apache2.
- Open your browser and type http://localhost/phpmyadmin, http://127.0.0.1/phpmyadmin, http://***.***.***.***/phpmyadmin (type your ip address).
- Previously, we had assign a password for our MySQL database. We cannot connect phpmyadmin to our database because by default phpmyadmin assume our administrator user ‘root’ has no password.
- Now we need to edit config.inc.php located in phpmyadmin folder, again by using our powerful notepad. If you can’t find this file, try to search config.sammple.inc.php and change to config.inc.php.
- Make these changes:
From To $cfg['blowfish_secret'] = ' ';
Only if you type auth_type=cookie$cfg['blowfish_secret'] = '(type anything, ex. jhgjhUAsAGjJS)' - Log in using your mysql username and password.
.
Note : This guide is only a strip down version (no picture). For a complete guide please download this file. Only for personal webserver.
Part 5 - Editing httpd.conf
5.0 Editing httpd.conf
- You can open httpd.conf in two ways.
- Start Menu --> Programs --> Apache HTTP Server --> Configure Apache Server --> Edit the Apache httpd.conf
- Open folder [Drive]:\server\Apache\conf\httpd.conf
Running PHP 5 as an Apache Module
- Add following line in the file (can copy and paste to the end of httpd.conf):
LoadModule php5_module "e:/server/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Configuring the Default Index Page
- Find DirectoryIndex. And add index.php.
From -->DirectoryIndex index.html index.html.var
To -->DirectoryIndex index.html index.html.var index.php
This line tells Apache which file names to use when it looks for the default page for a given directory. - Save your file and restart Apache by click Start --> All Programs -- > Apache HTTP Server 2.2 --> Control Apache Server --> Restart or by right-click the icon in the system tray and select restart.
- If all is well, Apache will start up again without any error.
- If Apache cannot start, try Start Menu--> Apache HTTP Server --> Configure Apache Server --> Review Error Log and see what are the problem.
Configuring Document Root
- I prefer to set my Directory Root other than default htdocs in Apache folder.
- Find DocumentRoot "E:/server/Apache/htdocs" and change to other folder. I pick e:\server\www\.
From --> DocumentRoot "E:/server/Apache/htdocs"
To --> DocumentRoot "E:/server/www" - Do the same for,
Testing the PHP.
- Make a new file named phpinfo.php by using any text editor.
- Type this in the file.
- Put the file in the E:\server\www\ (--> because previously we had assigned this directory as default).
- Open your favorite web browser and type http://localhost/phpinfo.php.
.
Note : This guide is only a strip down version (no picture). For a complete guide please download this file. Only for personal webserver.
Thursday, June 12, 2008
Part 4 - Installing PHP
4.0 Installing and configuring PHP
- Extract the zip file (php-5.2.6-Win32.zip) to [Drive]:\server\php.
- Find the files called php.ini-recommended and rename it to php.ini.
- Open php.ini with text editor. (I prefer to use Notepad ++)
- Find ;extension=php_mysql.dll and delete “;”.
- Find ;extension=php_mcrypt.dll and delete “;”.
- Find extension_dir = "./" change to extension_dir = "./ext"
- Right click My Computer --> Properties --> Advance Tab --> Environment Variable. In system variables select Path and press edit. Add your php folder in the list e.g. E:\server\php. (optional)
.
Note : This guide is only a strip down version (no picture). For a complete guide please download this file. Only for personal webserver.
Tuesday, June 10, 2008
Part 3 - Installing MySQL
3.0 Installing and configuring MySQL
- Unzip the downloaded file and run the setup.exe file.
- Click --> Next.
- Because we want to install in different folder, select Custom setup. Click --> Next.
- In the next windows, select MySQL Server and click Change…
- Change folder to [Drive]:\server\mysql. Click OK.
- Click --> Next.
- We are ready to install. Click --> Install.
- After finish installing, some MySQL.com advertisement will come out. Click Next and Next. And in the next dialog box, tick Configure the MySQL Server now. Click Finish.
- Click --> Next.
- Select Standard Configuration for fresh installation. Click --> Next.
- Check Install as Windows Service and Launch the MySQL Server automatically.
Leave the Service Name as MySQL.
Also check the Include Bin Directory in Windows PATH (optional).
Click --> Next. - Write your root password.
For security, your password should have mixed-case letters and alphanumeric.
Check the Enable root access from remote machine.
Click --> Next. - Click --> Execute.
- Now we have finish using the wizard.
- Click --> Finish.
.
Note : This guide is only a strip down version (no picture). For a complete guide please download this file. Only for personal webserver.
Part 2 - Installing Apache
1.0 Before you begin
Please download this software
Apache 2.2.8 [win32 binary] http://apache.leakage.org/httpd/binaries/win32/
(apache_2.2.8-win32-x86-no_ssl.msi)
MySQL 5.0.51b [Windows (x86)] http://dev.mysql.com/downloads/mysql/5.0.html#win32
(mysql-5.0.51b-win32.zip)
PHP 5.2.6 [windows binaries] http://my.php.net/downloads.php
(php-5.2.6-Win32.zip)
phpMyAdmin 2.11.2 http://www.phpmyadmin.net/home_page/downloads.php
(phpMyAdmin-2.6.2-pl1.zip)
I’m using Windows XP with sp2.
2.0 Installing Apache 2.2
- Double-click the Apache installer file (apache_2.2.8-win32-x86-no_ssl.msi) to launch the Apache automated installer.
- Click --> Next
- Select “I accept the terms in the license agreement" and click Next.
- Click --> Next
- Example if your url is www.somenet.com (this is not important because we only want a personal webserver).
Network Domain : somenet.com
Server Name : www.somenet.com
Administrator’s Email Adress : webmaster@somenet.com (your admin email address)
Select for All User, on Port, as a Service – Recommended
Click --> Next. - Select Custom setup. Click --> Next.
- I want to install all my server program in different location. So, select Apache HTTP Server 2.2.8 and click Change.
- Type [Drive]:\server\Apache to change installation folder. This is depending on what folder you want to install. In this case, I want to put all installation of Apache2, MySQl, and PHP in the same e:\server\ folder.
Click --> OK --> NEXT. - We are ready to install. Click Install.
- Installing... After some time, some DOS windows will appear and disappear.
- If everything going well, we can see this window. Click --> Finish
- To check your installation, open your favorite browser. Type http://localhost/ or http://127.0.0.1. If you see It Works! text, it means you installation is correct.
.
Note : This guide is only a strip down version (no picture). For a complete guide please download this file. Only for personal webserver.
Sunday, June 8, 2008
Part 1 - Web Server
Introduction
Now I decided to learn more about some of Open Source Content Management System (CMS) like Joomla, Drupal, CMS Made Simple and e107. These CMS and also most of the CMS require PHP (server-side HTML embedded scripting language) and MySQL (open source database), and most importantly a webserver.
Click here to see the list of the CMS.
When I said webserver, it doesn’t mean those expensive server offered by our country webhosting company. What I means is your normal Personal Computer, equipped with require programs and services installed which listens to HTTP (and other web requests) and serves content. Now day, setting up a webserver is easy.
Hardware requirement?
My test machine is 5 years old PC with this specs:
Athlon XP 2500 (1.8Ghz)
256Mhz DDR Ram
Windows XP SP2
So, anything newer than this PC can work properly.
Software?
Automatic Installation (Packages)
Currently, there are a lot of webserver package or also known as all-in-one webserver. These packages are a bundle of apache, mysql and php. Most of the packages also include phpmyadmin, a web based database management system. User only need to install the package and it will automatically install and setup your computer.
This is the list of the webserver package (please give comment to add other):
- EasyPHP
- XAMPP
- Abyss Web Server
- WAMP (Windows)
- MAMP (Machintosh)
Some of the package offered Lite version. This Lite version is a small version of the package with basic function but still can serve as a webserver. Some of the Lite version can be save and run in a thumbdrive like XAMPP Lite. They are ready-to-run webserver, no installation required.
Wednesday, June 4, 2008
My DIY steel cabinet
Last Saturday (a week before school holiday), I was planning to tidy up my store room. Just for preparedness for school holiday. My relative might come to visit us.
Actually this room is a normal bedroom. But lots of things from my single life to my wedding gifts (glasswares etc.) to my old Lerun mountainbike were scattered on the floor until I can't enter the room. No more empty space! Even if I tidy up the room, it still a mess.
Fixed cabinet is not an option because it costly and I'm not the owner of the house (yeah.. this is a rent house). So I decide to make a steel cabinet. Easy to assemble, disassemble and reassemble for my new house (when I get one).
~~~~~
My first draft
The room has 10 fts wide and 10 fts high. So I decide to have 8 fts high cabinet with total of 5 compartments including bottom (floor) and top. The width is fixed to 2fts and length is 4~5 feet. My budget was only RM200.
I use the 4fts X 2fts X 8fts dimension for minimizing the cost. After calculating all possible dimension plus to maximizing the use of all 10fts steel angle, I found that this is the best solution.
I need to buy only 8 pieces of steels. From the draft picture, I need 4 X 8fts, 8 X 4fts and 8 X 2fts of angle steel. 4 pieces will be cut into 8fts and 2fts and another 4 will be cut into 4fts, 4fts and 2fts. So, if you calculate, I get all the steel I need.
For the plywood, I need only one 8fts X 4fts plywood and cut into 4 parts.
Actually I am planning to build 2 cabinets with total length of 8fts but as this is my first time making a steel cabinet, I sticked to only one cabinet. This is a trial and error project.
~~~~~
Tools
a. 10fts angle steel
b. Hand socket (1/2)
c. Spanar (Drive) No. 13
d. Nut and bolts (1/2)
e. Washer (optional)
f. Steel step ladder
(p/s: I'm not a tool man so please correct me with the name of the tools)
Cost
I surveyed a few hardware shops.
Items | 1st Shop | 2nd Shop | 3rd Shop | 4th Shop |
10fts Angle Steel (Large) | RM18 | RM20 | RM19 | RM20 |
Plywood | RM42 | RM42 | RM43 | RM44 |
Cutting Service (Steel) | none | Free | RM1/cut | none |
Cutting Service (Plywood) | none | RM6 | RM10 | RM5 |
Nut and bolts | - | RM4 for 20 pieces | - | - |
This is the comparison of price among hardware shop near my house. I summarize into only 4 shop. I don't know the cheapest price for all the items but with limited choice, I had to accept want they offered.
The price of plywood is almost the same with all shop but the cutting services may differ. So the cutting service must be add to the total cost for a plywood. Be aware that some small shops don't have the service.
After a small talk with some of the shop owner they all said that the price of steel increase RM2~RM4. Last time, the price of 10fts Angel Steel is only RM17~RM18 for large angle steel, and RM15 for small.
For angle steel, not all shop have the cutting service. From all the shop I surveyed, only 2 have the cutting tool and other asked me to wait (they send to other shop to cut) or asked me to cut at other shop (surely I will not buy from this shop). Actually the cutting tool is so simple and small, I wonder why not all shop have it?
So at the end I picked shop number 2 because of it free cutting service and luckily the nearest.
Total cost
- 10 X 10fts angle steel --> RM20 X 8 = RM160
- 1 X plywood + cutting = RM48
- Nuts and bolts --> RM4 X 2 packets = RM8
Total --> RM216
RM16 more than my budget.
~~~~~
The set up
The set up is very easy but take time. I start cleaning up my store room at 11:00 pm and finish set up and tidy up at 2 a.m. May be if only setting up the steel cabinet will only take less than an hour.
Finish products
The finish products. Just ignore the old curtain behind :).
As a reminder, when buying the angle steel please ask the cutter to cut a bit for both ends of 4fts and 2fts steel. If not, you have problem when assembling the cabinet. This happen to me, and it give me really a hard time hammering the steel to fit into place.