Saturday July 31, 2010 @ 04:15:58 GMT+10    ( Weather:  18°C / 64°F  -  Partly Cloudy )
Home » Weblog Archives

Powered byD's Bloggie
Weblog Archive browse by category ...
 → Category :
Display order:
Page 1 of 2   ( 16 entries , showing 1 - 10 )
    1 2 Next  

DNS Propagation - 7:17 pm
uh, my windows is caching the DNS records too!
Computing , Internet , Site Issue , Web Hosting  -  poster 

Rawwwrrrrrrrr ~~~~~~~ !! This site is finally up and running again claphand2

beh tong nia... I can't believe my lame ISP really took 72hrs to update their cache for DNS records ! Last week, my webhosting company actually planned to do some RAM upgrades for the server. Then in the middle, I'm sort of confused, but I think they moved some of the accounts to another new server/datacenter in US. So new server means new IP address. That also means http://ahkuan.com is pointing to another new IP address. The changes is made effective pretty quick in the top registration database and the webhosting's DNS servers, however, the so called DNS propagation process is causing all the mess around.

Let's go in plain english... You see, every ISP cache the master DNS records and read them locally instead of looking them up on the Internet each time someone wants to view a website. Some ISP fetch a new copy once every 24 hrs. However, some ISP (like the one that I'm using) they fetch a new copy once every 72 hrs... or even longer ! So even though the domain name ahkuan.com is already mapped to a new IP address in the top level domain servers, but your ISP's DNS cache is still pointing to the old IP address ! So there will be chaos... some will be viewing the most updated content on the new server but some will still be visiting the old content on old server. Unless everybody is using pure IP address xxx.xxx.xxx.xxx instead of ahkuan.com, you'll probably have to wait up to 72hrs until your ISP refresh their DNS records cache.

It won't be surprised if you're still having problem to resolve to the correct address even after your ISP updated the cache. The problem might be your operating system is caching its own copy of DNS records. For windows user, go to command prompt, and type the following command:

ipconfig /flushdns

This will flushes and resets the contents of the DNS client resolver cache. Try /displaydns to display the cache content.

Website is doomed for 3 days - 10:16 pm
omg... where did I save my recent database dump ?
Site Issue , Site Updates , Web Hosting  -  poster 

Yikes... my site has been acting strangely or totally down since the evening of 2/10/2006 until this evening sad At first I'm pretty nervous because I suddenly remembered that I haven't pay the bill and it's going to due... in 1 day time....

However, the sql is acting strange and keep throwing a "Too many connections" error on my face. If I didn't pay the bill, they should stop serving my site temporarily and shouldn't be this weird or stupid. After checking out with the admin, I just realized they're carrying out a server update. In fact, it's a huge update... . glare

The RAM has arrived at the datacentre and they have advised an upgrade window of approximately four (4) hours. The upgrade will only take a few minutes, but please allow the full window so as to allow time for any issues that may arise. We expect full services to be restored by approximately 14:30 AEST.

...

We are waiting for a response from the data centre about an upgrade due to a RAM issue on the Milkyway server, the server is currently running on a gigabyte of RAM thus using quite abit of swap causing the slow accessing times. The main services suffering are - ftp, email and sql. We appologise for the inconvinience.


So, during the update process in these few days, sometimes the site is totally down, sometimes it's up but the PHP script has sql connection problem. If I managed to get through, either everything is fine or I'll notice the site's content is old one. It's sort of a database rollback, just that the problem is it didn't rollback to the most recents one. It's like right now I'm seeing the most updated content on my site, 1 hr later I visit again it's rollback to the content that's few days back. Then I come back again, it's restored to the latest one... I can't issue a lockdown on my site because of this and also FTP is not working too... bangwall

Anyway, thank god the update has completed, and thank god again all the data is restored properly heh

Last edited: Wed 2007-01-17 @ 19:56 , by DaRen 3 time(s)

Installing Apache 2.2.3, PHP 5.1.4 and MySQL 5.0.24 on WindowsXP (SP2) - 6:05 pm
since when it's so hard to setup a simple LAMP?
Guides , PHP , Site Issue , SQL , Web Hosting  -  poster 

Last revised: 2007.01.17

I've enough headache last night trying to figure out how to make Apache 2.2.3 and PHP 5.1.4 to work together on Windows XP. After several hours of tweaking and changing the settings, I finally gave up and search for help on the web. It seems it's not my fault that they can't work in harmony. Most of the tutorial on the web is not detailed enough and the readme from Apache and PHP is gay. I'm no expert or guru on both of them, but I'll write down the steps required to get them working and hope that one day I can make somebody's life easier if they encountered the same problem as me =)

