ysoren 发表于 2018-11-11 12:23:06

nginx结合apache

  mkdir -pv /home/{software,data0,data1}
  ln -s /home/software /
  ln -s /home/data0 /
  ln -s /home/data1 /
  cd /software
  wget http://blog.s135.com/soft/linux/nginx_php/nginx/nginx-0.8.46.tar.gz
  wget http://blog.s135.com/soft/linux/nginx_php/php/php-5.2.14.tar.gz
  wget http://blog.s135.com/soft/linux/nginx_php/phpfpm/php-5.2.14-fpm-0.5.14.diff.gz
  wget http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.5.3-m3.tar.gz
  wget http://blog.s135.com/soft/linux/nginx_php/libiconv/libiconv-1.13.1.tar.gz
  wget http://blog.s135.com/soft/linux/nginx_php/mcrypt/libmcrypt-2.5.8.tar.gz
  wget http://blog.s135.com/soft/linux/nginx_php/mcrypt/mcrypt-2.6.8.tar.gz
  wget http://blog.s135.com/soft/linux/nginx_php/memcache/memcache-2.2.5.tgz
  wget http://blog.s135.com/soft/linux/nginx_php/mhash/mhash-0.9.9.9.tar.gz
  wget http://blog.s135.com/soft/linux/nginx_php/pcre/pcre-8.10.tar.gz
  wget http://blog.s135.com/soft/linux/nginx_php/eaccelerator/eaccelerator-0.9.6.1.tar.bz2
  wget http://blog.s135.com/soft/linux/nginx_php/pdo/PDO_MYSQL-1.0.2.tgz
  wget http://blog.s135.com/soft/linux/nginx_php/imagick/ImageMagick.tar.gz
  wget http://blog.s135.com/soft/linux/nginx_php/imagick/imagick-2.3.0.tgz
  wget http://www.monkey.org/~provos/libevent-1.3.tar.gz
  wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
  wget http://www.teslacore.it/projects/amfext/amfext-0.9.zip
  wget http://labs.renren.com/apache-mirror/httpd/httpd-2.2.16.tar.bz2
  tar zxvf libiconv-1.13.1.tar.gz
  cd libiconv-1.13.1/
  ./configure --prefix=/usr/local
  make
  make install
  cd ../
  tar zxvf libmcrypt-2.5.8.tar.gz
  cd libmcrypt-2.5.8/
  ./configure
  make
  make install
  ldconfig
  cd libltdl/
  ./configure --enable-ltdl-install
  make
  make install
  cd ../../
  tar zxvf mhash-0.9.9.9.tar.gz
  cd mhash-0.9.9.9/
  ./configure
  make
  make install
  cd ../
  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/
  ldconfig
  ./configure
  make
  make install
  cd ../
  groupadd mysql
  useradd -g mysql mysql
  tar zxvf mysql-5.5.3-m3.tar.gz
  cd mysql-5.5.3-m3/
  ./configure --prefix=/usr/local/gserver/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=partition,innobase,myisammrg
  make && make install
  chmod +w /usr/local/gserver/mysql
  chown -R mysql:mysql /usr/local/gserver/mysql
  cd ../
  mkdir -p /data0/mysql/3306/data/
  mkdir -p /data0/mysql/3306/binlog/
  mkdir -p /data0/mysql/3306/relaylog/
  chown -R mysql:mysql /data0/mysql/
  /usr/local/gserver/mysql/bin/mysql_install_db --basedir=/usr/local/gserver/mysql --datadir=/data0/mysql/3306/data --user=mysql(end)
  vim /data0/mysql/3306/my.cnf
  vim /data0/mysql/3306/mysql
  chmod +x /data0/mysql/3306/mysql
  /data0/mysql/3306/mysql start
  /usr/local/gserver/mysql/bin/mysql -u root -p -S /tmp/mysql.sock

  GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost'>
  GRANT ALL PRIVILEGES ON *.* TO 'admin'@'127.0.0.1'>
  grant all privileges on *.* to 'admin'@'%'>  tar xvf httpd-2.2.16.tar.bz2
  cd httpd-2.2.16
  ./configure --prefix=/usr/local/gserver/apache2 --enable-mods-shared=most --enable-so --enable-cache --enable-disk-cache --enable-mem-cache --enable-rewrite --enable-ssl
  make
  make install
  echo "export PATH=\$PATH:/usr/local/apache2/bin" >> /etc/profile
  echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.local
  cd /software
  tar zxvf php-5.2.14.tar.gz
  cd php-5.2.14/
  ./configure --prefix=/usr/local/gserver/php --with-config-file-path=/usr/local/gserver/php/etc --with-mysql=/usr/local/gserver/mysql --with-mysqli=/usr/local/gserver/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-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 --with-xmlrpc --enable-zip --enable-soap --with-apxs2=/usr/local/gserver/apache2/bin/apxs --without-sqlite --without-pdo-sqlite
  make clean
  make ZEND_EXTRA_LIBS='-liconv'
  make install
  cp php.ini-dist /usr/local/gserver/php/etc/php.ini
  cd ../
  tar zxvf memcache-2.2.5.tgz
  cd memcache-2.2.5/
  /usr/local/gserver/php/bin/phpize
  ./configure --with-php-config=/usr/local/gserver/php/bin/php-config
  make
  make install
  cd ../
  tar xvfzlibevent-1.3.tar.gz
  cd libevent-1.3
  ./configure --prefix=/usr
  make
  make install
  cd ..
  tar xvf memcached-1.4.5.tar.gz
  cd memcached-1.4.5
  ./configure --with-libevent=/usr
  make
  make install
  /usr/local/bin/memcached -d -m 128 -u root -l 127.0.0.1 -p 11211 -c 512 -P /tmp/memcached.pid
  cd ..
  tar zxvf PDO_MYSQL-1.0.2.tgz
  cd PDO_MYSQL-1.0.2/
  /usr/local/gserver/php/bin/phpize
  ./configure --with-php-config=/usr/local/gserver/php/bin/php-config --with-pdo-mysql=/usr/local/gserver/mysql
  make
  make install
  cd ../
  tar zxvf ImageMagick.tar.gz
  cd ImageMagick-6.5.1-2/
  ./configure
  make
  make install
  cd ../
  tar zxvf imagick-2.3.0.tgz
  cd imagick-2.3.0/
  /usr/local/gserver/php/bin/phpize
  ./configure --with-php-config=/usr/local/gserver/php/bin/php-config
  make
  make install
  cd ../
  cd /software
  unzip amfext-0.9.zip
  cd amfext-0.9
  /usr/local/gserver/php/bin/phpize
  ./configure --enable-amf --with-php-config=/usr/local/gserver/php/bin/php-config
  make && make install
  cd ..
  groupadd www
  useradd -g www www
  mkdir -p /data0/htdocs
  chmod +w /data0/htdocs
  chown -R www:www /data0/htdocs
  tar zxvf pcre-8.10.tar.gz
  cd pcre-8.10/
  ./configure
  make
  make install
  cd ../
  tar zxvf nginx-0.8.46.tar.gz
  cd nginx-0.8.46/
  ./configure --user=www --group=www --prefix=/usr/local/gserver/nginx --with-http_stub_status_module --with-http_ssl_module
  make
  make install
  cd ../
  mkdir -p /data1/logs
  chmod +w /data1/logs
  chown -R www:www /data1/logs
  vi /usr/local/gserver/nginx/conf/nginx.conf
  vi /usr/local/gserver/nginx/conf/fcgi.conf
  ulimit -SHn 65535
  /usr/local/gserver/nginx/sbin/nginx
  echo "/usr/local/gserver/nginx/sbin/nginx" >> /etc/rc.local
  echo "/data0/mysql/3306/mysql start" >> /etc/rc.local
  echo "/usr/local/bin/memcached -d -m 128 -u root -l 127.0.0.1 -p 11211 -c 512 -P /tmp/memcached.pid" >> /etc/rc.local

页: [1]
查看完整版本: nginx结合apache