centos libfreetype,centos官网

本篇文章给大家谈谈centos libfreetype,以及centos官网对应的知识点,文章可能有点长,但是希望大家可以阅读完,增长自己的知识,最重要的是希望对各位有所帮助,可以解决了您的问题,不要忘了收藏本站喔。

CentOS 6.2系统安装和基本软件环境配置

一、安装CentOS6.2系统

1、选择Desktop进行安装

注:如果修改了主机名,则需要在/etc/hosts文件中增加设置的主机名

2、ssh安全设置(配置文件:/etc/ssh/sshd_config):

1)更改默认22端口:去掉 Port的注释,改成如:22123

2)禁止root账号登录:去掉PermitRootLogin yes注释,改成:PermitRootLogin no

3)新增SSH登录用户,登录成功后再su到root:

复制代码

   

代码如下:

# useradd xiaoma

   # passwd xiaoma

然后修改ssh配置文件,最后加入:AllowUsers xiaoma

4)重启SSH服务:service sshd restart

5)更改防火墙配置,允许22123端口,加入:-A INPUT-m state–state NEW-m tcp-p tcp–dport 22123-j ACCEPT,并重启防火墙生效:service iptables restart

二、软件环境配置

1、安装编译环境:

复制代码

   

代码如下:

# yum install gcc gcc-c++

注:代理上网,命令行:export http_proxy=

2、安装一些必备的库

复制代码

   

代码如下:

# yum install ncurses-devel zlib-devel libjpeg* libpng* freetype*

注:ncurses-devel–编译安装mysql5.5时需要

zlib-devel–编译安装httpd需要

libjpeg*、libpng*、freetype*–编译安装php需要

3、安装clamAV杀毒软件

复制代码

   

代码如下:

# tar xzf clamav-0.97.4.tar.gz

   # cd clamav-0.97.4

   #./configure--prefix=/usr/local/clamav--disable-clamav

   # make

   # make install

# groupadd clamav

   # useradd-g clamav clamav

   # chown-R clamav.clamav/usr/local/clamav

操作示例:

1)更新病毒库:bin/freshclam(需要修改etc/freshclam.conf文件把Example行注释掉)

2)扫描指定的目录:bin/clamscan–bell-i-r/usr/local

4、安装JDK

复制代码

   

代码如下:

# chmod+x jdk-6u33-linux-i586.bin

   #./jdk-6u33-linux-i586.bin

   # mv jdk1.6.0_33//usr/local

设置JDK环境变量,/etc/profile文件中最后加入如下配置:

复制代码

   

代码如下:

JAVA_HOME=/usr/local/jdk1.6.0_33

   export JAVA_HOME

   export PATH=/usr/local/mysql5/bin:$JAVA_HOME/bin:$PATH

然后更新环境变量使之生效:

复制代码

   

代码如下:

# source/etc/profile

查看安装的java版本:

复制代码

   

代码如下:

# java-version

5、安装Mysql5.5(mysql5.5需要cmake编译,需要先安装cmake)

复制代码

   

代码如下:

# tar xzf cmake-2.8.7.tar.gz

   # cd cmake-2.8.7

   #./configure

   # make make install

# mkdir-p/usr/local/mysql5

   # groupadd mysql

   # useradd-g mysql mysql

   # chown mysql.mysql-R/usr/local/mysql5

# tar xzf mysql-5.5.19.tar.gz

   # cd mysql-5.5.19/

   # cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql5-DMYSQL_UNIX_ADDR=/usr/local/mysql5/mysql.sock-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DWITH_EXTRA_CHARSETS=all-DWITH_MYISAM_STORAGE_ENGINE=1-DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_MEMORY_STORAGE_ENGINE=1-DWITH_READLINE=1-DENABLED_LOCAL_INFILE=1-DMYSQL_DATADIR=/usr/local/mysql5/data-DMYSQL_USER=mysql-DMYSQL_TCP_PORT=3306

   # make

   # make install

配置Mysql,进行如下操作:

复制代码

   

代码如下:

# cp support-files/my-medium.cnf/etc/my.cnf

   # chmod 755 scripts/mysql_install_db

   # scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql5--datadir=/usr/local/mysql5/data

# cp support-files/mysql.server/etc/init.d/mysql

   # chmod 755/etc/init.d/mysql

   # chkconfig mysql on

启动mysql并设置root账号密码:

复制代码

   

代码如下:

