svn nginx php apc yum 镜像

root@mongodb subversion]# chmod -R 777 iospro
[root@mongodb subversion]# killall -s 9  svnserve
[root@mongodb subversion]# svnserve -d  -r /data/subversion

___________________________________________________________________________

intall nginx


 ref :::::::::::::::::::::::::::::::   http://www.nginx.cn/install



. /configure -- sbin-path= /usr/local/nginx/bin \
 --conf-path= /usr/local/nginx/nginx .conf \
--pid-path= /usr/local/nginx/nginx .pid \
--with-http_ssl_module \
--with-pcre= /usr/local/src/pcre-8 .21 \
--with-zlib= /usr/local/src/zlib-1 .2.8 \
--with-openssl= /usr/local/src/openssl-1 .0.1c

___________________________________________________________________________

intall  php


ref:::: http://www.nginx.cn/231.html

yum -y install gcc automake autoconf libtool makegcc-c++

yum -y install libmcrypt-devel mhash-devel libxslt-devel\
  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

wget http: //cn2 .php.net /distributions/php-5 .4.7. tar .gz
tar zvxf php-5.4.7. tar .gz
cd php-5.4.7
. /configure --prefix= /usr/local/php  -- enable -fpm --with-mcrypt\
  -- enable -mbstring --disable-pdo --with-curl --disable-debug  --disable-rpath\
  -- enable -inline-optimization --with-bz2  --with-zlib -- enable -sockets\
  -- enable -sysvsem -- enable -sysvshm -- enable -pcntl -- enable -mbregex\
  --with-mhash -- enable -zip --with-pcre-regex --with-mysql  --with-mysqli\
  --with-gd --with-jpeg- dir
 
php配置文件目录

/usr/local/php/lib / php.ini  包含了apc的配置

之前要建立目录 php

make all install



cd /usr/local/php
cp etc/php-fpm.conf.default etc/php-fpm.conf
vi etc/php-fpm.conf
修改
user = www-data
group = www-data

如果www-data用户不存在,那么先添加www-data用户
groupadd www-data
useradd -g www-data www-data

复制原来的文件

  scp [可选参数] file_source file_target

scp  root@192.168.1.108:/usr/local/php/etc/php-fpm.conf  /usr/local/php/etc/


命令行下执行php,提示找不到命令

-bash: /usr/bin/php: No such file or directory

vi /etc/profile

在文件底部增加一行配置
export PATH=/usr/local/php/bin:$PATH

保存退出

source /etc/profile

安装php 的时候缺少一个库  a  problem

[root@node01 src]# wget http://switch.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
[root@node01 src]# tar -xzf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/share/man
make
make install
cd ..



修改nginx配置文件以支持php-fpm

nginx安装完成后,修改nginx配置文件为,/usr/local/nginx//nginx.conf

其中server段增加如下配置,注意标红内容配置,否则会出现No input file specified.错误

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
scp  root@192.168.1.108:/usr/local/nginx/nginx.conf/usr/local/nginx/

复制目录

scp  root@192.168.1.108:/usr/local/nginx/nginx.conf /usr/local/nginx/

启动php-fpm和nginx

/usr/local/php/sbin/php-fpm
sudo /usr/local/nginx/bin

php-fpm 关闭:
kill -INT `cat /usr/local/php/var/run/php-fpm.pid`

php-fpm 重启:

kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`

查看php-fpm进程数:

ps aux | grep -c php-fpm

 ps -ef | grep php-fpm


service mysqld stop     service mysqld start

rm -rf /usr/bin/apccode.bin

ln -s /usr/local/nginx/html/dumped_51/bin/51smartway.bin_20131010090700  /usr/bin/apccode.bin

ln -s /usr/local/nginx/html/dumproot/bin/xyws.bin_20130911063449 /usr/bin/apccode.bin

-------------------------------------------------------------------------------

nginx启动,重启,关闭命令

停止操作
停止操作是通过向nginx进程发送信号(什么是信号请参阅linux文 章)来进行的
步骤1:查询nginx主进程号
ps -ef | grep nginx
在进程列表里 面找master进程,它的编号就是主进程号了。
步骤2:发送信号
从容停止Nginx:
kill -QUIT 主进程号
快速停止Nginx:
kill -TERM 主进程号
强制停止Nginx:
pkill -9 nginx

start php:
 /usr/local/php/sbin/php-fpm
stop
 ps -ef | grep php-fpm
 kill -9 10299

scp   /usr/local/nginx/html/dumped_51/bin/51smartway.bin_20131010131429    root@112.124.19.154:/usr/bin/apccode.bin

phpmyadmin

phpmyadmin出现“Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.”的原因大多是php的临时文件夹的权限的设置不当或者文件夹不存在,php无法将session文件写入该文件夹而引起的,所以要解决这个问题就要从php的临时文件夹入手。我的服务器出现这个错误的原因是我修改了管理员的用户名,导致临时文件夹的路径不存在而引起的。

在php的安装文件夹下,或者其他指定的文件夹下创建一个专门用于存储session临时文件的文件夹,如:D:/php/temp,给予user对该文件夹最大的权限,如修改、写入、运行等权限。

打开php.ini文件(一般在c:\windows\文件夹下),找到session.save_path这一行,默认情况下是在管理员用户的临时文件夹下,如:C:/DOCUME~1/用户名/LOCALS~1/Temp,修改为上面的路径,如:D:/php/temp。

---
目录  的权限
/var/lib/php/session
cookie
/usr/local/nginx/cookie

linux下使用yum安装mysql
 
1、安装
查看有没有安装过:
          yum list installed mysql*
          rpm -qa | grep mysql*
 
查看有没有安装包:
          yum list mysql*
 
安装mysql客户端:
          yum install mysql
 
安装mysql 服务器端:
          yum install mysql-server
 
          yum install mysql-devel
  www.2cto.com  
2、启动&&停止
 
数据库字符集设置
          mysql配置文件/etc/my.cnf中加入default-character-set=utf8
 
启动mysql服务:
          service mysqld start或者/etc/init.d/mysqld start
开机启动:
          chkconfig -add mysqld,查看开机启动设置是否成功chkconfig --list | grep mysql*
 
          mysqld             0:关闭    1:关闭    2:启用    3:启用    4:启用    5:启用    6:关闭
停止:
          service mysqld stop      service mysqld start
2、登录
 
创建root管理员:
          mysqladmin -u root password 123456
  www.2cto.com  
登录:
          mysql -u root -p输入密码即可。
忘记密码:
          service mysqld stop
 
          mysqld_safe --user=root --skip-grant-tables
 
          mysql -u root
 
          use mysql
 
          update user set password=password("new_pass") where user="root";
 
          flush privileges;  
 
3、远程访问
 
开放防火墙的端口号
mysql增加权限:mysql库中的user表新增一条记录host为“%”,user为“root”。
4、 Linux MySQL的几个重要目录
  www.2cto.com  
数据库目录
         /var/lib/mysql/
配置文件
         /usr/share /mysql(mysql.server命令及配置文件)
相关命令
         /usr/bin(mysqladmin mysqldump等命令)
启动脚本
         /etc/rc.d/init.d/(启动脚本文件mysql的目录)
 



---------------------------------------------------------------------------------------------------------


安装apc


#find /var/vhosts \( -name “*.php” -or -name “*.inc” \) -type f -print |wc -l

::::::::::::::::::::::::::::::::::::::href   http://bbs.phpchina.com/thread-202432-1-1.html


wget http://pecl.php.net/get/APC-3.0.19.tgz
tar xzvf APC-3.0.19.tgz
/usr/local/php/bin/phpize
./configure --enable-apc --enable-apc-mmap  --enable-apc-spinlocks --disable-apc-pthreadmutex  --with-php-config=/usr/local/php/bin/php-config --prefix=/usr/local/apc
make && make install


注:安装编译后检查相应目录:

ll /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
-rwxr-xr-x 1 root root 416628 12-15 17:13 apc.so

vi /usr/local/php/etc/[apc]


extension=”apc.so”
apc.enabled = 1
apc.cache_by_default = on
apc.shm_segments = 1
apc.shm_size = 64M
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 0
apc.write_lock = On

--------------建议

apc.num_files_hint = 1000  (#find /var/vhosts \( -name “*.php” -or -name “*.inc” \) -type f -print  |wc -l)
apc.user_entries_hint = 4096

apc.stat_ctime = 0

apc.stat = 0(APC不去检查Opcodes相对应的php源文件)


具体的配置请参考

  http://bbs.phpchina.com/thread-202432-1-1.html


http://www.php.net/manual/zh/install.pecl.downloads.php

svn

http://svn.php.net/repository/pecl/apc

补丁的制作

http://linux-wiki.cn/wiki/zh-hans/%E8%A1%A5%E4%B8%81%28patch%29%E7%9A%84%E5%88%B6%E4%BD%9C%E4%B8%8E%E5%BA%94%E7%94%A8


------------------------------------------------------------------------------------------------------------------------------

yum  中国科技大学


命令无法连接仓库,请检查你的/etc/yum.repos.d/

etc/yum.repos.d/CentOS-Base.repo


[base]
name=CentOS-$releasever - Base
baseurl=http://centos.ustc.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http:/centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://centos.ustc.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6


#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://centos.ustc.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://centos.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值