日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

西部数码linux pdo_mysql,新服务器完整搭建www环境过程_MySQL

發布時間:2024/3/26 数据库 50 豆豆
生活随笔 收集整理的這篇文章主要介紹了 西部数码linux pdo_mysql,新服务器完整搭建www环境过程_MySQL 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

很久不搭www環境了,幾乎都要忘了,而且各種新版本,各種新參數。前段時間用金山云的主機,速度蠻不錯的,可惜備案過程是相當糾結,導致了本博被墻了一個多禮拜,狠狠心重新在西部數碼買了一臺,所以又要重新搭環境。之前搭環境有記錄編輯參數,沒記錄具體步驟,這次干脆把從前到后所有步驟記錄下來,以后操作也方便。懶人改變世界!

搜索rpmforge包

下載對應系統版本的rpmforge

#rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

#rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm

#rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm

檢查系統環境,更新軟件庫,安裝依賴

#chkconfig --list

#chkconfig --del mysql

#chkconfig --del httpd

#rpm -qa | grep http

#rpm -e httpd

#rpm -qa | grep apache

#rpm -e apache

#rpm -qa | grep php

#rpm -e php

#rpm -qa | grep mysql

#rpm -e mysql

#yum -y remove httpd*

#yum -y remove mysql*

#yum -y remove php*

#yum update#yum install patch make gcc gcc-c++ automake cmake autoconf kernel-devel libtool libtool-libs libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel glibc glibc-devel glibc-headers glibc-static glibc-utils openssl openssl-devel crypto-utils gettext gettext-devel ncurses ncurses-devel gmp-devel aspell aspell-devel perl-IO-Compress-Base perl-HTML-Parser perl-ExtUtils-MakeMaker perl-libwww-perl perl-Pod-Escapes perl-Module-Pluggable perl-libs perl-ExtUtils-FindFunctions perl-Compress-Raw-Zlib perl-IO-Compress-Zlib perl-Test-Harness perl-ExtUtils-ParseXS perl-Newt perl-HTML-Tagset perl-URI perl-Convert-ASN1 perl-ExtUtils-Embed perl-Pod-Simple perl-ExtUtils-DynaGlue perl-Compress-Zlib perl-devel perl-DBI gd gd-devel curl libcurl libcurl-devel readline readline-devel

添加對應用戶

#groupadd mysql

#useradd -g mysql -s /sbin/nologin mysql

#groupadd www

#useradd -g www -s /home/www www

安裝mysql#cmake /-DCMAKE_INSTALL_PREFIX=/usr/local/mysql /-DSYSCONFDIR=/etc /-DMYSQL_DATADIR=/home/mysql /-DEXTRA_CHARSETS=all /-DDEFAULT_CHARSET=utf8 /-DDEFAULT_COLLATION=utf8_general_ci /-DENABLED_LOCAL_INFILE=1 /-DWITH_MYISAM_STORAGE_ENGINE=1 /-DWITH_INNOBASE_STORAGE_ENGINE=1 /-DWITH_READLINE=1 /-DWITH_DEBUG=0 /-DMYSQL_TCP_PORT=3306 /-DMYSQL_USER=mysql /-DWITH_SSL=yes /-DENABLE_DOWNLOADS=1

#make && make install

#vim /etc/ld.so.conf

+/usr/local/mysql/lib

#ldconfig

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

#cp /usr/local/mysql/support-files/my-large.cnf /etc/my.cnf

#vim /etc/profile

找到# Path manipulation行,在if內部添加

pathmunge /usr/local/mysql/bin

#cd /usr/local/mysql && ./scripts/mysql_install_db --user=mysql

#/etc/init.d/mysqld restart

#chkconfig --add mysqld

#cd /usr/local/mysql && ./bin/mysql_secure_installation

安裝libiconv

#./configure && make && make install

安裝mhash

#./configure && make && make install

安裝libmcrypt

#./configure && make && make install

安裝mcrypt

#./configure && make && make install

安裝pcre

#./configure && make && make install

安裝nginx#./configure /--prefix=/usr/local/nginx /--user=www /--group=www /--with-select_module /--with-poll_module /--with-http_ssl_module /--with-http_realip_module /--with-http_image_filter_module /--with-http_sub_module /--with-http_dav_module /--with-http_gunzip_module /--with-http_gzip_static_module /--with-http_random_index_module /--with-http_secure_link_module /--with-pcre /--without-http_uwsgi_module /--without-http_scgi_module /--without-http_geo_module /--without-http_map_module /--without-mail_pop3_module /--without-mail_imap_module /--without-mail_smtp_module /--with-http_perl_module#make && make install