#/etc/init.d/mysql start或 service mysql start

   #/usr/local/mysql5/bin/mysqladmin-uroot password'root'

加入环境变量,在/etc/profile文件中最后加入:

复制代码

   

代码如下:

export PATH=/usr/local/mysql5/bin:$PATH

修改默认的mysql最大连接数(默认只有151),打开/etc/my.cnf文件,在[mysqld]的下面加入:max_connections=1000,然后重启mysql即可生效,查看最大连接数:

复制代码

   

代码如下:

mysqlshow VARIABLES LIKE'%conn%';

6、安装httpd

复制代码

   

代码如下:

# tar xzf httpd-2.2.21.tar.gz

   # cd httpd-2.2.21/

   # cd srclib/apr

   #./configure--prefix=/usr/local/apr

   # make

   # make install

# cd../apr-util

   #./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr

   # make

   # make install

# cd../..

   #./configure--prefix=/usr/local/apache2--enable-so--enable-mods-shared=all--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util--enable-dav--enable-proxy--enable-proxy-ajp

   # make

   # make install

启动httpd并访问进行测试(注意iptables需要打开80端口):

复制代码

   

代码如下:

#/usr/local/apache2/bin/apachectl start

如果需要禁止对某个目录的访问,可以在该目录下新建.htaccess文件,并输入如下内容:

复制代码

   

代码如下:

order allow,deny

   deny from all

7、安装php

复制代码

   

代码如下:

# tar xzf libxml2-2.7.5.tar.gz

   # cd libxml2-2.7.5

   #./configure--prefix=/usr/local/libxml2

   # make

   # make install

# cd..

   # rpm-qa php

   # rpm-e--nodeps--allmatches php-5.1.6-27.el5

   # tar xzf php-5.3.1.tar.gz

   # cd php-5.3.1

   #./configure--prefix=/usr/local/php5--with-libxml-dir=/usr/local/libxml2/--with-mysql=/usr/local/mysql5/--with-apxs2=/usr/local/apache2/bin/apxs--with-mbstring--enable-mbstring=all--with-gd

   # make

   # make install

   # cp php.ini-production/usr/local/php5/lib/php.ini

修改httpd.conf文件:

1)在AddType application/x-gzip.gz.tgz之后加一行:AddType application/x-httpd-php .php

2)在DirectoryIndex index.html后加入index.php

重启httpd后即可使php生效!

8、安装Tomcat7

复制代码

   

代码如下:

# unzip-q apache-tomcat-7.0.23.zip

   # mv apache-tomcat-7.0.23 tomcat-7

配置tomcat的虚拟主机,打开conf/server.xml配置文件,加入如下段(多个则加入多个如下段即可):

复制代码

   

代码如下:

Host name="www." appBase="webapps"

   unpackWARs="true" autoDeploy="true"

   Aliaschinapis.com/Alias

   Context path="" docBase="/webapps/www."/

   /Host

配置完tomcat后,还需要配置apache的虚拟主机文件(conf/extra/httpd-vhosts.conf):

复制代码

   

代码如下:

VirtualHost*:80

   DocumentRoot"/kington/webapps/chinapis"

   ServerName www.

   ServerAlias

ErrorLog"|/usr/local/apache2/bin/rotatelogs/usr/local/apache2/logs/_%Y-%m-%d_error_log 86400 480"

   CustomLog"|/usr/local/apache2/bin/rotatelogs/usr/local/apache2/logs/_%Y-%m-%d_access_log 86400 480" common

ProxyPass/images/!

   ProxyPass/styles/!

ProxyPreserveHost On

   ProxyPass/ ajp://localhost:8009/

   ProxyPassReverse/ ajp://localhost:8009/

   /VirtualHost

上述配置中的说明如下:

1)ErrorLog和CustomLog配置了日志文件的轮询时间(86400表示秒是一天,480是时区的偏移)

三、常见问题

1、编译安装php时遇到:configure: error: libpng.(a|so) not found,首先安装各个依赖组件(libjpeg、libpng、freetype),然后做如下处理:

复制代码

   

代码如下:

# ln-s/usr/lib64/libjpeg.so/usr/lib/

   # ln-s/usr/lib64/libpng.so/usr/lib/

2、解压bin格式的jdk时候报错:/lib/ld-linux.so.2: bad ELF interpreter,需要安装一些缺少的文件:

复制代码

   

代码如下:

# yum install ld-linux.so.2

centos5 源码安装Nginx + mysql + apache + php的方法

