新浦京81707con > 功能介绍 > Mysql安装配置

原标题:Mysql安装配置

浏览次数:60 时间:2019-06-26

安装 libxml2

tar -zxvf libxml2-2.7.6.tar.gz  cd libxml2-2.7.6  ./configure  make && make install clean  cd ..

make install 

# PHP only, required if PHP was built with --enable-force-cgi-redirect
#fastcgi_param  REDIRECT_STATUS    200;

编写翻译安装PHP 5.2.11所需的支撑库 libiconv

tar zxvf libiconv-1.13.tar.gz
cd libiconv-1.13
./configure --prefix=/usr/local
make && make install clean
cd ..

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

  使配置立时生效:

转:

cd mhash-0.9.9.9/   

  第贰个压缩包:nginx-php-2.zip
  下载地址:

安装 zlib

tar zxvf zlib-1.2.3.tar.gz  cd zlib-1.2.3  ./configure  make && make install clean  cd ..

tar zxvf mhash-0.9.9.9.tar.gz   

ulimit -SHn 51200
/usr/local/webserver/nginx/sbin/nginx -c /usr/local/webserver/nginx/conf/nginx.conf

编写翻译安装PHP(法斯特CGI方式)

tar zxvf php-5.2.11.tar.gz
gzip -cd php-5.2.11-fpm-0.5.13.diff.gz | patch -d php-5.2.11 -p1
cd php-5.2.11
./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-gd --enable-gd-native-ttf --with-libxml-dir --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-openssl --enable-pcntl --enable-sockets
make ZEND_EXTRA_LIBS='-liconv'
make install clean
cp php.ini-dist /usr/local/webserver/php/etc/php.ini
cd ..


tar zxvf libmcrypt-2.5.8.tar.gz  

  2、解压缩:

安装 Nginx0.8.24

tar zxvf nginx-0.8.24.tar.gz
cd nginx-0.8.24
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module
make && make install clean
cd ..

安装nginx

  输入以下内容:

安装Nginx所需的pcre库

tar zxvf pcre-8.00.tar.gz
cd pcre-8.00
./configure
make && make install clean
cd ..

 


安装 Nginx

cp php.ini-production /etc/php.ini


安装 gd2.0.35

tar zxvf gd-2.0.35.tar.gz  cd gd-2.0.35  ./configure  make && make install clean  cd ..

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 

  显示器呈现的即为Nginx主进程号,比方:
  6302
  那时,施行以下命令就可以使修改过的Nginx配置文件生效:

创办www组、用户、Nginx 日志目录

/usr/sbin/groupadd www   /usr/sbin/useradd www -g www -d /dev/null -s /sbin/nologin  mkdir -p /var/log/nginx  chmod  w /var/log/nginx  chown -R www:www /var/log/nginx

/sbin/ldconfig  

  5、修改php.ini文件
  手工业修改:查找/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 = "gd.so"

安装 GD

服务章程运营php-fpm 


安装 PHP

make && make install 


安装 jpeg

tar zxvf jpegsrc.v7.tar.gz  cd jpeg-7  ./configure -enable-shared -enable-static  make && make install clean  cd ..

cd php-5.4.13

tar zxvf php-5.2.5.tar.gz
cd php-5.2.5/
./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-debug --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-force-cgi-redirect --enable-mbstring --with-mcrypt
sed -i 's#-lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt#& -liconv#' Makefile
make
make install
cp php.ini-dist /usr/local/webserver/php/etc/php.ini
cd ../

安装 libpng

tar zxvf libpng-1.2.40.tar.gz  cd libpng-1.2.40  ./configure  make && make install clean  cd ..

【1】 编译PHP


创建 Nginx 配置文件

rm -f /usr/local/webserver/nginx/conf/nginx.conf
vi /usr/local/webserver/nginx/conf/nginx.conf

输入以下内容:

user  www www;  worker_processes 8;    error_log  /var/log/nginx/error.log;  pid        /var/log/nginx/nginx.pid;    worker_rlimit_nofile 51200;  events {    use epoll;    worker_connections 51200;  }    http {      include       mime.types;      default_type  application/octet-stream;        server_names_hash_bucket_size 128;      client_header_buffer_size 32k;      large_client_header_buffers 4 32k;      client_max_body_size 8m;        sendfile        on;      tcp_nopush     on;            keepalive_timeout  30;            tcp_nodelay on;        fastcgi_connect_timeout 300;      fastcgi_send_timeout 300;      fastcgi_read_timeout 300;      fastcgi_buffer_size 64k;      fastcgi_buffers 4 64k;      fastcgi_busy_buffers_size 128k;      fastcgi_temp_file_write_size 128k;        gzip  on;      gzip_min_length   1k;       gzip_buffers      4 16k;       gzip_http_version 1.1;       gzip_comp_level   2;      gzip_types text/plain application/x-javascript text/css application/xml        gzip_vary on;            server {          listen       80;          server_name  localhost;          root   /home/excms;          index  index.html index.htm index.php;            location ~ .php$ {              fastcgi_pass   127.0.0.1:9000;              fastcgi_index  index.php;              fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;              include        fastcgi_params;          }            location /nginx_status {              stub_status on;              access_log   off;          }      }  }  

