菜鸟的VPS指南 – VPS新手教程

On 2010/04/04, in Tip, by silentlulu

最近买了个便宜VPS练手,等拿到手上登陆一看却傻了眼,这个VPS用的是VePortal控制面板,跟之前使用的普通虚拟主机常用的cPanel相去甚远,十分简陋。其中倒是有个Install cPanel的选项,但是点击安装之后却无法登陆。仔细思索后才发现原因让人相当之囧,那就是,本人并没有购买cPanel服务。擦汗,这不是图省钱吗?便宜果然有便宜的原因啊。这下子小女子真的觉得有些棘手了。这就意味着所有需要的服务器端的程序,包括常用的php,mysql,等都需要自己安装,而且使用的是Linux服务器,无法像Windows直观的进行远程控制,只有使用Putty等SSH连接工具进行远程安装。

万幸的是,俺还有谷哥和百度娘两位的大力帮助(虽然谷哥最近远走他乡,但是却并未忘记俺们这些贵国的可怜人,泪~俺啥也不说了hang~)。

关于Putty的使用,网上有很多非常详尽的教程给大家参考,我在这里只讲一下如何登陆,因为这个问题也让本人小困扰了一下。表鄙视我,说了我是菜鸟嘛!首先用户名,一般都是root,注意不要错以为是VPS控制面板的账号哦!一开始我就是把这个搞错了!然后是密码,这个一般在注册好VPS之后空间商发给你的邮件里能找到,建议大家第一时间把密码改掉,为安全考虑。另外还有一点小提示:Putty中使用粘贴直接点鼠标右键就可以了,但是在输入密码的时候,即使你点击了右键它也是不显示的,所以不要以为是没粘贴上,直接回车就好了。

首先俺照着教程就安装了一个LNMP(Nginx+MySQL+PHP+phpMyAdmin+eAcelerator)一键安装包,过程倒是十分顺利,这里就不做赘述,有需要的朋友可以直接百度之(或谷歌之),然而一个巨大的问题摆在姑娘面前,用惯了图形化的控制面板,再使用Putty这样的远程工具实在是无法适应,尤其是本人还是个对Linux一窍不通的菜鸟。。。在几个VPS博客闲逛一圈下来之后发现了解决办法,那就是安装Kloxo(原名Lxadmin)。

Kloxo是一个开源的VPS控制面板,优点是免费,功能齐全,缺点是只支持Centos-5-x86系统。不过大多数VPS都支持多种类型的系统,如果你现在使用的不是这个系统,可以在VPS控制面板上找到重装系统的选项,然后选择安装此系统就可以了。接下来就是安装部分,这个让我纠结了两天时间!

安装过程其实很简单,用Putty登陆之后,只要按照下面的程序就可以安装了。
wget http://download.lxlabs.com/download/kloxo/production/kloxo-install-master.sh
sh ./kloxo-install-master.sh
Kloxo安装过程实际上也包含了Apache、Lighttpd、MySQL、Xcache、Bind、Djbdns等一系列服务器软件的安装,很省事吧。

接下来做进一步的配置,大家可以按需要选择是否安装。
yum install php-bcmath /*高精度数学运算组件,默认没安装,MD5运算时用到*/
yum install php-mhash
yum install php-mbstring
yum check-update (检查更新)
yum update (更新所有更新)
yum install php-bcmath (比较重要的php组件,默认没安装)
yum clean all (清理安装包)

网上找到的教程都说完成以上的步骤,关闭Putty,就可以登陆Kloxo了。第一次登陆用户名和密码都是admin,地址:
https://IP:7777/ /*安全连接,不过默认证书不受IE信任*/
http://IP:7778/ /*还是用这个普通链接吧*/

但是郁闷的事发生了,本人死活就是打不开上面两个地址,ping也ping不通,访问http://IP会出现以下一段英文:

This is the Kloxo Default Page

If you are seeing this page, it means that web has not been configured for this domain on this server.

This could be due to the following causes:

# Kloxo has not restarted the web server yet after you added the domain. Please wait for the web server to restart.

# The domain is pointing to the wrong Kloxo server. Ping the domain and make sure that the IP matches one of the IPaddress seen in admin home -> ipaddresses

# If you are seeing this page when you try to access an IP like http://192.168.1.1, then that means that the IP has not yet been mapped to a domain. Go to client home -> ipaddresses -> ipaddress home -> domain config and map an IP to a domain.

# Once you map an IP to a domain, then you have to make sure that the domain pings back to the same IP. Otherwise, if you try to access the domain, you will get this page. So IP -> domain.com should mean that domain.com pings to the same IP.

重装了好几次都不行,最后还把VPS整熄火了,怎么也启动不了,最后还是联系了客服才给重新启动。之后又小心翼翼的再试了几次还是不行,心灰意冷之时又转向百度娘求助,终于得到了完美的答案。

