您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

新服务器完整搭建www环境过程_MySQL

2024/5/30 22:17:19发布26次查看
很久不搭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/nginxprog=$(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 6 make_dirs echo -n $starting $prog: daemon $nginx -c $nginx_conf_file retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval}stop() { echo -n $stopping $prog: killproc $prog -quit retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval}restart() { configtest || return $? stop sleep 1 start}reload() { configtest || return $? echo -n $reloading $prog: killproc $nginx -hup retval=$? 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 in start) 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
基本上整个安装过程就是这样。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product