标签:
大纲
1.安装gcc编译器
|
1
2
3
4
5
6
7
8
9
10
|
Mount /dev/cdrom /mediavi /etc/yum.repos.d/CentOS-Media.repo[c5-media]name=CentOS-$releasever - Mediabaseurl=file:///media//修改为光盘挂载点enabled=1//改为1意为启用gpgcheck=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 |
|
1
2
3
4
|
Vi /etc/bashrcalias yum="yum --disablerepo=\* --enablerepo=c5-media"3)依次安装gcc、gcc-c++Yum -y install gcc* |
|
1
2
3
4
5
6
7
|
下载前需关闭启动的服务,如httpd、mysqldservice httpd stopservice mysqld stop卸载RPM包的Apache、MySQL、PHPyum remove httpdyum remove mysql建议使用rpm –e http-1.2.3.rpm --nodeps (截断这个rpm包的依赖性) |
|
1
2
3
|
1)关闭SELinuxvi /etc/selinux/configSELINUX=disabled |
|
1
2
|
iptables -F * 如果没有禁用防火墙,默认80端口禁止访问service iptables save 防火墙策略写到/etc/sysconfig/iptables,以后计算机重启再加载这个文件时,防火墙策略就会永久清空. |
|
1
2
3
4
|
cd /lamp/libxml2-2.6.30./configure --prefix=/usr/local/libxml2/makemake install |
|
1
2
3
4
|
cd /lamp/libmcrypt-2.5.8./configure --prefix=/usr/local/libmcrypt/makemake install |
|
1
2
3
4
|
cd /lamp/libmcrypt-2.5.8/libltdl./configure --enable-ltdl-installmakemake install |
|
1
2
3
4
|
cd /lamp/zlib-1.2.3./configuremakemake install |
|
1
2
3
4
|
cd /lamp/libpng-1.2.31./configure --prefix=/usr/local/libpng/makemake install |
|
1
2
3
4
5
6
7
8
9
10
|
mkdir /usr/local/jpeg6mkdir /usr/local/jpeg6/binmkdir /usr/local/jpeg6/libmkdir /usr/local/jpeg6/includemkdir -p /usr/local/jpeg6/man/man1cd /lamp/jpeg-6b./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-staticmakemake install--enable-shared与--enable-static 参数分别为建立共享库和静态库使用的libtool |
|
1
2
3
4
|
cd /lamp/freetype-2.3.5./configure --prefix=/usr/local/freetype/makemake install |
|
1
2
3
4
|
cd /lamp/autoconf-2.61./configuremakemake install |
|
1
2
3
4
5
6
7
8
9
10
11
12
|
mkdir /usr/local/gd2cd /lamp/gd-2.0.35#png错误,修改方法:vi gd_png.c把#include “png.h”替换#include "/usr/local/libpng/include/png.h"./configure --prefix=/usr/local/gd2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype/--with-png=/usr/local/libpng/Make#如果出现错误,把上面的两步重新执行一次.make install若前面配置zlib时没有指定安装目录,gd配置时不要添加--with-zlib=/usr/local/zlib/参数 |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
cd /lamp/httpd-2.2.9./configure --prefix=/usr/local/apache2/ --sysconfdir=/usr/local/apache2/etc/ --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=sharedmakemake install启动Apache测试:/usr/local/apache2/bin/apachectl restart查看进程:ps -le | grep httpd查看apache模块:/usr/local/apache2/bin/apachectl –h#share 动态模块或动态库文件Php5 rewrite#static 静态模块或表态库文件Server-statusUserdirVirtual host测试:http://localhost/index.html“it works”设置Apache随机启动Vi /etc/rc.local/usr/local/apache2/bin/apachectl restart |
|
1
2
3
4
5
6
7
|
1.yum –y install ncurses*2.源代码编译:cd /lamp/ncurses-5.6./configure --with-shared --without-debug --without-ada --enable-overwritemakemake install若不安装ncurses编译MySQL时会报错 |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
useradd mysql添加用户组mysql ,将mysql用户默认组设置为mysql用户组cd /lamp/mysql-5.0.41./configure --prefix=/usr/local/mysql --without-debug --enable-thread-safe-client --with-pthread --enable-assembler --enable-profiling --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-extra-charsets=all --with-plugins=all --with-mysqld-user=mysql --without-embedded-server --with-server-suffix=-community --with-unix-socket-path=/tmp/mysql.sockmakemake install--with-extra-charsets=all参数为安装所有字符集#如果不行的话,make clean 后再make ;make install,这样去试一下,默认是不支持innodb存储引擎的.其中--with-plugins=all可以把innodb加载进来.1.cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf修改mysql配置文件1.[client]default-character-set=utf8#客户端字符集#连接字符集2.[ mysqld]character-set-server = utf8#服务器字符集#数据库字符集collation-server = utf8_general_ci#服务器,库,表的校验字符集#default-storage-engine=innodb#把默认的表引擎改为innodb生成MySQL配置文件Setfacl –m u:mysql:rwx –R /usr/local/mysqlSetfacl –m d:u:mysql:rwx –R /usr/local/mysql用acl来让mysql用户对/usr/local/mysql有所有权限/usr/local/mysql/bin/mysql_install_db --user=mysql创建数据库授权表启动MySQL服务1.用原本源代码的方式去使用和启动mysql/usr/local/mysql/bin/mysqld_safe --user=mysql &2.重启以后还要生效:Vi /etc/rc.local/usr/local/mysql/bin/mysqld_safe --user=mysql &4./usr/local/mysql/bin/mysqladmin -uroot password kkk#给mysql用户root加密码.密码为kkk/usr/local/mysql/bin/mysql -u root -pkkk testmysql>show databases;mysql>use testmysql>show tables;#进入mysql以后用set来改密码.mysql> exit登录MySQL客户端控制台设置指定root密码 |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
编译前确保系统已经安装了libtool和libtool-ltdl软件包,若没有安装使用yum或rpm安装下:yum install libtool*yum install libtool-ltdl*cd /lamp/php-5.2.6./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng/ --with-freetype-dir=/usr/local/freetype/ --with-gd=/usr/local/gd2/ --with-mcrypt=/usr/local/libmcrypt/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets若前面配置zlib时没有指定安装目录,PHP配置时不要添加--with-zlib-dir=/usr/local/zlib/参数makemake install生成php.ini(php的配置文件)cp /lamp/php-5.2.6/php.ini-dist /usr/local/php/etc/php.ini测试apache与php的连通性,看apache是否能解析php文件让apache支持php代码 :vi /usr/local/apache2/etc/httpd.confAddType application/x-httpd-php .php .phps重启Apache服务:/usr/local/apache2/bin/apachectl restart测试:vi /usr/local/apache2/htdocs/test.php<?phpphpinfo();?>通过浏览器测试:http://localhost/test.php |
|
1
2
3
4
5
|
tar zxvf memcache-2.2.5.tgzcd memcache-2.2.5/usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-configmake && make install |
|
1
2
3
4
5
6
7
8
9
10
11
|
tar zxvf /lamp/PDO_MYSQL-1.0.2.tgzcd /lamp/PDO_MYSQL-1.0.2//usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysqlmake && make install修改php.iniextension_dir = "/usr/local/php//lib/php/extensions/no-debug-non-zts-20060613/"extension="memcache.so";extension="pdo_mysql.so";修改php文件生效:/usr/local/apache2/bin/apachectl restart |
|
1
2
|
cd /lamp/ZendOptimizer-3.2.6-linux-glibc21-i386./install.sh |
10、安装memcache服务器软件
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
http://memcached.googlecode.com/files/memcached-1.4.10.tar.gz首先安装依赖包libeventyum –y install libevent*#主包已经安装,别忘记安装libevent-devel*,不然./configure过不去Tar xzf /lamp/memcached-1.4.10.tar.gzCd /lamp/memcached-1.4.10./configure --prefix=/usr/local/memcacheMake && make installUseradd memcache#因为系统不能用root运行memcache软件/usr/local/memcache/bin/memcached -umemcache & #后台运行Netstat –tunpl|grep :11211telnet 192.168.10.1 11211stats写入自启动:Vi /etc/rc.local/usr/local/memcache/bin/memcached -umemcache &#如何杀掉后台进程,用kill %1,查看进程用jobs |
标签:
原文地址:http://www.cnblogs.com/x113/p/4332327.html