主要依照的是张宴的一篇博文《》,安装的软件是也是从他提供的列表中下载,这里都是tar.gz格式,如果更希望是rpm格式的话,提供一个网址《》这里列出了比较完全的下载包。

我安装的系统:Centos5

1、下载;

我安装的下载来自张宴博文下的地址,下载保存的是home下自己目录的一个文件夹下:

复制代码

   

代码如下:

cd/home/xuxx/software

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

   wget

2、准备编译安装环境,需要编译源码用到gc++

建议如果是新安装的系统,使用yum upgrade更新下系统。

复制代码

   

代码如下:

sudo-s

   LANG=C

   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

注意:这里所有的命令是一行的而不能有换行符,如果是copy的时候,注意要去处该换行符

确保安装成功!才能正确使用编译。

3、安装:

一、安装PHP 5.2.8(FastCGI模式)

1、编译安装PHP 5.2.8所需的支持库:

1] libiconv库

复制代码

   

代码如下:

tar zxvf libiconv-1.13.tar.gz

   cd libiconv-1.13/

   ./configure--prefix=/usr/local

   make

   make install

   make clean

   make distclean

   cd../

make clean和make distclean都是删除安装过程中生成的缓存文件。当然如果你不介意放着也可以跳过这两步清理操作。

2]libmcrypt库

复制代码

   

代码如下:

tar zxvf libmcrypt-2.5.8.tar.gz

   cd libmcrypt-2.5.8/

   ./configure

   make

   make install

   make clean

   make distclean

   /sbin/ldconfig

   cd libltdl/

   ./configure--enable-ltdl-install

   make

   make install

   make clean

   make distclean

   cd

3] mhash库

复制代码

   

代码如下:

tar zxvf mhash-0.9.9.9.tar.gz

   cd mhash-0.9.9.9/

   ./configure

   make

   make install

   cd../

4]mcrypt库

注意:因为该库和libmcrypt有依赖性,所以在安装前必须知道libmcrypt,否则的话会出现:

错误

复制代码

   

代码如下:

checking for libmcrypt– version= 2.5.0…

   ***‘libmcrypt-config–version’ returned 2.4.0, but LIBMCRYPT(2.5.8)

   *** was found! If libmcrypt-config was correct, then it is best

   *** to remove the old version of LIBMCRYPT. You may also be able to fix the error

   *** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing

   ***/etc/ld.so.conf. Make sure you have run ldconfig if that is

   *** required on your system.

   *** If libmcrypt-config was wrong, set the environment variable LIBMCRYPT_CONFIG

   *** to point to the correct copy of libmcrypt-config, and remove the file config.cache

   *** before re-running configure

   configure: error:*** libmcrypt was not found

是因为path的问题,所以执行:

复制代码

   

代码如下:

ln-s/usr/local/lib/libmcrypt.la/usr/lib/libmcrypt.la

   ln-s/usr/local/lib/libmcrypt.so/usr/lib/libmcrypt.so

   ln-s/usr/local/lib/libmcrypt.so.4/usr/lib/libmcrypt.so.4

   ln-s/usr/local/lib/libmcrypt.so.4.4.8/usr/lib/libmcrypt.so.4.4.8

   ln-s/usr/local/lib/libmhash.a/usr/lib/libmhash.a

   ln-s/usr/local/lib/libmhash.la/usr/lib/libmhash.la

   ln-s/usr/local/lib/libmhash.so/usr/lib/libmhash.so

   ln-s/usr/local/lib/libmhash.so.2/usr/lib/libmhash.so.2

   ln-s/usr/local/lib/libmhash.so.2.0.1/usr/lib/libmhash.so.2.0.1

   ln-s/usr/local/bin/libmcrypt-config/usr/bin/libmcrypt-config

然后再安装:

复制代码

   

代码如下:

tar zxvf mcrypt-2.6.8.tar.gz

   cd mcrypt-2.6.8/

   /sbin/ldconfig

   ./configure

   make

   make install

   cd../

二、安装mysql

复制代码

   

代码如下:

/usr/sbin/groupadd mysql

   /usr/sbin/useradd-g mysql xxx

   unzip mysql-5.1.33.zip

   cd mysql-5.1.33/

   ./configure--prefix=/usr/local/webserver/mysql/--enable-assembler--with-extra-charsets=complex--enable-thread-safe-client--with-big-tables

   --with-readline--with-ssl--with-embedded-server--enable-local-infile--with-plugins=innobase

   make

   make install

   make clean

   make distclean

   chmod+w/usr/local/webserver/mysql

   chown-R xxx:mysql/usr/local/webserver/mysql

   cp support-files/my-medium.cnf.sh/usr/local/webserver/mysql/my.cnf

   cd../

