最新消息: 新版网站上线了!!!

centos mysql + apache+nginx+php的配置记录

setup:

yum install setuptool ntsysv system-config-network system-config-keyboard ntp crontabs wget vim-enhanced

wget:

yum install wget

scp:

yum install openssh-clients

ntpdate:

yum install ntpdate
gcc:

yum install gcc
make:

yum -y install gcc automake autoconf libtool make
pcre:

yum install pcre pcre-devel
apache:

./configure --prefix=/server/apache --with-apr --with-apr-util --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache --with-mpm=worker --disable-ipv6 --enable-nonportable-atomics --enable-threads --enable-other-child --enable-ssl --enable-so --enable-maintainer-mode --enable-ssl --enable-http --enable-info --enable-deflate --enable-proxy --enable-rewrite --with-included-apr --enable-proxy --enable-proxy-http --enable-proxy-connect --enable-headers
error: mod_deflate has been requested but can not be built due to prerequisite failures
yum install zlib zlib-devel

error: mod_ssl has been requested but can not be built due to prerequisite failures
yum install openssl openssl-devel
nginx:

./configure --prefix=/server/nginx --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module --with-pcre
mysql:
apache-php:

./configure --enable-shared --prefix=/server/apache/php --with-openssl --with-curl --with-curlwrappers --with-mcrypt=/server/libmcrypt --with-mhash --enable-bcmath --enable-sockets --enable-mbstring --enable-soap --with-iconv --with-zlib --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --with-gettext --with-mysql=/server/mysql --enable-shmop --enable-sysvsem --enable-sysvshm --enable-sysvmsg --with-apxs2=/server/apache/bin/apxs --enable-mbregex --enable-inline-optimization --disable-rpath --with-libxml-dir --enable-xml --with-mysqli=/server/mysql/bin/mysql_config --with-pdo-mysql=mysqlnd --enable-dba --disable-phar --with-mysqli
Sorry, I cannot run apxs. Possible reasons follow:

1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
The output of /usr/local/apache/bin/apxs follows:./configure: /usr/local/apache/bin/apxs: not found
configure: error: Aborting

yum -y install perl perl-devel
#vi /usr/local/apache/bin/apxs
第一行的#!/replace/with/path/to/perl/interpreter -w,找到你perl的安装位置,如果不清楚,可以用which perl找到,一般在/usr/bin/perl ,于是将第一行改为:#!/usr/bin/perl -w. 再运行php的configure, 一切正常!
configure: error: xml2-config not found. Please check your libxml2 installation.

yum install libxml2 libxml2-devel
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
yum -y install curl curl-devel
configure: error: jpeglib.h not found.
yum -y install libjpeg libjpeg-devel
configure: error: png.h not found.
You have new mail in /var/spool/mail/root
yum -y install libpng libpng-devel
configure: error: freetype.h not found.
yum -y install freetype freetype-devel
error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
make[1]: *** [install-pear-installer] Error 127
make: *** [install-pear] Error 2

ln -s /server/mysql/lib/libmysqlclient.so.18 /usr/lib64/
nginx-php:

./configure --enable-shared --prefix=/server/nginx/php --with-openssl --with-curl --with-curlwrappers --with-mcrypt=/server/libmcrypt --with-mhash --enable-bcmath --enable-sockets --enable-mbstring --enable-soap --with-iconv --with-zlib --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --with-gettext --with-mysql=/server/mysql --enable-shmop --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-fpm --enable-mbregex --enable-inline-optimization --disable-rpath --with-libxml-dir --enable-xml --with-xsl --with-mysqli=/server/mysql/bin/mysql_config --with-pdo-mysql=mysqlnd --enable-dba --disable-phar
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
yum -y install libxslt libxslt-devel
mrtg:

yum install gd gd-devel
yum -y install net-snmp
./configure --prefix=/server/mrtg --with-gd --with-z --with-png

cd /server/mrtg/
mkdir cfg
bin/cfgmaker --global 'WorkDir: /www/mrtg' --global 'Options[_]: bits,growright' --output /server/mrtg/cfg/mrtg.cfg public@localhost
mkdir /www/mrtg
bin/indexmaker --output=/www/mrtg/index.html /server/mrtg/cfg/mrtg.cfg

env LANG=C /server/mrtg/bin/mrtg /server/mrtg/cfg/mrtg.cfg

转载请注明:谷谷点程序 » centos mysql + apache+nginx+php的配置记录