Installing Apache
  1. Go to Apache HTTP server project website to download the binary for windows. This guide uses Apache 2.2.3.
  2. Open the file and follow the prompt. When it ask for the Network Domain and Server Name, use "localhost" if you're setting up a local server on your computer for development purpose, otherwise fill in the address and name according to your server. In the Administrator’s Email Address field, use any email address (e.g. "admin@localhost").
  3. Continue clicking next and choose the setup type and path to install and complete the installation.
  4. If Windows (SP2) firewall prompt to ask about the program, just click "Unblock".
  5. At this point installation is completed, Apache HTTP server should be running as a service if everything is ok. Open your browser, type in http://localhost/ in the URL bar. You should see "It works !" on the page.
  6. To customize the httpd.conf file (located in /conf in Apache folder), open with any text editor. Look for DocumentRoot, change the path if you want. For example:
    DocumentRoot "C:/Documents and Settings/user/My Documents/My Website/localhost/www"
    The default path will be pointing to /htdocs in your Apache folder.
  7. If you changed the DocumentRoot mentioned above, remember to scroll down and look for a line that looks like
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory "C:/...">

    Change the path in the <Directory> tag to the same you set for DocumentRoot in above. For example:
    <Directory "C:/Documents and Settings/user/My Documents/My Website/localhost/www">
    If you don't change it, you'll get Permission Denied when you browse http://localhost
  8. Change any other settings to suit your server or for scricter security. The above is sufficient for normal static html hosting. See below if you need a script parser like PHP for dynamic page output.

Enable mod_rewrite for URL rewrite
See Enable mod_rewrite in Windows in another entry in my weblog.

Installing PHP
  1. Go to PHP website to download the binary for windows. This guide uses PHP 5.1.4.
  2. Please take note that if you followed the below steps and it's still not working with Apache, continue to read down to the section Another way to make Apache and PHP work together.
  3. Unzip the contents to the path you desire (eg. C:\php\).
  4. Go to Control Panel -> System -> Advanced tab -> Click on Environment Variables. In the System variables list, look for the variable name Path. Select it and click on Edit. Append
    ;C:\php
    at the back of the variable value.
  5. Now go back to the PHP folder (eg. C:\php\), make a copy of the file php.ini-recommended and rename it to php.ini. Open the php.ini file with text editor. *Note* This guide uses php.ini-recommended file, you can use the php.ini-dist if you know what you're doing.
  6. If you changed the value of DocumentRoot in httpd.conf file mentioned above (Installing Apache, Step 6), you need to change the doc_root value to , for example:
    doc_root = C:/Documents and Settings/user/My Documents/My Website/localhost/www
  7. Save the php.ini. Now open the Apache httpd.conf file, look for the "LoadModule" section. At the bottom of the LoadModule block, insert the following lines:
    # For php5 module
    LoadModule php5_module "c:/php/php5apache2.dll"
    AddType application/x-httpd-php .php
    # Configure the path to php.ini
    PHPIniDir "c:/php"


    You can add another optional line if you know what you're doing:
    AddType application/x-httpd-php .php-source .phps

    *Updated 2007-01-17*
    If you found a DLL file named php5apache2_2.dll in the PHP build you downloaded, change
    LoadModule php5_module "c:/php/php5apache2.dll"
    to
    LoadModule php5_module "c:/php/php5apache2_2.dll"
  8. This step is optional. Scroll down a bit and look for something like
    <IfModule dir_module>
    DirectoryIndex index.html
    </IfModule>

    Made changes to the DirectoryIndex and add index.php. The modified one should looks like
    <IfModule dir_module>
    DirectoryIndex index.php index.html
    </IfModule>
  9. Save the file and restart your computer (dont ask, just restart).
  10. Create a text file in your document root (eg. C:/Documents and Settings/user/My Documents/My Website/localhost/www), insert
    <?php phpinfo(); ?>
    into the file, save it and rename it to phpinfo.php.
  11. Start the Apache server as a service if it's not. Apache should be able to load the PHP module and start running. To check if everything is working, open your browser and type in http://localhost/phpinfo.php. You should get a page containing information on your installation of PHP and its settings. If you don’t, try restarting Apache. If Apache says it can't load the php5apache2.dll or it says that the module can't be found refer to Another way to make Apache and PHP work together section below

To manipulate the Apache web server via command line, open a command prompt in Windows, navigate to the folder /bin in your Apache folder and try the following commands.