注意:这里编译./configure命令是一行的而不能有换行符,如果是copy的时候,注意要去处该换行符

在最后一步拷贝的时候,我安装完在support-files下没有my-medium.cnf而只有my-medium.cnf.sh所以将这个文件拷贝过去。

@张宴原文:

附:以下为附加步骤,如果你想在这台服务器上运行MySQL数据库,则执行以下两步。如果你只是希望让PHP支持MySQL扩展库,能够连接其他服务器上的MySQL数据库,那么,以下两步无需执行。

①、以xxx用户帐号的身份建立数据表:

复制代码

   

代码如下:

/usr/local/webserver/mysql/bin/mysql_install_db--basedir=/usr/local/webserver/mysql--datadir=/usr/local/webserver/mysql/data--user=xxx

②、启动MySQL(最后的表示在后台运行)

复制代码

   

代码如下:

/bin/sh/usr/local/webserver/mysql/bin/mysqld_safe--defaults-file=/usr/local/webserver/mysql/my.cnf

3、编译安装PHP(FastCGI模式)

复制代码

   

代码如下:

tar zxvf php-5.2.8.tar.gz

   gzip-cd php-5.2.8-fpm-0.5.10.diff.gz| patch-d php-5.2.8-p1

   cd php-5.2.8/

   ./configure--prefix=/usr/local/webserver/php--with-config-file-path=/usr/local/webserver/php/etc--with-mysql=/usr/local/webserver/mysql

   --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config--with-iconv-dir=/usr/local--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib

   --with-libxml-dir=/usr--enable-xml--disable-rpath--enable-discard-path--enable-safe-mode--enable-bcmath--enable-shmop--enable-sysvsem

   --enable-inline-optimization--with-curl--with-curlwrappers--enable-mbregex--enable-fastcgi--enable-fpm--enable-force-cgi-redirect

   --enable-mbstring--with-mcrypt--with-gd--enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl--enable-sockets--with-ldap

   --with-ldap-sasl

   make ZEND_EXTRA_LIBS='-liconv'

   make install

   cp php.ini-dist/usr/local/webserver/php/etc/php.ini

   cd../

注意:这里./configure命令是一行的而不能有换行符,如果是copy的时候,注意要去处该换行符

4、编译安装PHP5扩展模块--可选安装

复制代码

   

代码如下:

tar zxvf memcache-2.2.5.tgz

   cd memcache-2.2.5/

   /usr/local/webserver/php/bin/phpize

   ./configure--with-php-config=/usr/local/webserver/php/bin/php-config

   make

   make install

   make clean

   make distclean

   cd../

   tar jxvf eaccelerator-0.9.5.3.tar.bz2

   cd eaccelerator-0.9.5.3/

   /usr/local/webserver/php/bin/phpize

   ./configure--enable-eaccelerator=shared--with-php-config=/usr/local/webserver/php/bin/php-config

   make

   make install

   make clean

   make distclean

   cd../

   tar zxvf PDO_MYSQL-1.0.2.tgz

   cd PDO_MYSQL-1.0.2/

   /usr/local/webserver/php/bin/phpize

   ./configure--with-php-config=/usr/local/webserver/php/bin/php-config--with-pdo-mysql=/usr/local/webserver/mysql

   make

   make install

   make clean

   make distclean

   cd../

   tar zxvf ImageMagick.tar.gz

   cd ImageMagick-6.5.1-2/

   ./configure

   make

   make install

   make clean

   make distclean

   cd../

   tar zxvf imagick-2.2.2.tgz

   cd imagick-2.2.2/

   /usr/local/webserver/php/bin/phpize

   ./configure--with-php-config=/usr/local/webserver/php/bin/php-config

   make

   make install

   make clean

   make distclean

   cd../

5、修改php.ini文件

STRONG手工修改:/STRONG查找/usr/local/webserver/php/etc/php.ini中的extension_dir="./"

修改为extension_dir="/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/"

并在此行后增加以下几行,然后保存:

extension="memcache.so"

extension="pdo_mysql.so"

extension="imagick.so"

再查找output_buffering= Off

修改为output_buffering= On

6、配置eAccelerator加速PHP:

