|
|
2012 May 13
The most common software bundle is LAMP in the past.
What is LAMP? Linux + Apache + MySQL + PHP
How about LNMP? it is almost the same, except the change of the web server from Apache to Nginx. Why there is such change? Loading and performance issue.
Apache will consume a lot of memeory, if you are using just very low-end vps, your vps maybe down due to all memory are being used. we have bad experinece in the past for OpenVZ, the apache eat up all memory and the machine shutdown and need reboot.
In recent year, Nginx become more popular, few benchmarks make comparison between both, Nginx seems a lot better on load balancing and memory consumption.
One of the disadvantage is that you could not use .htaccess anymore. You have to re-learn the syntax of Nginx to adapt your needs.
Tags: apache, lamp, lnmp, nginx Category Apache, Nginx |
2012 May 07
vps hosting – openVZ or XEN
this is the two main choices of vps hosting. which one do you need?
1. i need an independent environment
Your choice is XEN. XEN is similar to a dedicate server, other nodes on the same server will not affect you.
openVZ nodes would affect each other, however, the system resource usage is much less than XEN.
2. i am a linux starter
If you are not so familiar with linux environment, you can try openVZ first.
After you are confident, you can try XEN, based on price concern.
3. i need to see all logs
Your choice is XEN. we have try using openVZ, however, some logs are missing, for example auth.log, boot.log, dmesg, kern.log.
If you need to have a deep trace on the server, you can only choose XEN.
4. i need swap control
OpenVZ do not have swap. If you use up all the memory, your server would shutdown immediate.
However, for XEN, even if you use up the memory, you still have swap for buffer.
5. i need a better server performance
If OpenVZ is not oversell and have enough spare resource, the average performance of OpenVZ is much better than XEN.
Category hosting, technology |
2012 May 06
if your website has to face the whole world, you have to think of the loading time of each page in your website.
if your website is just plain text format with little graphics, it is ok to just host on one server.
However, if your website involve heavy graphics, videos or even flash, some regions would have loading issue on your website.
Most likely cloud hosting actually can solve your problem, but if you have limited budget, you have no choice.
CDN stands for Content delivery network, it is much similar to cloud hosting, they call it CDN nodes.
what you have to do is to change all images pointing to a sub-domain, like http://cdn.yourdomain.com.
CDN nodes are placed on different locations, visitors may get the graphics, videos from the nearest CDN node.
There are different pricing plans, some are in monthly basis, some are in bandwidth usage basis, for eaxmple 1TB per year. There are lots of CDN providers, just google it and you could find some.
Tags: CDN, cloud Category CDN, technology |
2012 May 05
we are now moved to the new VPS server and really said goodbye to shared hosting.
we tried a few unlimited shared hosting but all of them has some issues:
1) unlimited is not really unlimited, take care the terms and condition
2) website got redirect or rewrite easily
3) if the server you hosted got hacked, technical support cannot help
4) down time really cannot control (sometimes VPS too)
we moved to use VPS for around 1-2 years, it is really a good choice as compare to shared hosting because you can customize the server you want.
However, you have to take care the bandwidth and storage space usage very carefully.
so depend on your budget, in the internet world, you have these choices:
1) shared hosting
2) VPS hosting
3) semi-dedicated server hosting
4) dedicated server hosting
5) cloud hosting
we did not yet try cloud hosting due to its high cost…
if you have enough budget, you would choose cloud hosting or dedicated server hosting.
However, due to the budget concern, you have to select among the choice 1-3.
we are now using the VPS server from vps6 provider.
Tags: cloud hosting, dedicated server, shared hosting, vps, web server Category hosting |
2011 Jul 08
we find out a bug in IE7 or above recently.
If you use php session, you can run in firefox, google chrome but cannot never success in IE7 or above.
There are many topics discussing the same issue, for example adding p3p, change session.use_trans_sid, change timezone….however, there is one security issue in IE7 or above which let the above solution no longer working.
If the domain/sub-domain name contains an “underscore“, your session cookie will never be created….
for example:
sub_domain.domain.com
the security issue from Microsoft (DNS section):
http://support.microsoft.com/kb/909264
Tags: ie, PHP, session fail, sub domain, underscore Category IE, PHP |
2011 Apr 26
first, you need to set these parameters in apache configuration file:
Listen 443
NameVirtualHost *:443
Then, you need to link up to your
SSL key SSLCertificateFile /tmp_path/SSL.crt
SSLCertificateKeyFile /tmp_path/SSL.key
Finally setup the virtualhost,
<VirtualHost *:443>
ServerName SUB.YOURDOMAIN.com
DocumentRoot “/YOUR_ROOT_DIR/”
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProtocol -all +SSLv3 +TLSv1 SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:!LOW:!SSLv2:!EXP <Files ~ “\.(cgi|shtml|phtml|php3?)$”>
SSLOptions +StdEnvVars </Files> SetEnvIf User-Agent “.*MSIE.*” \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \ “%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \”%r\” %b” </VirtualHost>
restart your apache, fill in your password and SSL for wildcard domain is working now!
Tags: apache, config, sites-available, SSL, virtual host Category Apache, SSL |
2011 Mar 25
if you want to capitalize each first letter through MySQL, you can write a function, and write SQL directly to update the column, here is the sample code:
DELIMITER $$
CREATE FUNCTION CAP_FIRST_CHAR (input VARCHAR(255))
RETURNS VARCHAR(255)
BEGIN
DECLARE length INT;
DECLARE i INT;
SET length = CHAR_LENGTH(input);
SET input = LOWER(input);
SET i = 0;
WHILE (i < length) DO
IF (MID(input,i,1) = ‘ ‘ OR i = 0) THEN
IF (i < length) THEN
SET input = CONCAT(LEFT(input,i),UPPER(MID(input,i + 1,1)),RIGHT(input,length – i – 1));
END IF;
END IF;
SET i = i + 1;
END WHILE;
RETURN input;
END$$
DELIMITER ;
update table set table_col=CAP_FIRST_CHAR(table_col);
Tags: capitalize, mysql Category MySQL |
2011 Jan 23
why you cannot create new folders / edit file name / save files under your mac desktop?
The root cause of it is because your desktop is locked.
if you can create new folders / edit file name / save files in other folder, then you can do it in this way to solve the issue:
1. open the hard disk and right click the folder “Users”
2. select File -> Get Info, scroll down to “Ownership & permissions”
3. change Owner Access to “Read & Write”, change Group Access to “Read only” if it is not
4. navigate into “Users” folder, right click “Desktop” folder.
5. change Owner Access to “Read & Write” if it is not
Tags: desktop is locked, mac Category MAC |
2011 Jan 23
what browser is the most popular amount users?
most properly is Internet Explorer because Internet Explorer is the default browser of windows.
At least about 60% of users leak of technical skill and they are not able to install other browsers like firefox/chrome themselves.
Most of the developers hate Internet Explorer, are you the one?
Different version of Internet Explorer ARE different and hence we need to write our script, especially javascript and css very carefully.
Otherwise, one version of IE work, the other version won’t work.
Other browser like firefox, google chrome are better, even they change the version, it would not effect much.
However, users or even customers would not care about how difficult to handle such browser issue, and that’s why developers have to take care all buggy stuffs ourseleves.
Internet Explorer does not handle well on javascript, so we need to take serious care on the development, otherwise the browser will prompt
“a script on this page is causing Internet explorer to run slowly [1]” or “Timeout while Internet Explorer busy [2]“.
Although these are solutions to solve the popup issue, however, the running speed isn’t solved.
solve for IE popup issue
[1] http://go.microsoft.com/?linkid=9729250
[2] download here
Tags: ie, javascript, popup prompt, timeout Category IE, javascript |
2010 Apr 14
If you use SSL, ie will get issue when download file if the PHP header using
header(“Cache-Control: no-cache, must-revalidate”);
header(“Pragma: no-cache”);
When you click the file you want to download, ie will prompt:
“Internet Explorer was unable to open this site.The requested site is either unavailable or cannot be found.Please try again later”
Here is the link talk about this:
http://support.microsoft.com/kb/323308
However, we just need to do some modifications on PHP header and it can actually work.
Here is the PHP header modification:
header(“Content-type: application/octet-stream”);
header(“Content-Disposition: attachment; filename=YOUR_OWN_FILE”);
header(“Cache-Control: private, must-revalidate”);
It should work even on ie now!
header(“Pragma: private”);
Tags: download file, header, ie, PHP, SSL Category IE, PHP, SSL |
|