Archive for category LAMP

Last LAMP update in CentOS 5/6

PowerStack is a repository that allows you to run the latest LAMP versions in your Enterprise Linux. Currently both CentOS and RHEL are supported (i686 and x86_64).

rpm -Uvh http://download.powerstack.org/powerstack-release-0-2.noarch.rpm
yum update php

From http://wiki.powerstack.org/PowerStack

It’s a very cool project, thanks for the developers.

No Comments

how to get latest php mysql

There are many ways, you can compile by yourself, but not good in production env.

Here is option from iuscommunity.org

We are committed to providing up-to-date and regularly maintained RPM packages for the latest upstream versions of PHP, Python, MySQL and other common software specifically for Red Hat Enterprise Linux and clones.

Ref: http://iuscommunity.org/Docs/ClientUsageGuide
Try at your own risk. :)

No Comments

the optimization of ecshop

One game with optimization of ecshop.

We use eaccelerator as op for php code. also tested APC and Xcache. seems EA is better on ecshop. it finally turn out the speed is slow down by the session on DB part.

ecshop stores the session into DB. so there are lots of insert/update when the visit cocurrency is very high. but the DB load looks normal, that’s why we spent some time to hit the point. finally check with show processlist. found lots of operation on session table.
then we commented the code related with session. the speed of the site improved a lot.

session be stored in DB maybe better with security or load banlance. but it can be replaced with Memcache. the speed should improve a lot.

Tips from on LAMP op:

http://www.ibm.com/developerworks/linux/library/os-5waystunelamp/index.html

,

No Comments

Install Php5.2 with Yum

Install Php5.2.x with yum.
1. Enable development repositories on CentOS, but only for i386

http://wiki.centos.org/HowTos/PHP_5.1_To_5.2

2. Only for Test Enviorment, not recommend for Prod. :)
$rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
# create /etc/yum.repos.d/utterramblings.repo
$vi /etc/yum.repos.d/utterramblings.repo
# paste the following lines
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

$yum update php

http://www.jasonlitka.com/yum-repository/

No Comments

Home permission

when we open user_dir in apache, we should change the /home as 711
i changed it to 711 no,but still have some problems

the developer use Ruby , it shows the following in apache error log.
Permission denied: xsendfile: cannot open file:
change the directory that store the file, it works well.

so seldom use /home/user to store some files that apache will visit.

,

No Comments

Use Google Js API or YUI if u can

at the title, benefits in short
1. the Google use CDN, so the clients can browser faster than your own server.
2. use it can save ur bandwidth and network usage
3. Increases Number Of Parallel Downloads

but in China, maybe not well enough, because the Google is f**ked sometimes.

Refer: Read the rest of this entry »

, ,

No Comments

Web Cookies

The programmers met a problem when use Typo3, the clients can’t login with IE but can login with Firefox/Opera.
After the investigation , we find the problem is the cookies. Typo3 can set the domain for the cookies. change the setting to “.domain.com” it works.

btw, close the browers and clean the cookies the most right way.
In order to do this properly, remember to close your browser first. This is because all your cookies are held in memory until you close your browser. So, if you delete the file with your browser open, it will make a new file when you close it, and your cookies will be back.

Refer of the cookies.

http://www.cookiecentral.com/faq/

http://www.howstuffworks.com/cookie.htm

http://tools.ietf.org/html/rfc2109

http://tools.ietf.org/html/rfc2965

, ,

No Comments

Apache modules for un-kind users

Modules for block some un-kind users. to some extents, it can do some help with DDoS

Modules Name:
mod_memcache_block
FEATURES:
Distributed White and Black listing of IPs, ranges, and CIDR blocks
Configurable timeouts, memcache server listings
Support for continuous hasing using libmemcached’s Ketama
Windowded Rate limiting based on Response code (to block brute-force dictionary attacks against .htpasswd, for example)

http://github.com/netik/mod_memcache_block/tree/master

I wrote a shell scripts to trace Apache log formerly.
such as I read the last 50000 visit log, and check the same ip’s active status.
use iptables block it. and free it in some minutes laters.

this modules is more friendly i think.

No Comments

Apache之suExec

Apache的suExec可以通过切换用户来提高一些应用的安全系数
今天配置的时候出现下列错误
“Internal Server Error”
检查日志
(13)Permission denied: exec of ‘/usr/sbin/suexec’ failed
[Mon Mar 02 13:35:55 2009] [error] [client myip] Premature end of script headers: index.cgi
Read the rest of this entry »

No Comments

MySQL生产中Tips

1、my.cnf的检查工具
mytop mysqlreport

2、允许mysql query caches

3、Optimize tables 的效果比服务器调整更好一点,如果不能确定优化对象,启动slow query log

4、my.cnf参数调优
key_buffer = 20%-50% Physical Ram
du -sh */*.MYI 检查index的大小,可以作为决定key_buffer大小的依据

5、调整服务器参数
set global key_buffer_size=128*1024*1024 (即128M)
可直接生效
修改my.cnf
下次启动后生效

5、更多

No Comments