始建 Nginx 开机运转脚本

vi /etc/init.d/nginx

参与以下内容

#!/bin/bash  #  # chkconfig: - 85 15  # description: Nginx is a World Wide Web server.  # processname: nginx    nginx=/usr/local/webserver/nginx/sbin/nginx  conf=/usr/local/webserver/nginx/conf/nginx.conf    case $1 in         start)                echo -n "Starting Nginx"                $nginx -c $conf                echo " done"         ;;           stop)                echo -n "Stopping Nginx"                killall -9 nginx                echo " done"         ;;           test)                $nginx -t -c $conf         ;;     reload)                echo -n "Reloading Nginx"                ps auxww | grep nginx | grep master | awk '{print $2}' | xargs kill -HUP                echo " done"         ;;     restart)    $0 stop    $0 start         ;;           show)                ps -aux|grep nginx         ;;           *)                echo -n "Usage: $0 {start|restart|reload|stop|test|show}"         ;;     esac  

为 nginx.sh 脚本设置可举办属性

chmod x /etc/init.d/nginx

增添 Nginx 为系统服务(开机自动运行)

chkconfig --add nginx  chkconfig nginx on

启动 Nginx

service nginx start

在不停息 Nginx 服务的情形下平滑更动 Nginx 配置
修改 /usr/local/webserver/nginx/conf/nginx.conf 配置文件后,请实施以下命令检查计划文件是或不是准确:

service nginx test

  假诺显示屏展现以下两行新闻,表明配置文件正确:
the configuration file /usr/local/webserver/nginx/conf/nginx.conf syntax is ok
the configuration file /usr/local/webserver/nginx/conf/nginx.conf was tested successfully

平整更改 Nginx 配置

service nginx reload

mv php-fpm.conf.default  php-fpm.conf 

  五、优化Linux内核参数

安装 freetype

tar zxvf freetype-2.3.11.tar.gz  cd freetype-2.3.11  ./configure  make && make install clean  cd ..

cd libltdl  

  6、创制www用户和组,以及其行使的目录:

--enable-bcmath   

/sbin/sysctl -p

make ZEND_EXTRA_LIBS='-liconv' 

  附:各开源软件单独下载地址(倘使下载了以上七个压缩包,则没有供给下载以下软件):
   (登陆用户名、密码均为blog.s135.com)

#PHP注重的库文件

  8、运行php-cgi进度,监听127.0.0.1的10080端口,进度数为64(假设服务器内存小于3GB,能够只开启贰十个经过),用户为www:

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

               location / {
                    stub_status on;
                    access_log   off;
               }
       }
}

--enable-gd-native-ttf --with-openssl --with-mhash   

       server
       {
               listen  80;
               server_name  status.blog.s135.com;

useradd www

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

 

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

./configure --prefix=/usr/local/pcre

  4、创造Nginx配置文件
  ①、在/usr/local/webserver/nginx/conf/目录中开创nginx.conf文件:

tar zxvf nginx-1.0.15.tar.gz

ps -ef | grep "nginx: master process" | grep -v "grep" | awk -F ' ' '{print $2}'

--with-xmlrpc --enable-zip --enable-soap   

  假如显示屏展现以下两行消息,表明配置文件正确:
  the configuration file /usr/local/webserver/nginx/conf/nginx.conf syntax is ok
  the configuration file /usr/local/webserver/nginx/conf/nginx.conf was tested successfully

--with-mhash --enable-sockets --enable-ftp   

       charset  gb2312;
      
       server_names_hash_bucket_size 128;
      
       #sendfile on;
       #tcp_nopush     on;

#nginx所急需的库文件件

mkdir -p /data1/logs
chmod w /data1/logs
chown -R www:www /data1/logs

 

  机动修改:若嫌手工业修改麻烦,可进行以下shell命令,自动完结对php.ini文件的退换:

./configure  

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

cd /usr/local/php5.4/etc

               if (-d $request_filename)
               {
                      rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
               }
                              
               location ~ .*.php?$
               {
                    include conf/fcgi.conf;      
                    fastcgi_pass  127.0.0.1:10080;
                    fastcgi_index index.php;
               }

cp -frp /usr/lib64/libldap* /usr/lib/

  在最终扩充以下内容:

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

vi /etc/sysctl.conf

 

  4、编写翻译安装PHP5扩充模块

mkdir -p /usr/local/php5.4  

  三、安装Nginx 0.5.33
  1、安装Nginx所需的pcre库:

yum -y install pcre-devel zlib-devel

/usr/local/webserver/php/bin/spawn-fcgi -a 127.0.0.1 -p 10080 -C 64 -u www -f /usr/local/webserver/php/bin/php-cgi

 

/usr/local/webserver/nginx/sbin/nginx -t

make && make install 

  第一个压缩包:nginx-php-1.zip
  下载地址:

【首要内容】

  3、创设Nginx日志目录

本文由新浦京81707con发布于功能介绍,转载请注明出处:Mysql安装配置

关键词: 新浦京81707con linux

上一篇:php环境配置

下一篇:没有了