这是OpenSSL的一个bug,Kloxo不支持最新的SSL,因此需要降到低版本。如果你像我一样,来回折腾过好几遍了,建议重装系统,并按照上面的步骤重装Kloxo再进行下面的步骤。如果你很幸运的在发现问题时及时的看到我这篇文章,那么恭喜了,直接Go on吧!
wget http://ftp.belnet.be/mirrors/ftp.centos.org/5.4/updates/i386/RPMS/openssl-0.9.8e-12.el5_4.1.i686.rpm
rpm -e –nodeps openssl-0.9.8e-12.el5_4.6
rpm -ivh openssl-0.9.8e-12.el5_4.1.i686.rpm
yum downgrade openssl mod_ssl httpd
/etc/init.d/kloxo restart

再刷新下http://IP:7778/,是不是可以访问了呢?

登陆Kloxo,发现全是鸟问啊,英文不好的同学要郁闷了,怎么办呀?其实方法很简单,装个中文包嘛。(声明:本人鸟文还行,所以并没有安装中文包,下面的内容来源于网络,并不保证一定可以,请大家斟酌使用,鞠躬~)
cd /usr/local/lxlabs/lxadmin/httpdocs/lang kloxo的是:cd /usr/local/lxlabs/kloxo/httpdocs/lang
wget http://soft.vpser.net/lxadmin/lxadmin_cn_pack.zip
unzip lxadmin_cn_pack.zip (如果没有安装unzip命令请执行yum -y install unzip进行安装)
访问http://你的IP:7778/ 进行语言设置
在Appearance->Language里选择Chinese,然后点击update确认.

进入Kloxo之后是不是发现熟悉感又回来了?有一点需要注意,Kloxo需要先设置ns和域名才能设置ftp的,随便填写都可以,否则ftp是连不上的。不知道其他朋友有没有遇到和我相同的情况?

到这里VPS简单的设置好了,能像以前虚拟主机一样使用了,剩下的工作还需要进一步摸索。俺们菜鸟的口号就是:不怕宕机,老鸟就是这样炼成的哟!

本文链接:http://www.silentlulu.com/2010/04/vps-kloxo-insall/

Tagged with:  

One of the easiest ways to reduce page response times is by optimizing your website images to reduce their file sizes as much as possible. Optimizing images not only makes your web pages load faster, but also reduces your bandwidth consumption, which can translate to significant savings in your hosting bills.

There are several free tools available at your disposal to shrink and optimize images. In this article, you will find convenient and user-friendly tools for making your web images as tiny in file size as possible.

1. smush.it!

smush.it!

smush.it! makes optimization of your images a breeze. Created by Stoyan Stefanov and Nicole Sullivan, smush.it! is a tool that is available as a Firefox extension, a bookmarklet, or as a simple web-based application (hosted by Yahoo!). It takes in most types of image formats, and automatically converts GIFs to PNGs (because they’re virtually the same, only that PNGS weigh a whole lot less).

2. RIOT

RIOT

RIOT – which stands for Radical Image Optimization Tool – is an image optimizer for Windows users that is available as a standalone application or as an extension of IrfanView. It supports inputs in JPG, PNG, and GIF files and has the ability to strip out image metadata for further reduction of file bloat. It also has some basic image-editing utilities such as pan, zoom, and rotate, and flip built in.

3. PNGOUT

PNGOUT

Created by game programmer Ken Silverman, PNGOUT is a popular, free, and no-frills tool for lossless optimization of your images. PNGOUT can run in the command-line or Windows Run dialog box. It has a robust set of options so that you can easily customize the way your files are compressed. It takes most of the popular image file formats (such as JPG, GIF, and PNG).

4. Online Image Optimizer

Online Image Optimizer

The Online Image Optimizer from Dynamic Drive is a web-based tool for compressing your images further. You can either provide the link to the image you wish to optimize, or upload it from your local machine. Besides optimization, you can select what output you’d like the optimized image to be (the default is the same file type as the input). The limitation of Online Image Optimizer is that it only accepts images less than 300 KB.

5. SuperGIF

SuperGIF

SuperGIF is a free utility for Windows and Mac OS users that optimizes your GIF images. It has an intuitive and simple user interface that allows for drag and drop interaction, and it can compress GIFs 50% more in some instances. The free version can only compress one GIF at a time, but it has all the same features as the commercial version ($29.95) except batch processing.

6. PNGGauntlet

PNGGauntlet

PNGGauntlet is a .NET GUI application for PNGOUT. It can be used to convert JPG, GIF, TGA, PCX, and BMP to highly optimized PNG files. PNGGauntlet is perfect for individuals that are uncomfortable working in the command-line/Windows Run dialog box, but would still like to take advantage of PNGOUT’s superior optimization algorithm. Check out PNGGauntlet’s FAQ page or its forum to get help in case you run into trouble using it.

7. PNGCrushrrr

PNGCrushrrr

PNGCrushrrr is a free GPL-licensed Mac OS utility for crushing down your PNG files to very small sizes. It has a drag-and-drop interface, allowing you to drag one or more PNG files into it, compressing the files and preserving the original file so you are able to compare the size difference. The creator says that PNGCrushrrr is best used on PNG-24 files.

8. SuperPNG

SuperPNG

