July 2006


I feel that it’s time to get my SQL back gradually after building a Webserver. Again, from the very beginner level — to the geek! (I’M NOT A GEEK AT ALL, TO BE REMEMBERED PLEASE!! Actually I think that everything if I start to addict to, it only takes me several days to ramp up from a beginner level to top level! That’s really true! 🙂 )

Basically there are three basic categories of SQL Statements:

  • SQL DATA STATEMENTS (query and modify tables and columns)
    • SELECT Statement – query tables and views in the db
    • INSERT Statement – add rows to tables
    • UPDATE Statement – modify columns in table rows
    • DELETE Statement – remove rows from tables
  • SQL TRANSACTION STATEMENTS (control transactions)
    • COMMIT Statement – commit the current transaction
    • ROLLBACK Statement – roll back the current transaction
  • SQL SCHEMA STATEMENTS (maintain schema)
    • CREATE TABLE Statement – create tables
    • CREATE VIEW Statement – create views
    • DROP TABLE Statement – drop tables
    • DROP VIEW Statement – drop views
    • GRANT Statement – grant privileges on tables and views to other users
    • REVOKE Statement – revoke privileges on tables and views from other users

Playing around With the OracleDB10 for a while, I used the following SQL commands:

SQL select, distinct, where, and, or, in, between, like, order by, count, group by, having, alias, join, minus, outer join, arithematic functions such as AVG, COUNT, MAX, MIN, SUM.

Is it deep enough? No…Back to digging…

Advertisements

早上醒来,看到Videotron的工作人员已经把电视调好,HDTV效果不是盖的,尤其是清晰无比的电影台,看来我没有白花时间去选台,当然,把钱交足,你得到的服务和享受也绝对一流!酷毙了!

打开我的笔记本,看到我的博客排名在TopBlogue居然上到第30位,感觉爽呆了!从来没有一种感觉如此美妙!看来我今生不能和blog说再见了!

今天感觉很好,开着HDTV,看着自己的博客排名,觉得自己的状态已经调整得差不多了,伤口基本上愈合,一切从头开始,我决定——放飞在八月!

Présentment, je suis entrain de faire la décision de publier mon premier roman progressive par le biais d’internet parce que je pense que c’est un façôn qui peux l’améliorer peu à peu étant donné que je ne suis pas un écrivain. Par ailleurs, je peux faire le modification facilement et peut-être un jour je vais faire le chois de le publier en papier… 🙂

Having finished the article about building webserver on Linux. I am back to be in the mist of searching PDA, here they are:

1. HP iPAQ 128MB Pocket PC (HX2410)  (469.99). 520MHz Intel PXA270 Processor, 128MB (64MB SDRAM), Wi-Fi (802.11b), bluetooth, Serial IR, looks cool, but still, I am not satisified with the memory, and I think I like PDA more than Pocket PC (maybe because of Jack Bauer…:))

2. PalmOne LifeDrive 4GB Mobile Manager Handhelo – Multilingual  (448.97$). Intel 416MHZ Xscale Processor, …looks good, but I should make sure if it supports Wi-Fi and Blue tooth.

3. Treo 650  (99.99$ with Telus 3 years contract). Sam told me that this is the one Jack Bauer used in 24 hours. But I think the screen a bit small and I like most is a PURE PDA like Palm TX…and I want to make a phone call by using a PURE CELLPHONE, I think that’s COOL in my mind!  Hmm… anyway, it takes time to find a one fit me in both function and price. However, I won’t let it be long!

PS – Tim has sent me the info about a water park…we’ll go soon…I think I need some water to “clean” myself completely! 🙂 I will get refreshed shortly!

