Posts tagged with ‘server’

 

After installing Ubuntu Server, you can be in dismay when you are greeted with a command prompt. It’s the 21st century and let’s not act tough that the terminal in the coolest thing. It really isn’t unless you want to show it off to your pals. (On an absolutely unrelated note: Don’t bother flexing your terminal skills to girls, they get impressed with your nerd culture and your coolness drop to -10.)

Okay let’s install some graphical user interface for humans alright. If you want to install GNOME in Ubuntu Server or the Cloud Enterprise Server, you can. And here is how to do it:

sudo apt-get install –no-install-recommends ubuntu-desktop

The no-install-recommends command begins with 2 dashes but WordPress gets hungry and ate one of them so be sure to correct that when typing.

If you leave out the “no-install-recommends” option, Ubuntu installs software such as OpenOffice.org. They’re basically things I don’t want in a server. This is useful when you want a user interface but do not want things like games etc.. All these programs makes Ubuntu feel “unclean” for me. My preferred method of installing Ubuntu is always to use the Server edition and then install the GNOME interface with the above code.

 

Google now does DNS resolving too. You can switch if you’re using OpenDNS.

Introducing Google Public DNS: A new DNS resolver from Google

Today, as part of our efforts to make the web faster, we are announcing Google Public DNS, a new experimental public DNS resolver.

The DNS protocol is an important part of the web’s infrastructure, serving as the Internet’s “phone book”. Every time you visit a website, your computer performs a DNS lookup. Complex pages often require multiple DNS lookups before they complete loading. As a result, the average Internet user performs hundreds of DNS lookups each day, that collectively can slow down his or her browsing experience.

  • Speed: Resolver-side cache misses are one of the primary contributors to sluggish DNS responses. Clever caching techniques can help increase the speed of these responses. Google Public DNS implements prefetching: before the TTL on a record expires, we refresh the record continuously, asychronously and independently of user requests for a large number of popular domains. This allows Google Public DNS to serve many DNS requests in the round trip time it takes a packet to travel to our servers and back.
  • Security: DNS is vulnerable to spoofing attacks that can poison the cache of a nameserver and can route all its users to a malicious website. Until new protocols like DNSSEC get widely adopted, resolvers need to take additional measures to keep their caches secure. Google Public DNS makes it more difficult for attackers to spoof valid responses by randomizing the case of query names and including additional data in its DNS messages.
  • Validity: Google Public DNS complies with the DNS standards and gives the user the exact response his or her computer expects without performing any blocking, filtering, or redirection that may hamper a user’s browsing experience.

(Source: Google)

Just use the following name servers:

nameserver 8.8.8.8
nameserver 8.8.4.4

Nice numbers. They got those from Level 3.

 

I’ve been looking at the pricing of Amazon EC2 (Amazon Elastic Compute Cloud) running as if it were a VPS. I intend to run it continuously for as long as possible. I likely only need a small instance as described here.

Specification of EC2 Small Instance

  • 1.7 GB memory
  • 1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit)
  • 160 GB instance storage (150 GB plus 10 GB root partition)
  • 32-bit platform
  • I/O Performance: Moderate

These are some notes I have made for Amazon EC2. All prices are in US dollar and does not include bandwidth costs as those are far too varying.

I only need the smallest Linux/UNIX instance and the pricing is $0.085 / hour for a server instance in North Virginia, USA without reserving an instance. (There’s going to be one in Singapore next year.)

I can choose to reserve the server instance for 1 or 3 years and pay $227.50 or $350 respectively and pay for $0.03 / hour for a similar instance.

To put the cost into perspective:

For 1 year

  • Without reserved instance: $0.085 * 24 * 365 = $744.60 ($62.05 / month)
  • With reserved instance: $0.03 * 24 * 365+ $227.50 = $490.30 (~$40.86 / month)
  • Percentage saving after 1 year: (744.60 – 490.30) / 744.60 = ~34.1%

For 3 years

  • Without reserved instance: $0.085 * 24 * 365 * 3 = $2233.80 ($62.05/ month)
  • With reserved instance: $0.03 * 24 * 365 * 3 + $350 = $1138.40 (~$31.62 / month)
  • Percentage saving after 3 years: (2233.80 – 1138.40) / 2233.80 = ~49.0%

I’m currently on Slicehost and Rackspace Cloud. They’ve been pretty good so far but Amazon’s cloud computing offering is beginning to look quite tempting.

 

This isn’t exactly the latest news but — Amazon Web Services expands to Singapore. Expansion to Singapore would keep Singapore web hosting prices a lot more competitive. Amazon is bringing to Singapore:

  • Amazon Elastic Compute Cloud (Amazon EC2),
  • Amazon Simple Storage Service (Amazon S3),
  • Amazon SimpleDB,
  • Amazon Relational Database Service (Amazon RDS),
  • Amazon Simple Queue Service (Amazon SQS),
  • Amazon Elastic MapReduce,
  • Amazon CloudFront.

Yes EC2 is coming to Singapore over the second half of 2010. I am considering migrating some stuff over to Amazon due to its pricing.

Amazon Web Services Announces Expansion into Asia in the First Half of 2010

Amazon Web Services LLC, an Amazon.com company (NASDAQ:AMZN), today announced an expansion of its services into an Asia-Pacific region in the first half of 2010, enabling businesses to deploy compute and storage resources in close proximity to their end-users in the region. Software developers and businesses will be able to access AWS’s infrastructure services from multiple Availability Zones in Singapore in the first half of 2010, then in other Availability Zones within Asia over the second half of 2010. AWS services available at the launch of the Asia-Pacific region will include Amazon Elastic Compute Cloud (Amazon EC2), Amazon Simple Storage Service (Amazon S3), Amazon SimpleDB, Amazon Relational Database Service (Amazon RDS), Amazon Simple Queue Service (Amazon SQS), Amazon Elastic MapReduce, and Amazon CloudFront. (Source: Amazon)

Amazon has yet to release the pricing for Singapore but I’m guessing it would cost about USD0.20 per hour. Hosting hasn’t been that cheap in Singapore currently. If they charge less than USD$0.14 per hour for a small Linux EC2 instance, I would start advocating people to switch. Currently in US, Amazon charges USD$0.085 per hour. VPS hosting in Singapore is still kinda expensive for whatever reasons. Running a website really shouldn’t be that costly.

 

There are times where some processes use too much resources. You can use “ps aux” to get a list of all the processes that are currently running. But what about having them sorted? Here is one way. This works in Ubuntu Linux.

Top 10 % CPU usage

ps aux|sort -nr -k3|grep -v USER|head -10

Top 10 % Memory usage

ps aux|sort -nr -k4|grep -v USER|head -10

The following is the sample output for Top 10 % memory usage:

briecheese ~: ps aux|sort -nr -k4|grep -v USER|head -10
www-data  3883  2.9 14.1 107052 37176 ?        S    11:44   1:46 /usr/bin/php-cgi
www-data  3882  2.9 13.8 107664 36264 ?        S    11:44   1:46 /usr/bin/php-cgi
www-data  3881  1.2 13.2 106768 34688 ?        S    11:44   0:44 /usr/bin/php-cgi
www-data  3884  3.1 13.1 107244 34592 ?        S    11:44   1:54 /usr/bin/php-cgi
www-data  3879  1.1 11.8 106888 31160 ?        S    11:44   0:40 /usr/bin/php-cgi
www-data  3880  0.9  9.5  94232 25092 ?        S    11:44   0:34 /usr/bin/php-cgi
mysql     3659  3.5  6.9 277256 18200 ?        Sl   09:45   6:25 /usr/sbin/mysqld –basedir=/usr –datadir=/var/lib/mysql –user=mysql –pid-file=/var/run/mysqld/mysqld.pid –skip-external-locking –port=3306 –socket=/var/run/mysqld/mysqld.sock
root      4103  0.2  1.0  53468  2704 ?        Ss   12:44   0:00 sshd: me [priv]
me    4106  0.0  0.8  18128  2116 pts/0    Ss   12:44   0:00 -bash
www-data  3875  0.0  0.7  57440  1972 ?        S    11:44   0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf

Percentage memory usage is the 4th column. This is useful when you need a quick overview of what’s consuming the most memory. [Thanks U-Zyn]

 

Look who’s here. It’s Microsoft Internet Information Services 7.

Microsoft Internet Information Services 7

Microsoft Internet Information Services 7

How welcoming. Bienvenue.

 

This is pretty easy and is more of a personal note. First check that mod_redirect is enabled in lighttpd.conf:

sudo nano /etc/lighttpd/lighttpd.conf

Uncomment the line that write “mod_redirect”.

server.modules = (
  "mod_rewrite",
  "mod_access",
  "mod_alias",
  "mod_accesslog",
  "mod_compress",
  "mod_redirect",
  …

Then add the following at the bottom of your lighttpd.conf:

$HTTP["host"] =~ "^www.(.*)" {
  url.redirect = ( "^/(.*)" => "http://%1/$1" )
}

Finally, give lighttpd a restart and test it out:

sudo /etc/init.d/lighttpd restart

Hope it helps.

After I made the switch to Lighty, I totally forgot to do redirect all my www sites to no-www, this results in all people who visit www.darylli.com to be shown the default site which is what you see here basically.

 

WordPress powered and Django inspired.
Love and elephants come after.
RSS: Posts and comments.