mkdir-p/usr/local/webserver/eaccelerator_cache

vi/usr/local/webserver/php/etc/php.ini

按shift+g键跳到配置文件的最末尾,加上以下配置信息:

复制代码

   

代码如下:

[eaccelerator]

   zend_extension="/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"

   eaccelerator.shm_size="128"

   eaccelerator.cache_dir="/usr/local/webserver/eaccelerator_cache"

   eaccelerator.enable="1"

   eaccelerator.optimizer="1"

   eaccelerator.check_mtime="1"

   eaccelerator.debug="0"

   eaccelerator.filter=""

   eaccelerator.shm_max="0"

   eaccelerator.shm_ttl="300"

   eaccelerator.shm_prune_period="120"

   eaccelerator.shm_only="0"

   eaccelerator.compress="1"

   eaccelerator.compress_level="9"

修改配置文件:

vi/etc/sysctl.conf

kernel.shmmax= 134217728

然后执行以下命令使配置生效:/sbin/sysctl-p

以下的步骤和张宴步骤中一样配置,不再赘诉

debian8怎么安装php7

debian8编译安装 php7

目录(?)[-]

Please reinstall the libcurl distributionCannot find OpenSSL

configure error Unable to locate gmph

Can not find recodeh anywhere under usr usrlocal usr optCannot find pspell

Please reinstall the mysql distribution

mcrypth not found Please reinstall libmcryptxml2-config not found

安装编译器

apt-get install build-essential autoconf automake libtool bison re2c获取PHP安装包

wget 安装dev包

apt-get install libxml2-dev libssl-dev libbz2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libgmp-dev libgmp3-dev libmcrypt-dev libmysqlclient15-dev libpspell-dev librecode-dev进行编译安装

./buildconf//用来生成configure脚本

./configure\

--prefix=/usr\

--with-config-file-path=/etc\

--enable-mbstring\

--enable-zip\

--enable-bcmath\

--enable-pcntl\

--enable-ftp\

--enable-exif\

--enable-calendar\

--enable-sysvmsg\

--enable-sysvsem\

--enable-sysvshm\

--enable-wddx\

--with-curl\

--with-mcrypt\

--with-iconv\

--with-gmp\

--with-pspell\

--with-gd\

--with-jpeg-dir=/usr\

--with-png-dir=/usr\

--with-zlib-dir=/usr\

--with-xpm-dir=/usr\

--with-freetype-dir=/usr\

--with-t1lib=/usr\

--enable-gd-native-ttf\

--enable-gd-jis-conv\

--with-openssl\

--with-pdo-mysql=/usr\

--with-gettext=/usr\

--with-zlib=/usr\

--with-bz2=/usr\

--with-recode=/usr\

--with-mysqli=/usr/bin/mysql_config

备注:错误1:Cannot find OpenSSL's libraries解决:

确认已安装过 openssl、libssl-dev包,还是会提示该错误;解决办法:

root@test2:~/php-5.3.27# find/-name libssl.so输出结果为:/usr/lib/x86_64-Linux-gnu/libssl.so初步判断它可能只会在/usr/lib/下寻找 libssl.so文件,于是:

ln-s/usr/lib/x86_64-linux-gnu/libssl.so/usr/lib错误2:debian Please reinstall the libcurl distribution解决:

# RetHat CentOS or Fedora使用下面安装命令yum install curl curl-devel

# Debian or Ubuntu使用下面的安装命令

apt-get install curl

apt-get install libcurl4-gnutls-dev

错误3:Unable to locate gmp.h解决:

在下载 gmp源码包,接着./configure&& make&& make install编译安装

make&&make install

报错处理

Please reinstall the libcurl distributionaptitude search libcurl4

aptitude install libcurl4-gnutls-dev

Cannot find OpenSSL’

wget openssl-1.0.2j.tar.gz

cd openssl-1.0.2j

./config

make&& make install

configure: error: Unable to locate gmp.h

sudo apt-get install libgmp-dev libgmp3-devln-s/usr/include/x86_64-linux-gnu/gmp.h/usr/include/gmp.hCan not find recode.h anywhere under/usr/usr/local/usr/opt.

apt-get install librecode-dev

Cannot find pspell

apt-get install libpspell-dev

Please reinstall the mysql distribution

apt-get install libmysqlclient15-dev

mcrypt.h not found. Please reinstall libmcrypt.

apt-get install libmcrypt-dev

xml2-config not found

apt-get install libxml2-dev

阅读剩余
THE END