修改配置

與mysql類似的方法,添加下面內容

pathmunge /usr/local/nginx/sbin

nginx啟動腳本#!/bin/sh## nginx - this script starts and stops the nginx daemon## chkconfig: - 85 15 # description:Nginx is an HTTP(S) server, HTTP(S) reverse /# proxy and IMAP/POP3 proxy server# processname: nginx# config:/etc/nginx/nginx.conf# config:/etc/sysconfig/nginx# pidfile: /var/run/nginx.pid# Source function library.. /etc/rc.d/init.d/functions# Source networking configuration.. /etc/sysconfig/network# Check that networking is up.[ "$NETWORKING" = "no" ] && exit 0nginx="/usr/local/nginx/sbin/nginx"prog=$(basename $nginx)NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginxlockfile=/var/lock/subsys/nginxmake_dirs() { # make required directories user=`$nginx -V 2>&1 | grep "configure arguments:" | sed 's/[^*]*--user=/([^ ]*/).*//1/g' -` if [ -z "`grep $user /etc/passwd`" ]; then useradd -M -s /bin/nologin $user fi options=`$nginx -V 2>&1 | grep 'configure arguments:'` for opt in $options; do if [ `echo $opt | grep '.*-temp-path'` ]; then value=`echo $opt | cut -d "=" -f 2` if [ ! -d "$value" ]; then # echo "creating" $value mkdir -p $value && chown -R $user $value fi fi done}start() {[ -x $nginx ] || exit 5[ -f $NGINX_CONF_FILE ] || exit 6make_dirsecho -n $"Starting $prog: "daemon $nginx -c $NGINX_CONF_FILEretval=$?echo[ $retval -eq 0 ] && touch $lockfilereturn $retval}stop() {echo -n $"Stopping $prog: "killproc $prog -QUITretval=$?echo[ $retval -eq 0 ] && rm -f $lockfilereturn $retval}restart() {configtest || return $?stopsleep 1start}reload() {configtest || return $?echo -n $"Reloading $prog: "killproc $nginx -HUPRETVAL=$?echo}force_reload() {restart}configtest() {$nginx -t -c $NGINX_CONF_FILE}rh_status() {status $prog}rh_status_q() {rh_status >/dev/null 2>&1}case "$1" instart)rh_status_q && exit 0$1;;stop)rh_status_q || exit 0$1;;restart|configtest)$1;;reload)rh_status_q || exit 7$1;;force-reload)force_reload;;status)rh_status;;condrestart|try-restart)rh_status_q || exit 0;;*)echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"exit 2esac

安裝php#./configure /--prefix=/usr/local/php /--enable-fpm /--with-fpm-user=www /--with-fpm-group=www /--with-config-file-path=/usr/local/php/etc /--disable-ipv6 /--with-openssl /--with-zlib /--enable-bcmath /--with-bz2 /--enable-calendar /--with-curl /--with-libxml-dir=/usr /--enable-exif /--with-pcre-dir=/usr/local /--enable-ftp /--with-gd /--with-jpeg-dir /--with-png-dir /--with-freetype-dir /--enable-gd-native-ttf /--with-gettext /--with-mhash /--enable-mbstring /--with-mcrypt /--with-mysql=/usr/local/mysql /--with-mysql-sock=/tmp/mysql.sock /--with-mysqli=/usr/local/mysql/bin/mysql_config /--with-pdo-mysql=/usr/local/mysql /--with-pspell /--with-readline=/usr /--enable-soap /--enable-sockets /--enable-sysvmsg /--enable-sysvsem /--enable-sysvshm /--with-xmlrpc /--with-iconv=/usr/local /--enable-zip /--with-pear /--without-sqlite3 /--without-pdo-sqlite

#make && make install``#cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm#cp /root/phpsrc/php.ini-product /usr/local/php/etc/php.ini`

與mysql類似方法,添加下面的內容

pathmunge /usr/local/php/bin

memcache配置

#phpize#./configure /--enable-memcache /--with-php-config=/usr/local/php/bin/php-config

memcached配置

./configure --prefix=/usr/local/memcache --enable-64bit

基本上整個安裝過程就是這樣。

本文原創發布php中文網,轉載請注明出處,感謝您的尊重!

總結

以上是生活随笔為你收集整理的西部数码linux pdo_mysql,新服务器完整搭建www环境过程_MySQL的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。