centos是一个很好的linux版本的操作系统,很多服务器都选用此版本,我的桌面选用的是ubunt,但是感觉服务器上面centos比ubunt方便。
在编译安装之前,必须保证像gcc,make这样的包已经安装好了,如果没有安装好,用如下方法安装
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
这里面有几个是在编译安装时要用的,如gcc gcc-c++ autoconf。
还有几个是别的对此有依赖的,如php要处理图像就得有libjpeg。安装mysql就得有ncurese-devel等。
安装httpd服务器apache
(1)解压 :tar zxvf httpd-2.2.17.tar.gz
安装mysql
安装php
<FilesMatch /.php$> SetHandler application/x-httpd-php </FilesMatch>
(7)重启 bin/apachectl restart
可以会出现如下错误
ttpd: Syntax error on line 53 of /usr/local/lamp/apache/conf/httpd.conf:
Cannot load /usr/local/apache/modules/libphp5.so into server:
/usr/local/lamp/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
用如下方法可以解决
(1)chcon -t texrel_shlib_t /usr/local/lamp/apache/modules/libphp5.so
重启apache服务器,lamp环境已经建立好了