Some useful command for Apache web server
Command Description
httpd -k install Install Apache as a Windows service
httpd -k uninstall Remove Apache as a Windows service. If you didn't install Apache using windows installer and you want to uinstall it, it's better you call this command before you remove the folder manually.
httpd -k start Tell Apache to start
httpd -k restart Tell Apache to do a graceful restart
httpd -k stop Tell Apache to shutdown



Installing MySQL
  1. Go to MySQL website to download the binary for windows. This guide uses MySQL 5.0.24.
  2. Extract the zip file and run the Setup file.
  3. You should choose the Custom installation, to allow you to select an installation path. Click Next to continue and install it.
  4. When you're asked register with MySQL, Skip it if you don't have time for it. Once the installation is complete, tick the option to launch the MySQL Configuration Wizard and finish it.
  5. On the configuration wizard, select the Standard Configuration option on the first screen and click Next.
  6. On next screen, leave the 2 checkbox in default, check the 2nd one (include Bin Directory in Windows Path) if you want to enter MySQL commands from the command prompt without first having to navigate to the MySQL \bin directory.
  7. On next screen, you can leave the password field blank for root user for you can assign a password for it. Depends on you but I strongly recommend you assign a password.
  8. Click Execute on the next screen to finish the installation. Restart your computer.
  9. After rebooting, to check if MySQL is running properly or not, open a command prompt and type the following command:
    mysql -u root -p
    You need to navigate to \bin in your MySQL folder if you didn't ask MySQL to setup the Path variable during installation. If you didn't setup the password for root user, just remove the -p in the above command.
    If you get "Can't connect to MySQL server on 'localhost'" error message, that means MySQL server is not started yet. Go to Control Panel -> Administrative Tools -> Services and look for MySQL entry. Right click and select Start. Once it's started, you can make a connection to the server using the command stated above.
    Alternatively, you can invoke MySQL by calling the following command:
    mysqld-nt --defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini" MySQL
  10. Once you're connected to server using the root user account, type the following command:
    mysql> show schemas;

    You should get the following results:
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | test               |
    +--------------------+
    3 rows in set (0.26 sec)
  11. Now you need to get PHP to talk to MySQL. Open the php.ini look for "Paths and Directories" section and find extension_dir, change it to:
    extension_dir = "c:/php/ext"
  12. Scroll down and look for ;extension=php_mysql.dll. You need to uncomment it by removing the ';' (semi-colon). It should looks like
    extension=php_mysql.dll
  13. This step is optional. Uncomment the ;extension=php_mbstring.dll if you need multibyte string functions (eg. to process unicode data)
  14. Save the file and start/restart Apache.
  15. *Hint* I strongly suggest that you should download the MySQL Administrator here and MySQL Query Browser here. MySQL Administrator has powerful functions that allows you to manage/browse/backup your MySQL server/database in GUI. MySQL Query Browser is a replacement for MySQL Control Centre. It's a GUI-based program that allows you to test/execute your SQL queries. Install the MySQL Query Browser first before you install the MySQL Administrator.
    Isn't life's good when you do all the things just using your mouse ? =)

Voilà ~~~ ! There you go, everything should be working now. You shouldn't have any problem setup and run MySQL server. However, if everything goes that smooth, I wouldn't have to waste hours yesterday trying to figure out where it goes wrong. I can't get Apache to load PHP module, that's nasty and stupid problem.

Alright, If Apache says it can't load the php5apache2.dll or it says that the module can't be found then the below steps might save you... or not...

