Recently in L.A.M.P. Category

Ubuntu 9.10 coming soon

| No Comments | No TrackBacks

It is 3 days to go.

Ubuntu 9.10 has many new features since Ubuntu 9.04.

I just list the features I like below:
ext4 by default
better disk performance
Kubuntu Netbook release
I have the netbook.
Empathy replace pidgin
support voice and video
Ubuntu One
personal 2G storage for free

There are so many tips you can google, some are very complicated, some are useless.

Now I want to share my experience to reduce memory usage of Apache on Centos server.

You have to have Webmin installed on your server first.
Server >> Apache Webserver >> Global configuration >> Processes and Limits

There are three figures you can change to reduce the memory usage.
Maximum spare server processes: 20 (default), I changed it to 10
Minimum spare server processes: 5 (default), I changed it to 4
Initial server processes: 8 (default), I changed it to 5.

The total memory usage reduced from about 500M to 300M.
Every httpd occupied 20M roughly. So I cut 10 server processes, is to save about 200M memory.


Webmin Upgrade to v1.490

| No Comments | No TrackBacks

Webmin released Version 1.490 (17th September 2009)

I have the webmin installed on my VPS machine. It helped me to manage the VPS.

Say, add new user, install perl package etc.
You can find it here.

Lxadmin treat Awstats in different way.

The individual configuration file of particular domain or site is located
/etc/awstats/

These files are rebuild ever time the batch file update the Awstats report.

Lxadmin uses a template file here.
/usr/local/lxlabs/lxadmin/file/awstats.model.conf

If you want to change config of the Awstats file, you have to change the template file.

I have a small site hosted on Dreamhost.
Yslow Score with default setting is C, or 77.

Later I do the following optimization to increase it to B, or 89. Based on Yslow v2 test.

The key is to change .htaccess file.
Put following content into .htaccess file on root of the site.


SyntaxHighlighter 2.0

| No Comments | No TrackBacks

I introduced SyntaxHighlighter before. Now it is 2.0 and has a new site.

I implement SyntaxHighlighter in my blog. It is easy for me to put any PHP, CSS, Bash, Javascript and SQL scripts in this blog.
It will shown in good standing.

To make it standard, I put the CSS files in the header of HTML. Put JS files in the bottom of the HTML file.

The most important update is the syntax is changed.

tpl file are smarty template files.

Sometimes I need to add php script, or php code into tpl file. That means I have to add php code into the smarty templates.

If you add php code directly, there is error code.

The right way is to add script like following way.

{php} your php code here {/php}

That's all.

I have a VPS powered by Centos 5.2.

There are some very important forum on it. I would like to backup it every day.
Now because HyperVM/LxAdmin - Backup Home, can not backup MySQL or not easy to get it. I have to write the shell script to do the backup job.

To use the FTP I need lftp tool.

The whole picture looks like below.
1) Dump all MySQL databases and compress them, save them in /home/usera/backup/mysql/
2) FTP them to Backup server of Dreamhost at /vps-backup/mysql/
3) Remove the backup files 4 days old.

You have to use your own account name and password.
usera is my sample user name. You can also use any other FTP server to save your offsite backups.
You make a file under /home/usera/mysql.backup.sh
Put the content below in it, save and make it executive.

It is very often to include another file as a part of your script.

require_once("/path"/to/file.php");


When do this kind of including, should be very careful on following parts.
1) The path to the script is wrong.

2) The path to the script is correct, but the script is in a forbidden directory.


3) The include file has a blank line or space before or after the code in the PHP script.
It is very easy to omit the space after the code.

4) The include file can be viewd by non-PHP methods.

5) You're in include overload.

6) You are using unchecked variables as include filenames.
It may make your site unsafe in some situation.


The tips of including file are learned from "Wicked Cool PHP"

I have the problem to logon my Lxadmin panel of VPS.
I tried upgrading, restarting, still can not logon.

Later I find the way to reset password. It is good enough to solve my problem.

To upgrade Lxadmin through SSH, logon server via SSH with your root user first.

The command is shown as below:
Upgrade lxadmin

/script/upcp

Restart lxadmin

/script/restart

If you forgot your webmin password, you may need read following instruction which will show you how to reset it. Because I did it yesterday afternoon.

First, logon to the server via ssh and sudo as root user, or just ssh on server with your root user.

Second, say, you want to change or reset your password to [newpass].

/usr/libexec/webmin/changepass.pl /etc/webmin root newpass

After that, it will tell you,
Updated password of Webmin user root


About this Archive

This page is an archive of recent entries in the L.A.M.P. category.

jQuery is the previous category.

Money Maker is the next category.

Find recent content on the main index or look in the archives to find all content.

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.01

Subscribe

Online Tools

Code Convertor