Archive

Archive for the ‘LNMP | LAMP’ Category

php5.3安装Zend Guard Loader

May 15th, 2013 1 comment

帮网友安装的是webmin,系统是centos6 32bit,安装完毕,php是5.3.3,网友需要安装shopex,需要zend支持,php5.3以后,不支持zend optimizer了,改Zend Guard Loader。安装过程也比较简单。

cd /usr/local/src

wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz

如果是64位,请下载:

http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz

tar zxvf ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz

cd /usr/local/src/ZendGuardLoader-php-5.3-linux-glibc23-i386/php-5.3.x

cp ZendGuardLoader.so /usr/lib/php/modules/

vi /etc/php.ini

末尾增加:

[zend.loader]

zend_loader.enable=1

zend_extension=/usr/lib/php/modules/ZendGuardLoader.so

service httpd restart重启httpd即可。

然后php -v看看Zend Guard Loader是否安装成功。

[[email protected] etc]# php -v
PHP 5.3.3 (cli) (built: Feb 22 2013 02:37:06)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies

附Zend Guard Loader英文安装说明:

Zend Guard Loader installation instructions
——————————————-

1. Extract the Zend Loader package.

2. Locate and extract the ZendGuardLoader.so (Linux) or ZendLoader.dll (Windows) that corresponds to your php version.

3. Add the following line to your php.ini file for loading the ZendGuardLoader:
Linux and Mac OS X: zend_extension=<full_path_to_ZendGuardLoader.so>
Windows non-thread safe: zend_extension=<full_path_to_ZendLoader.dll>

4. Add an aditional line to your php.ini for enabling ZendGuardLoader
; Enables loading encoded scripts. The default value is On
zend_loader.enable=1

5. Optional: following lines can be added your php.ini file for ZendGuardLoader configuration:

; Disable license checks (for performance reasons)
zend_loader.disable_licensing=0
; The Obfuscation level supported by Zend Guard Loader. The levels are detailed in the official Zend Guard Documentation. 0 – no obfuscation is enabled
zend_loader.obfuscation_level_support=3
; Path to where licensed Zend products should look for the product license. For more information on how to create a license file, see the Zend Guard User Guide
zend_loader.license_path=

6. If you use Zend debugger as well, please make sure to load it after the Zend guard Loader

7. If you use ioncube loader, please make sure to load it before Zend guard Loader

8. Restart your Web server.
~

lnmp重新编译安装InnoDB

May 12th, 2013 2 comments

mysql-innodb

帮网友搞了LNMP一键包,需要InnoDB,之前的lnmp0.8没有带InnoDB,所以需要重新编译安装下mysql,让mysql支持InnoDB引擎。

1、进入源码目录

cd /root/lnmp0.8/mysql-5.1.60

make clean

2、运行命令

./configure –prefix=/usr/local/mysql –enable-assembler –with-charset=utf8 –with-extra-charsets=complex –enable-thread-safe-client –with-big-tables –with-readline –with-ssl –with-embedded-server –enable-local-infile –with-pic –with-fast-mutexes –with-client-ldflags=-static –with-mysqld-ldflags=-static –with-plugins=all

3、make && make install

Categories: LNMP | LAMP Tags: ,

LNMP0.8 eAccelerator安装不上的解决办法

May 19th, 2012 No comments

安装eAccelerator,执行如下命令:./eaccelerator.sh ,按提示选择版本,回车确认后,就会自动安装并重启web服务。
vi /usr/local/php/etc/php.ini ,eaccelerator路径是no-debug-non-zts-20060613 而不是no-debug-non-zts-20090626,参照下图更改即可:

 

Categories: LNMP | LAMP Tags: ,

LNMP0.8 ionCube安装不上的解决办法

May 19th, 2012 No comments

安装ionCube,执行如下命令:./ionCube.sh 回车确认后,就会自动安装并重启web服务。

php 5.2.17 使用ioncube_loader_lin_5.2.so不是5.3,参照下图修改即可。

Categories: LNMP | LAMP Tags: ,

lnmp安装的时候默认绑定的域名怎么修改

May 19th, 2012 No comments

修改/usr/local/nginx/conf/nginx.conf 即可。
比如上图,把blog.gcpmeida.ca这个安装lnmp时候默认的域名改成你要的域名即可。

Categories: LNMP | LAMP Tags: ,

LNMP中域名301重定向的方法

May 19th, 2012 No comments

处于SEO考虑,经常要301重定向,比如把没有www的定向到www的域名。在LNMP中进行301重定向其实也很简单。下面演示一下将域名yiqingfeng.net重定向到www.yiqingfeng.net的方法:打开/usr/local/nginx/conf/vhost目录下相应的.conf文件,比如我的是/usr/local/nginx/conf/vhost/www.yiqingfeng.net.conf,修改成如下图即可,把红色的去掉,添加上绿色的一段代码。然后重启nginx:/etc/init.d/nginx restart,301重定向即可生效。

server
{
listen       80;
server_name www.yiqingfeng.net yiqingfeng.net;
index index.html index.htm index.php default.html default.htm default.php;
root  /home/wwwroot/www.yiqingfeng.net;
include wordpress.conf;
location ~ .*\.(php|php5)?$
{
fastcgi_pass  unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires      30d;
}
location ~ .*\.(js|css)?$
{
expires      12h;
}
access_log off;
}
server{
server_name yiqingfeng.net;
rewrite ^(.*) 
http://www.yiqingfeng.net$1 permanent;
}

Categories: LNMP | LAMP Tags: ,

gallery3 nginx 完美安装+完美伪静态

May 19th, 2012 No comments

伪静态规则:

假设安装于相对根目录为/gallery3子目录(访问地址为http://域名/gallery3),则静态化链接如下:

  1. location /gallery3 {
  2.   if (-f $request_filename) {
  3.     expires max;
  4.     break;
  5.   }
  6.   if (!-e $request_filename) {
  7.     rewrite ^/gallery3/index.php/(.+)$ /gallery3/index.php?kohana_uri=$1 last;
  8.   }
  9. }

如果需要为图库设置一个专门的域名,那么就相当于根目录,上述地址还需要修改一下,主要是删掉“gallery3”字样:

  1. location / {
  2.   if (-f $request_filename) {
  3.     expires max;
  4.     break;
  5.   }
  6.   if (!-e $request_filename) {
  7.     rewrite ^/index.php/(.+)$ /index.php?kohana_uri=$1 last;
  8.   }
  9. }

优化:

Gallery3每一个链接,都会带“index.php“,这对搜索SEO有一定的影响,我们还可以进一步修改伪静态规则,达到去掉index.php的目的:

1、进一步修改伪静态化规则:

将上述规则中的(以安装根目录为例):

  1.     rewrite ^/index.php/(.+)$ /index.php?kohana_uri=$1 last;

修改成:

  1. rewrite ^/(.+)$ /index.php?kohana_uri=$1 last;

即去掉了第一个“/index.php”。

2、修改application/config/config.php文件

找到  $config[“index_page”] 字段,将其修改成:

  1. $config[“index_page”] = “”;

经过上述修改以后,再重启一下nginx,规则就生效了。链接地址将会变得非常简短。演示:http://g3.yiqingfeng.net

转自http://2920.blog.sohu.com/151352987.html

Categories: LNMP | LAMP Tags: , , ,