SuperPNG is a free Photoshop plugin for saving significantly smaller PNG files compared to Photoshop’s native save feature for PNG’s. It also includes some advanced PNG-creation features such as 16-bit color support, variable compression, gamma correction, and metadata saving. Check out some PNG samples saved by SuperPNG in the PNG Samples page.

What’s your image optimization tool?

If your favorite image optimization tool isn’t on the list, please share it with us in the comments: let us know why you prefer it over other image optimization tools.

Tagged with:  

Minimizing the filesize of the CSS stylesheet has been regarded by many as a good way to increase your site loading speed. Indeed, by reducing the CSS file by several kilobytes, the server will take a shorter time to load and result in a faster webpage.

In the event that your articles hit the Digg frontpage, this could also be one of the few deciding factors (there are many more) whether your server will crash or not.

Some of the most common methods used to minimize/ optimize a CSS stylesheet involves eliminating unused selectors, unwanted whitespace, tabs, comments and change the longhand declaration to shorthand notations.

I know that some of you here are not tech-savvy enough to edit your own CSS code, so here I will provide you with some of the useful tools that you can use to optimize your CSS code, even if you have completely no knowledge of CSS coding.

Check your CSS code

W3C CSS Validator

The W3C CSS validator is a tool that you can use to validate your CSS. You can either download the Java validator to your computer and use it offline, or use the online form to check your CSS code.

w3c-validator - check css code

CSS Validator Firefox Add-On

To make it easier for you to validate your CSS code, there is this Firefox extension – CSS Validator – that you can install on your browser. Once installed, you can easily and quickly check your code with a right click of the mouse.

CSSCheck

Even though your CSS code is validated, it does not mean that it is free from error. The validation only means that it complies with the CSS standards set by the W3C. If you want to validate as well as looking into a few browser compatibility issues with your stylesheet, then CSSCheck is a good tool for you.

CSS Analyzer

CSS Analyzer is an useful tool that allows you to validate your stylesheet against the W3C’s standard, perform a color contrast test, and a test to ensure that relevant sizes are specified in relative units of measurement.

In case you are wondering, the color contrast test is to check that the foreground and background color combinations provide sufficient contrast when viewed by someone having color deficits, or when viewed on a black and white screen.

Clean up your CSS code

Dust-Me Selectors

Dust-Me Selectors is a Firefox extension that finds unused CSS selectors on the page that you are viewing. As you test subsequent pages of the same domain, the result is cross-checked with the previous data and any selectors encountered are crossed off from the list. You can use it to test individual pages or get it to spider the whole site.

In the end, you will get a report on the selectors that are not used anywhere in the site. You can then remove those selectors from your stylesheet (lesser code means smaller filesize).

clean css tool

CSS Redundancy Checker

Similar to Dust-Me Selectors, this tool checks your site for unused and redundant CSS selectors. The only thing that is different is that you need to manually enter the URI for each page that you want to test.

css-checker

Optimize and Compress your CSS code

Once you have completed checking the validity of your CSS and cleaned up unnecessary code, it’s time to optimize CSS file and reduce it to the smallest possible size.

CSS Tidy

CSS Tidy is an open source software that you can use to optimize and compress your CSS file. It is available in .exe format (Windows only) and a zipped php script format (all platforms, for Web developers). What CSS Tidy does is mainly remove the comment, unnecessary whitespace and change some of the code to shorthand. During compression, you can choose between code readability or maximum compression. Depending on the length of your code, you can easily achieve a compression ratio of up to 30% or more.

Since CSS Tidy is an open source project, there have been several websites that use the code and turned it into an online tool for people to use. Here are some of them:

Other CSS Optimizers

FlumpCakes CSS Optimizer

A simple optimizer that comes with several options for you to choose from.

flumpcakes-css-compressor

Robson CSS Compressor

While it may look the same as others, I have found the compression rate for Robson CSS Compressor to be the highest among them all. Although it comes with several options for you to tweak the setting, leaving all the options untouched (all options checked) always produces the best result.

CSS Drive CSS Compressor

The CSS Compressor offered by CSS Drive comes in two modes that you can use: Regular and Advanced. In the Regular mode, you only need to select which level of compression you want (Light, Normal or Super Compact) and the CSS Compressor will do the rest. In the Advanced mode, you are given more options and a greater say on how you want your stylesheet to be optimized.

CSS Optimizer

The CSS Optimizer from mabblog.com is a command line application for Mac and Linux. It is meant for those who are more comfortable with the terminal rather than an online interface. There is also a simple online version available for those who want to quickly get it over and done with.

Hopefully the tools listed here are enough for you to tweak and optimize your CSS stylesheet. If you have used any other tools that are more useful than those mentioned above, share them with us in the comments.

From: http://www.makeuseof.com/tag/useful-tools-to-check-clean-and-optimize-your-css-file/

说明:近期在做SEO流程标准化的工作,代码优化是其中一个必要步骤,查阅了不少相关资料,发现了以上文章,很受用。不知道最近有没有时间,想把这篇文章翻译一下,MS相关的中文资料并不是太多,希望有所帮助吧。

Tagged with: