centos 安装 nss?centos哪个版本建站好
大家好,今天给各位分享centos 安装 nss的一些知识,其中也会对centos哪个版本建站好进行解释,文章篇幅可能偏长,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在就马上开始吧!
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
以下的步骤和张宴步骤中一样配置,不再赘诉
centos6.5安装wps提示缺libc.so.6(GLIBC_2.15)(64bit),怎办
1.试图运行程序,提示"libc.so.6: version `GLIBC_2.14' not found",原因是系统的glibc版本太低,软件编译时使用了较高版本的glibc引起的:
[ghui@StuOS bin]$ pwd
/var/VMdisks/cross/mingw32/bin
[ghui@StuOS bin]$ ls
lrelease QtCore4.dll QtNetwork4.dll QtSql4.dll QtXml4.dll
moc QtDeclarative4.dll QtOpenGL4.dll QtSvg4.dll rcc
phonon4.dll QtGui4.dll QtScript4.dll QtTest4.dll uic
qmake QtMultimedia4.dll QtScriptTools4.dll QtWebKit4.dll
[ghui@StuOS bin]$./qmake
./qmake:/lib64/libc.so.6: version `GLIBC_2.14' not found(required by./qmake)
2.查看系统glibc支持的版本:
[ghui@StuOS bin]$ strings/lib64/libc.so.6|grep GLIBC_
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_PRIVATE
[ghui@StuOS bin]$ rpm-qa|grep glibc
glibc-static-2.12-1.80.el6_3.6.x86_64
glibc-headers-2.12-1.80.el6_3.6.x86_64
glibc-common-2.12-1.80.el6_3.6.x86_64
glibc-devel-2.12-1.80.el6_3.6.x86_64
glibc-static-2.12-1.80.el6_3.6.i686
glibc-devel-2.12-1.80.el6_3.6.i686
glibc-2.12-1.80.el6_3.6.i686
glibc-2.12-1.80.el6_3.6.x86_64
3.可以看到最高只支持2.12版本,所以考虑编译解决这个问题:
a.到下载最新版本,我这里下载了glibc-2.14.tar.xz这个版本,解压到任意目录准备编译
b.这里解压到/var/VMdisks/glibc-2.14/
[ghui@StuOS bin]$ cd/var/VMdisks/glibc-2.14/
[ghui@StuOS glibc-2.14]$ pwd
/var/VMdisks/glibc-2.14
[ghui@StuOS glibc-2.14]$ ls
abilist config.h.in intl README.libm
abi-tags config.log io resolv
aclocal.m4 config.make.in libc-abis resource
aout configure libidn rt
argp configure.in libio Rules
assert conform LICENSES scripts
autom4te.cache CONFORMANCE locale setjmp
bits COPYING localedata shadow
BUGS COPYING.LIB login shlib-versions
build cppflags-iterator.mk mach signal
CANCEL-FCT-WAIVE crypt Makeconfig socket
CANCEL-FILE-WAIVE csu Makefile soft-fp
catgets ctype Makefile.in stdio-common
ChangeLog debug Makerules stdlib
ChangeLog.1 dirent malloc streams
ChangeLog.10 dlfcn manual string
ChangeLog.11 elf math sunrpc
ChangeLog.12 extra-lib.mk misc sysdeps
ChangeLog.13 extra-modules.mk NAMESPACE sysvipc
ChangeLog.14 FAQ NEWS termios
ChangeLog.15 FAQ.in nis test-skeleton.c
ChangeLog.16 gmon NOTES time
ChangeLog.17 gnulib nptl timezone
ChangeLog.2 grp nptl_db tls.make.c
ChangeLog.3 gshadow nscd version.h
ChangeLog.4 hesiod nss Versions.def
ChangeLog.5 hurd o-iterator.mk wcsmbs
ChangeLog.6 iconv po wctype
ChangeLog.7 iconvdata posix WUR-REPORT
ChangeLog.8 include PROJECTS
ChangeLog.9 inet pwd
conf INSTALL README
c.在glibc源码目录建立构建目录,并cd进入构建目录
[ghui@StuOS glibc-2.14]$ mkdir build
[ghui@StuOS glibc-2.14]$ cd build
d.运行configure配置,make&& sudo make install
[ghui@StuOS build]$../configure--prefix=/opt/glibc-2.14
[ghui@StuOS build]$ make-j4
[ghui@StuOS build]$ sudo make install
[sudo] password for ghui:
4.临时修改环境变量
[ghui@StuOS bin]$ export LD_LIBRARY_PATH=/opt/glibc-2.14/lib:$LD_LIBRARY_PATH
[ghui@StuOS glibc-2.14]$ cd/var/VMdisks/cross/mingw32/bin/
[ghui@StuOS bin]$./qmake
Usage:./qmake [mode] [options] [files]
QMake has two modes, one mode for generating project files based on
some heuristics, and the other for generating makefiles. Normally you
shouldn't need to specify a mode, as makefile generation is the default
mode for qmake, but you may use this to test qmake on an existing project
...
CentOS下CronTab任务周期计划详解
CronTab任务周期计划
格式:
***** command
分(0-59)、时(0-23)、日(1-31)、月(1-12)、周(0-6)
说明:
1、星号可以匹配所有字符
2、一个整数、必须精确匹配
3、用短划线隔开的两个整数,它们匹配的是值的范围。
4、时间范围后加斜扛和一个步长值。1-10/2
普通用户流程:
crontab-e crontab是设置了setuid的,所以用户具有他的权限也就是root,并会在/tmp/cron....文件处理后保存在/var/spool/cron/$username中。
日志:
/var/log/cron
配置目录:
/var/run/crond.pid进程号地址
/etc/crontab使用指导文件
/etc/$weekday.等分别时日月周的目录,即可以把脚本放进去他会按时执行。
/etc/cron.{deny,allow}拒绝和允许用户使用crontab
Vixie-Cron:
centos安装时会默认安装此包,此包可以包括一个步长值。也就是如1,3,6,9,12可以写成,1-12/3除以3。所谓的*/1*/2也就是每一分钟每两分钟运行command。即1-59/{2,3}。
%号的运用:
%百分号表示command中的换行,只有第一个百分号之前的文本才包含在实际命令中,其余的行则作为该命令的标准输入。
安装:
yum install-y crontabs
使用:
crontab--help
crontab-e#检出一个crontab副本,调用vi编辑它,并重新保存在crontab目录。
crontab-l#将crontab的内容打印到标准输出。
crontab-r#册除并不留任何内容。
......
root册除其它用户。
crontab-r$username
[root@nagios~]# crontab--help
crontab: invalid option--'-'
crontab: usage error: unrecognized option
usage:crontab [-u user] file
crontab [-u user] [-e|-l|-r ]
(default operation is replace, per 1003.2)
-e(edit user's crontab)
-l(list user's crontab)
-r(delete user's crontab)
-i(prompt before deleting user's crontab)
-s(selinux context)
[root@nagios~]# ll/usr/bin/crontab
-rwsr-xr-x 1 root root 47520 Jul 19 2011/usr/bin/crontab
[root@nagios~]# cat/var/run/crond.pid
2074
[root@nagios~]# ll/etc/|grep-E cron
drwxr-xr-x 2 root root 4096 Apr 2 00:59 cron.d
drwxr-xr-x. 2 root root 4096 Sep 27 2011 cron.daily
-rw-r--r-- 1 root root 0 Jul 19 2011 cron.deny
drwxr-xr-x 2 root root 4096 Sep 27 2011 cron.hourly
drwxr-xr-x 2 root root 4096 Sep 27 2011 cron.monthly
-rw-r--r-- 1 root root 457 Sep 27 2011 crontab
drwxr-xr-x 2 root root 4096 Sep 27 2011 cron.weekly
[root@nagios~]# cat/etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# Example of job definition:
#.---------------- minute(0- 59)
#|.------------- hour(0- 23)
#||.---------- day of month(1- 31)
#|||.------- month(1- 12) OR jan,feb,mar,apr...
#||||.---- day of week(0- 6)(Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
#|||||
#***** user-name command to be executed
[root@nagios~]# ll/var/spool/cron/
total 8
-rw------- 1 root root 60 Apr 2 01:33 root
-rw------- 1 zwhset zwhset 68 Apr 2 01:51 zwhset
[root@nagios~]# tail-5/var/log/cron
Apr 2 17:24:01 nagios CROND[20544]:(root) CMD(/bin/sh~/hello)
Apr 2 17:25:01 nagios CROND[20549]:(root) CMD(/bin/sh~/hello)
Apr 2 17:25:01 nagios CROND[20550]:(root) CMD(/bin/sh~/hello)
Apr 2 17:25:01 nagios CROND[20551]:(zwhset) CMD(echo hello~/1.txt)
Apr 2 17:25:01 nagios CROND[20552]:(zwhset) CMD(echo hello~/1.txt)
[root@nagios~]# ps aux|grep cron
root 2074 0.0 0.5 117212 1316? Ss 01:40 0:04 crond
root 20641 0.0 0.6 139684 1468 pts/1 S+ 17:30 0:00 crontab-e
zwhset 20642 0.0 0.7 119284 1756 pts/1 S+ 17:30 0:00/bin/vi/tmp/crontab.YphQpH
root 20663 0.0 0.3 103236 856 pts/0 S+ 17:31 0:00 grep cron
[root@nagios~]# lsof-c crontab
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
crontab 20641 root cwd DIR 253,0 4096 130818/root
crontab 20641 root rtd DIR 253,0 4096 2/
crontab 20641 root txt REG 253,0 47520 401259/usr/bin/crontab
crontab 20641 root mem REG 253,0 5952 261889/lib64/security/pam_deny.so
crontab 20641 root mem REG 253,0 18592 261891/lib64/security/pam_env.so
crontab 20641 root mem REG 253,0 18592 261903/lib64/security/pam_limits.so
crontab 20641 root mem REG 253,0 10224 261901/lib64/security/pam_keyinit.so
crontab 20641 root mem REG 253,0 10240 261906/lib64/security/pam_loginuid.so
crontab 20641 root mem REG 253,0 6040 261912/lib64/security/pam_permit.so
crontab 20641 root mem REG 253,0 14384 261923/lib64/security/pam_succeed_if.so
crontab 20641 root mem REG 253,0 10200 261905/lib64/security/pam_localuser.so
crontab 20641 root mem REG 253,0 51952 261929/lib64/security/pam_unix.so
crontab 20641 root mem REG 253,0 113432 261657/lib64/libnsl-2.12.so
crontab 20641 root mem REG 253,0 14456 261884/lib64/security/pam_access.so
crontab 20641 root mem REG 253,0 65928 261663/lib64/libnss_files-2.12.so
crontab 20641 root mem REG 253,0 99158576 397021/usr/lib/locale/locale-archive
crontab 20641 root mem REG 253,0 383504 261640/lib64/libfreebl3.so
crontab 20641 root mem REG 253,0 40400 261651/lib64/libcrypt-2.12.so
crontab 20641 root mem REG 253,0 1916568 261647/lib64/libc-2.12.so
crontab 20641 root mem REG 253,0 113096 261709/lib64/libaudit.so.1.0.0
crontab 20641 root mem REG 253,0 19536 261653/lib64/libdl-2.12.so
crontab 20641 root mem REG 253,0 55848 261879/lib64/libpam.so.0.82.2
crontab 20641 root mem REG 253,0 122040 261718/lib64/libselinux.so.1
crontab 20641 root mem REG 253,0 154464 261636/lib64/ld-2.12.so
crontab 20641 root 0u CHR 136,1 0t0 4/dev/pts/1
crontab 20641 root 1u CHR 136,1 0t0 4/dev/pts/1
crontab 20641 root 2u CHR 136,1 0t0 4/dev/pts/1
crontab 20641 root 3u unix 0xffff88000225c380 0t0 91831 socket
crontab 20641 root 5u REG 253,0 68 916745/tmp/crontab.YphQpH