Another way to make Apache and PHP work together
  1. *Note* This section of guide assumes that you already install PHP. If not, please complete the steps in Installing PHP section before continue the steps below.
  2. *Updated 2007-01-17* On newer version of PHP (I tested with 5.2.0) you should able to find a DLL file name called php5apache2_2.dll. Now refering to Installing PHP - Step 7, change
    LoadModule php5_module "c:/php/php5apache2.dll"
    to:
    LoadModule php5_module "c:/php/php5apache2_2.dll"
    That should solved the problem and you can skip the steps below. If you're using older version of PHP build, please skip this step and follow the steps below.
  3. If you have Apache installed and you're stuck, uninstall it and remember to delete the folder manually for left overs (windows installer sometimes does not delete the config files, you need to clean it yourself). If you deploy Apache via a ZIP file instead of windows installer, you better do a httpd -k uinstall to uninstall the service then only you delete the folder manually.
  4. Download and install Visual C++ 2005 Redistributable Package from Microsoft. It can be downloaded at the link below:
    Microsoft
  5. Download httpd-2.2.3-win32-x86-ssl.zip (binary by Steffen) from Apache Lounge or use the direct link below:
    http://www.apachelounge.com/download/binaries/httpd-2.2.3-win32-x86-ssl.zip
    *Note* This binary is build with VC 2005, that's why you need Visual C++ 2005 Redistributable Package.
  6. The Apache binary is in ZIP file, there is no windows installer for this build. Unzip and place it to your C:\Program Files\Apache 2.2.3\
  7. Repeat the steps in Installing Apache section to configure your Apache server.
  8. Download php5apache2.dll-php5.1.x.zip from Apache Lounge or use the direct link below:
    http://www.apachelounge.com/download/mods/php5apache2.dll-php5.1.x.zip
  9. Unzip the file. Read the Readme First.txt.
  10. Copy & replace the php5apache2.dll to your php folder (eg. c:/php). Backup the original one if you feel to do so.
  11. Copy httpd.exe.manifest to /bin in your Apache folder.
  12. Open the httpd.conf file from /conf in your Apache folder. Look for ServerRoot and change the path to where you unzip the newly downloaded Apache binary. For example:
    ServerRoot "C:/Program Files/Apache 2.2.3"
  13. Scroll down and look for
    <IfModule alias_module>
    ...
    ...
    ...
    ScriptAlias /cgi-bin/ ...
    </IfModule>

    Make sure the ScriptAlias is set to the correct path. For example:
    ScriptAlias /cgi-bin/ "c:/Program Files/Apache 2.2.3/cgi-bin/"
  14. Scroll down and look for
    # "c:\..." should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    <Directory "c:\...">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
    </Directory>

    Make sure the <Directory> tag has the correct path. For example:
    <Directory "c:/Program Files/Apache 2.2.3/cgi-bin">
  15. Start your MySQL server and hit your Apache server. Your Apache should be able to load the php5apache2.dll now. For extra info, see also : http://www.apachelounge.com/forum/viewtopic.php?t=570

Hope this helps. By the way, I spent another 1/2 hr trying to locate another problem after I get the LAMP up (finally). The problem is that the raw source code of the PHP script is dumped out to my browser instead of excution output from the script. The cause of this problem is because one of the required php file starts with <? instead of <?php ... doh ! How strange, they worked in previous version of PHP5 I installed last time...

*EDIT 2006.08.30*
-- Hide the Visual C++ 2005 Redistributable Package actual link because the long url without spacing will not be wrapped by FireFox 1.5.0.6 during page rendering causing the page become "wide"

*EDIT 2006.09.19*
-- Added a how-to link to "Enable mod_rewrite in Windows"

*EDIT 2007.01.17*
-- Load php5apache2_2.dll instead of php5apache2.dll in newer version of PHP

Last edited: Sat 2006-06-17 @ 20:17 , by DaRen 2 time(s)

MySQL 4.0.21 - 6:35 pm
Who's still using it ?
Software , Web Hosting  -  poster 

Just realize that I'm (still) using MySQL 4.0.21. That's not a big deal if I'm not aware of this before that. However, it makes me feel that I'm stupid because I thought the version I'm using is MySQL 5.0+ which in fact is just 4.0.21. This is horrible... suddenly I just remembered it's almost 3 years I haven't format my harddisk. That also means that I got MySQL server installed for almost 3 years ! gayness...
(well, come to think about it... my notebook survived for so long and it has never been took down by virus/trojan... not too bad eh ? although it's full of craps and spywares...)


Check out the below screen shot, notice the "Date Created: 2004-10-14" ... Also I just checked the MySQL download website, MySQL Control Center is "discontinued", they no longer provide download for it. Well, at least I remember the last time when I download it, MySQL website still consider it as a project that "no longer under development".

MySQL 4.0.21, with MySQL Control Center
MySQL 4.0.21, with MySQL Control Center


I guess I just have to upgrade to the latest version 5.0.22... doh...


Web hosting company using MySQL 5.0+ --- $100+/month
Web hosting company using MySQL 4.1+ --- $10+/month
Web hosting company using MySQL 4.0+ --- Priceless

Iñtërnâtiônàlizætiøn - 1:28 pm
Everything is put up for testing...
Site Issue , Site Updates , Unicode , Web Hosting  -  poster 

Don't be surprised with all those chinese characters appearing all over the main page. I'm just performing a test to see how well my template engine can handle with multibyte characters.

The main content/layout will still be in Engish (well, technically speaking, ASCII). I'll probably use some chinese in some of the blog entries if needed.

Oh ya, Iñtërnâtiônàlizætiøn happy

The MySQL database dump seems to be working fine. However, in server-side, I haven't tried to restore the data from the dump file yet. I'll try it later or tonight since I have something else to do right now =)

PHP, MySQL, Unicode - 9:14 pm
Complicated ? nah... it's VERY complicated
(X)HTML , Site Issue , Unicode , Web Hosting  -  poster 

Serving my site content in XHTML in Unicode has already been on my to-do list for quite a while. I have read alot of articles on how to implement it. Sadly, 90% of the hosting companies are still using old PHP, old MySQL server and not having Multibyte String Functions enabled in PHP. They are not aware of , or just don't like the idea of "Internationalization" eh ?

After checking the specs of my hosting server, PHP seems to be OK but I am not sure about MySQL. It would be waste of time if the server is running a older version of MySQL that completely treats Unicode as something that came from outter space. Anyhow, I'll spend some time on this weekend to work on it. I just love the idea of having having Chinese characters on my site on top of English. Unicode will be my only option to do that. I don't like to serve the page with content="text/html; charset=gb2312", I just need something that can do all the things - Unicode.

By the way, I changed the top horizontal navigation menu on my site. I haven't upload it to this server though. Everything is still on localhost =) The one that's still on this site, it's too "heavy" and runs too slow. It consumes a noticeable amount of CPU performance. The new one will be alot more lightweight and most important thing is, it's still cross browser compatible.

Site will be updated pretty soon... hopefully...

Linux filesystem and permissions - 7:50 pm
Owner ? Group ? Who owns who ?
Computing , Security , Site Issue , Web Hosting  -  poster 

I'm still having trouble with my new hosting environment. They're using different configuration in some areas and taking me time to do Q&A between me and the support team.

For example, in my new hosting environment, PHP is run under the ownership of "Nobody". That means the folders/files created using PHP script has the group 'Nobody' and owner 'Nobody' in Linux filesystem. That doesn't hurt but it's a pain in the ass when it comes to file manipulation through FTP client. That's because when you login through FTP, you belongs to your username group. Thus making you having no rights to manipulate to those files that are create by PHP script. Sounds stupid eh ? (See here)

But that's not the end of the story. If you upload/create the files through FTP, you can't delete them through PHP script because of the owner/group permission issue! That's really stupid but then the answer/solution I got from the support team is

Quote:
You have to first connect to the FTP server from the PHP code in the script . Then with the php script you can create the file/folder. So when you are connected to ftp server and then the file/folder is created then the file/folder has the ownership of the ftp user that you have used in the script. So you will be able to delete this file created from the FTP client.


*Fainted... ... ... ... ... ...*

I suggest them to use suexec or suPHP but I doubt they will ever care about that. Any Linux guru can help me ?

New address !! - 5:50 pm
http://ahkuan.com <--- hot from oven
Site Issue , Site Updates , Web Hosting  -  poster 

Woooohooooo ~~

I'm moving... same as my weblog... Checkout



Finally I got a domain name that "belongs" to me. Well, I can't really owned it, I have to rent it for 1 year =) I'll try to get it working on the weekends, but apparently I won't have time on the weekend as I need to clean up the mess of my house.

This is the first time I have more control over my site... got alot of things to learn ahead.. Oh baby, this rocks my world !!!

ps: If you ever wonder where is the www after http:// .. I can tell you that www is history

darrensoutpost.com OR ahkuan.com - 7:36 pm
which is better ?
Site Issue , Web Hosting  -  poster 

I'm planning to register a domain name. Which one sounds better ?

darrensoutpost.com

or

ahkuan.com


Personally I prefer darrensoutpost.com although it's a bit long. Found a web hosting company in Australia, MD Web Hosting. The price for personal package is acceptable. I'll ring them tomorrow and ask about the server specs and also the software specs.

Let me know what you think =)

Ads banner on this site - 9:38 pm
Aren't they ugly and fat in size ?
Internet , Site Issue , Web Hosting  -  poster 

Ugly banner
Ugly banner
Personally, I 101% don't like the ads banners that are placed on EVERY SINGLE page on my site. I don't have an option unless I pay $USD 0.99 per month to get rid of these ugly banner. I'm not sure since when they changed the banner content from "normal & healthy" banners to banners like "Meet SEXY Singles" or "Cheat At Online Poker" type of banners. I am aware that my hosting company 100Webspace has changed their marking/management strategy/style, but that's not the result I expected. But obviously one thing for sure is that they want to make more money through the new banners. Is that possible ?

I want to get my own domain name and ads free environment ! (there is no free lunch in this world...)

Page 1 of 2   ( 16 entries , showing 1 - 10 )
    1 2 Next  
$ view_blog.php 2009.09.17 18:16:41 $
Lost? | XML/HTML sitemap | Contact
38.107.191.88 , 21 queries , 0.2151s
Gzip enabled , CSS compressed , JS compressed
Copyright © 2005-2009 Darren's Outpost