1. Go to /opt/sysconfig (#cd /opt/sysconfig)
2. edit file named i18n (#gedit i18n)
3. This is the original file:

LANG=”en_CA.UTF-8″
SUPPORTED=”zh_HK.UTF-8:zh_HK:zh:zh_CN.GB18030:zh_CN:zh:zh_TW.Big5:zh_TW:zh:en_CA.UTF-8:en_CA:en:en_US.UTF-8:en_US:en:fr_CA.UTF-8:fr_CA:fr:fr_FR.UTF-8:fr_FR:fr”
SYSFONT=”latarcyrheb-sun16″

4. I changed it as follows:

#LANG=”zh_CN.GB18030″
LANG=”en_CA.UTF-8″
LANGUAGE=”en_CA.UTF-8″
LC_CTYPE=”zh_CN.GB18030″
LC_TIME=”en_US.UTF-8″
SUPPORTED=”zh_HK.UTF-8:zh_HK:zh:zh_CN.GB18030:zh_CN:zh:zh_TW.Big5:zh_TW:zh:en_CA.UTF-8:en_CA:en:en_US.UTF-8:en_US:en:fr_CA.UTF-8:fr_CA:fr:fr_FR.UTF-8:fr_FR:fr”
SYSFONT=”latarcyrheb-sun16″

5. Restart the computer.

PS: everything looks good, using ctrl+space I can switch between ENG and CHN. One minor thing is that I wanna get french involved. Well, it’s not that I’m completely fluent in French, but I just wanted to be able to type a few things from time to time, so I had to  get goint and play around with my favorite Linux (I think I have gotten addicted to Red Hat…need a break…) …and Eventually I figured it out and here are my tricks!

Startx in Linux, there is a small tool called “Character Palette” which you can add to the bottom panel. It provides a convenient way to access accented characters, special symbols, etc. Now I can work on Linux freely! C’est tellement cool 🙂 Maybe there is another way to fix it, tell me if you do have.

Après avoir arrivée chez moi, j’ai allumé mon laptop et ouvert mon page de google. J’ai trouvé dans mon “Daily Horoscope of Leo” section:

Unlike typical impatient Leo behavior, you have been waiting for the right moment to push your master plan forward. And even though you might feel that little or no progress has been made in the past few weeks, now it’s time to shift gears and take action. Although you may be past the point of no return, be persistent for it still could take a few days to find your rhythm.

Wow, c’est super! 😀 S’accord ma situation parfaitement! Je viens de rencontrer un amie qui me souhaite tout va bien…Peut-être le dieu m’écouté ma prière…Lisant les mot en haut, je n’ai pas le coeur lourd; l’affaire qui me tient à coeur ne m’a pas dérangé beaucoup. Ça souffrance qui ne guérit pas sera été guéri bientôt. Come on…c’est l’été, on doit le profiter! 8)

Dreaming of blogging on my own Web Server, studying for a while, I started to build my own Web Server. The linux distribution being utilized for this tutorial is Red Hat Enterprise Linux 3, however the steps should be very similar across most distribution. Be sured that you have the required development tools loaded for compiling programs from the source, these tools are beyond the scope of this doc and will not be covered here. In addition, it assumes you can use a text editor (e.g.: gedit, vi, emacs, etc) for basic editing tasks. Are you ready? — COOL! Here we go! 🙂

1. Grab 3 Sourcecode

2. Installation

Beginning now we will be working as root, sitting on a big sofa….with a cigar, ….change to the directory in which you saved your downloaded files and iyou can use su command f you want to become root, okay, then type the following comands:

# tar xzvf httpd-2.2.2.tar.gz (enter)
# tar xzvf mysql-4.0.27.tar.gz (enter)
# tar xzvf php-5.1.4.tar.gz

Having done these, now lets move on to compiling the source into usable programs. We will start with Apache.

3. Compiling Apache – follow these commands by typing:
#cd httpd-2.2.2 (enter)
#./configure –prefix=/usr/local/apache2–enable-mods-shared=most (enter)
(This telles Apache to install in the /usr/local/apache2 directory and to build most of the available loadable modules. Well, of course you have a bunch of options with Apache, but these should work for the most part. Once the configuration is done and the system returns the prompt to you, type the following command)

#make (it takes me several minutes, issue the following command once the prompt comes back again)
#make install
(Me voila Apache is installed! Bravo!)
We still need to make a few minor changes as follows:

# gedit /usr/local/apache2/conf/httpd.conf
or # emacs /usr/local/apache2/conf/httpd.conf
or # vi/usr/local/apache2/conf/httpd.conf

Then check the following line is present in the httpd.conf file at the bottom of the LoadModule list, add it if it is not there;

LoadModule php5_module modules/libphp5.soNote if you download php 4.x.x you should change as:
LoadModule php4_module modules/libphp4.so

Find the DirectoryIndex line and edit it like the following;

DirectoryIndex index.html index.html.var index.php

Find the AddType application section and add the following line;

AddType aplication/x-httpd-php .php

C’est tout! Save the file and we are done with Apache part. Let’s move on to MySQL!

4. Compiling MySQL
#cd mysql-4.0.27 (enter)
# ./configure –prefix=/usr/local/mysql –localstatedir=/usr/local/mysql/data –disable-maintainer-mode –with-mysqld-user=mysql –enbale-large-files-without-debug (enter)
#make
#make install

Note that the above commands you may not need if you have downloaded mysql recently cause the current one is ready-to-run version.
Now let’s create a group for MySQL as follows:
#/usr/sbin/groupadd mysql (enter)
Now let’s creat a user called mysql which belongs to the mysql group;
#/usr/sbin/useradd -g mysql mysql (enter)
Then we install the db files as follows; (you might not need this step if you use the ready-to-run version)
#./scripts/mysql_install_db (enter)Okay, then we make some minor ownership changes;
#chown -R root:mysql /usr/local/mysql (enter)
#chown -R mysql:mysql /usr/local/mysql/data (enter)
still, using emacs/vi to add a line the ld.so.conf file as follows:
#gedit /etc/ld.so.conf
Adding the following line:
/usr/local/mysql/lib/mysql
We are done! MySQL is installed! To run it, just issue the following command:
#/usr/local/mysql/bin/mysqld_safe –user=mysql &

the following command is optional, you can set a root password for MySQL as follows:
#/usr/local/mysql/bin/mysqladmin -u root password new_password
where new_password is the password you wanna use.

Okay, last monster-PHP!
5. Compiling PHP

(To be continued–Après la pause…)

Friday, July 28, 2006

Attention: yesterday I found that PHP 5.1.4 doesn’t fit for my current environment, it needs more high version of xm..stuff  😡 . So, I downloaded php 4.4.2 instead. C’est super! 🙂  Okay, follow me to compile php 4 by typing:

#cd /opt/php4.4.2 (enter)
#./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=/usr/local/mysql (enter)
#make (enter)
#make install (inter)
Okay, grab a beer for a while till you have the prompt back, then type:
# cp php.ini-recommended /usr/local/php/lib/php.ini (enter)Then edit that file;#gedit /usr/local/php/lib/php.ini (enter)

And change the following: 
Find the doc_root section and enter the correct path for the directory which serves your web content such as:

doc_root= “/usr/local/apache2/htdocd/”

(this is default for apache2) Then find the file_uploads section and change it to reflect the following (for security reasons):

file_uploads=Off

Wonderful! C’est fini! Let’s test!

6. Testing
Use ps command to check if your MySQL process is still running from earlier, if not, start it again! Then we need to start Apache by issuing the following command which starts the Apache web server:

#/usr/local/apache2/bin/apachetl start (enter)

now change into the following directory and using gedit create a file called test.php:

#cd /usr/local/apache2/hotdocs (enter)
#gedit test.php

and add the following line to the file:

<?php phpinfo(); ?>

Save the file, then open a browser (firefox) and point it to /localhost/test.php. You should see a listing of all kinds of cool info about PHP, Apache, etc. Now, I end up my first time fully functioning setup. However, during the whole setup process, I got some problems and I figured them out, so hopefully you don’t have so much troubles, if you do have, then GOOGLE or ask me, I will try my best to help you. :mrgreen:

Okay, let’s do something to celebrate, BBQ, having some champagne…Yeah we made it!

Well, now we have everything running now, the only minor problem is that we have to start Apache and MySQL manually, I’m a bit lazy and I do not want to have to remember to do everytime I reboot, so I wanna fix it. I found a way which is pretty good, but it seems that I need a while to get it done! Hopefully tomorrow I can work it out.

7. Starting Apache and MySQL automatically

July 30, 2006

Finally, I made it. Let’s start with MySQL. Logging in as root and with the mysql directory we set earlier.
#cd /usr/local/mysql/ <enter>

then copy the file mysql.server to the directory /etc/init.d as follows;
#cp support-files/mysql.server /etc/init.d/mysql

Now, let’s create some links in the startup folders fur run level 3 and 5;

#cd /etc/rc3.d <enter>
#ln -s ../init.d/mysql S85mysql <enter>
#ln -s ../init.d/mysql K85mysql <enter>
#cd /etc/rc5.d <enter>
#ln -s ../init.d/mysql S85mysql <enter>
#ln -s ../init.d/mysql K85mysql <enter>
#chmod 755 mysql <enter>
We’re done for MySQL, it should start automatically now when you reboot your machine (use ps -ef | grep to check if you want). Now let’s do the same steps for Apache, still, as root and with the apache2 directory configuration as we did before.

#cd /usr/local/apache2/bin <enter>
#cp apachectl /etc/init.d/httpd <enter>
#cd /etc/rc3.d <enter>
#ln -s ../init.d/httpd S85httpd <enter>
#ln -s ../init.d/httpd K85httpd <enter>
#cd /etc/rc5.d <enter>
#ln -s ../init.d/httpd S85httpd <enter>
#ln -s ../init.d/httpd K85httpd <enter>

Cool! The apache should start automatically along with MySQL the next time you boot your machine.

Well, having done this, I could setup a webserver and to build my WordPress in, and have a powerful blog site later! Yeah! I wrote the whole procedure down because I want to get it noted and hopefully it helps you guys. Ciao.

Next Page »