-
虚拟服务器安装日志运维中心 / operations 2dot5 写在2017年05月05日df -h格式化硬盘fdisk /dev/vdb1pw硬盘分区mkfs.ext4 /dev/vdb1mount /dev/vdb1 /datavi /etc/fstab/dev/vdb1 /data ext4 defaults 0 0yum -y install lrzszyum install gccyum install gcc-c++yum install makenginx 安装预先安装 openssl 需要Perl 5Perl 5./Configure -des -Dprefix=/usr/local/perlmakemake testmake installmv /usr/bin/perl /usr/bin/perl.bakln -s /usr/local/perl/bin/perl /usr/bin/perlperl -vopenssl./config –prefix=/usr/local/openssl./config -tmakemake installcd /usr/localldd /usr/local/openssl/bin/opensslwhich opensslopenssl versionpcre./configure –enable-utf8./configuremakemake checkmake installyum -y install *zlib*nginx./configure –prefix=/usr/local/nginx–with-openssl=/usr/include (启用ssl)–with-pcre=/usr/include/pcre/ (启用正规表达式)–with-http_stub_status_module (安装可以查看nginx状态的程序)–with-http_memcached_module (启用memcache缓存)–with-http_rewrite_module (启用支持url重写)./configure –prefix=/data/nginx –with-openssl=/usr/include/openssl –with-pcre=/usr/include/pcre.h/ –with-http_stub_status_modulemakemake installvi /etc/init.d/nginx_______________________________________start______________________________________-#! /bin/bash## nginx Start/Stop the nginx daemon.## chkconfig: 2345 90 60# description: nginx# processname: nginx# config: /usr/local/nginx/conf/nginx.conf# pidfile: /usr/local/nginx/logs/nginx.pid# Source function library.. /etc/init.d/functions# Nginx SettingsNGX_PID_FILE=’/usr/local/nginx/logs/nginx.pid’NGX_PROC=’/usr/local/nginx/sbin/nginx’NGX_LOCK_FILE=’/var/lock/subsys/nginx’#PHP_FPM=’/usr/local/php-fcgi/sbin/php-fpm’# Progran nameprog=”nginx”start() {ulimit -HSn 65536echo -n $”Starting $prog: ”if [ -e $NGX_LOCK_FILE ]; thenif [ -e $NGX_PID_FILE ] && [ -e /proc/`cat $NGX_PID_FILE` ]; thenecho -n $”cannot start $prog: nginx is already running.”failure $”cannot start $prog: nginx is already running.”echoreturn 1fifi$NGX_PROCRETVAL=$?[ $RETVAL -eq 0 ] && success $”$prog start” || failure $”$prog start”[ $RETVAL -eq 0 ] && touch $NGX_LOCK_FILEecho#php-fpm#$PHP_FPM startreturn $RETVAL}stop() {echo -n $”Stopping $prog: ”if [ ! -e $NGX_LOCK_FILE ] || [ ! -e $NGX_PID_FILE ]; thenecho -n $”cannot stop $prog: nginx is not running.”failure $”cannot stop $prog: nginx is not running.”echoreturn 1fiPID=`cat $NGX_PID_FILE`if checkpid $PID 2>&1; then# TERM first, then KILL if not deadkill -TERM $PID >/dev/null 2>&1usleep 100000if checkpid $PID && sleep 1 && checkpid $PID && sleep 3 && checkpid $PID; thenkill -KILL $PID >/dev/null 2>&1usleep 100000fificheckpid $PIDRETVAL=$((! $?))[ $RETVAL -eq 0 ] && success $”$prog shutdown” || failure $”$prog shutdown”[ $RETVAL -eq 0 ] && rm -f $NGX_LOCK_FILE;echo#php-fpm#$PHP_FPM stopreturn $RETVAL}status() {status $prog}restart() {stopstart}reload() {echo -n $”Reloading $prog: ”if [ ! -e $NGX_LOCK_FILE ] || [ ! -e $NGX_PID_FILE ]; thenecho -n $”cannot reload $prog: nginx is not running.”failure $”cannot reload $prog: nginx is not running.”echoreturn 1fikill -HUP `cat $NGX_PID_FILE` >/dev/null 2>&1RETVAL=$?[ $RETVAL -eq 0 ] && success $”$prog reload” || failure $”$prog reload”echoreturn $RETVAL}case “$1” instart)start;;stop)stop;;restart)restart;;reload)reload;;status)status;;condrestart)[ -f $NGX_LOCK_FILE ] && restart || :;;configtest)$NGX_PROC -t;;*)echo $”Usage: $0 {start|stop|status|reload|restart|condrestart|configtest}”exit 1esac______________________________________________end______________________________________chmod 755 /etc/init.d/nginx && chkconfig –add nginx && chkconfig –level 3 nginx onservice nginx startservice nginx restartvi /etc/rc.localservice nginx startmysql的编译安装yum install gccyum install ncurses-develyum install gcc-c++./configure –prefix=/data/mysql –localstatedir=/data/mysqldata/ –with-comment=Source –with-server-suffix=-Community –with-mysqld-user=mysql –without-debug –with-big-tables –with-charset=utf8 –with-collation=utf8_general_ci –with-extra-charsets=all –with-pthread –enable-static –enable-thread-safe-client –with-client-ldflags=-all-static –with-mysqld-ldflags=-all-static –enable-assembler –without-innodb –without-ndb-debug –with-federated-storage-engine./configure –prefix=/data4/mysql –localstatedir=/data4/mysqldata/ –with-comment=Source –with-server-suffix=-Community –with-mysqld-user=mysql –without-debug –with-big-tables –with-charset=utf8 –with-collation=utf8_general_ci –with-extra-charsets=all –with-pthread –enable-static –enable-thread-safe-client –with-client-ldflags=-all-static –with-mysqld-ldflags=-all-static –enable-assembler –without-innodb –without-ndb-debug –with-federated-storage-engine# ./configure –prefix=/opt/mysql –with-charset=utf8 –with-extra-charsets=all –with-tcp-port=3306 –with-unix-socket-path=/tmp/mysql.sock –with-mysqld-user=mysqld –with-federated-storage-engine./configure –with-federated-storage-engineshow variables like ‘plugin_dir’;show variables LIKE ‘have_%’;show engines;INSTALL PLUGIN InnoDB SONAME ‘ha_innodb.so’;INSTALL PLUGIN InnoDB SONAME ‘ha_innodb_plugin.so’;[Err] 1289 – The ‘plugin’ feature is disabled; you need MySQL built with ‘HAVE_DLOPEN’ to have it workingexport CFLAGS=”-O2 -DHAVE_DLOPEN=1″export CXXFLAGS=”-O2 -DHAVE_DLOPEN=1″makemake installcp support-files/my-medium.cnf /data/mysql/my.cnfuseradd mysqlchown -R mysql:mysql /data/mysqlchown -R mysql:mysql /data/mysqldata./mysql_install_db –user=mysql –basedir=/data/mysql/ –datadir=/data/mysqldata/vi my.cnfdatadir = /data/mysqldataln -s /data/mysql/share/mysql/mysql.server /etc/init.d/mysqlchmod 755 /etc/init.d/mysql && chkconfig –add mysql && chkconfig –level 3 mysql onvi /etc/rc.localservice mysql startln -sf my.cnf /etc/my.cnfvi .bash_profileMYSQL=/data/mysqlPATH=$PATH:$HOME/bin:$MYSQL/binexport MYSQLexport PATHsource .bash_profileSELECT @@MAX_CONNECTIONS AS ‘Max Connections’;select @@autocommit;重启reboot;exitgrant all privileges on *.* to ‘root’@’%’ ;SET PASSWORD FOR ‘root’@’%’ = PASSWORD(‘home123!@#’);SET PASSWORD FOR ‘root’@’%’ = PASSWORD(‘tlxd-client(2015)$!@#’);SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘home123!@#’);FLUSH PRIVILEGES;phpyum -y install curl-develyum -y install libpng-develyum install libxml2yum install libxml2-devellibmcrypt./configuremakemake installyum install bzip2-develyum install libjpeg-develyum install libpng-develyum install db4-develyum install freetype-devel./configure –prefix=/usr/local/php-fcgi –enable-fpm –with-config-file-path=/usr/local/php-fcgi/etc –enable-zend-multibyte –with-mysql=/data/mysql –with-libxml-dir=/usr/local/libxml2 –with-gd –with-jpeg-dir –with-png-dir –with-bz2 –with-freetype-dir –with-iconv-dir –with-zlib-dir –with-curl –with-mhash –with-openssl –enable-bcmath –with-mcrypt=/usr/local/libmcrypt –enable-sysvsem –enable-inline-optimization –enable-soap –enable-gd-native-ttf –enable-ftp –enable-mbstring –enable-exif –disable-debug –disable-ipv6makemake installcp php.ini-production /usr/local/php-fcgi/etc/php-fpm.confchown -R nobody 2dot5
上一篇: Liunx 防火墙 iptables
下一篇: nginx 日志配置
-
Mysql 5.7.20 glibc 安装
1、下载mysql glibc 包wget https://dow...
-
mysql的编译安装
mysql的编译安装 下载目录: http://gd....
-
nginx 日志配置
nginx 日志相关指令主要有两条, log_fo...
-
Liunx 防火墙 iptables
iptables 的命令参数 -t<表>:指...
-
服务安装和配置
lvs 安装和配置方法: 参考网站:http:/...
-
nginx
pcre zlib openssl 怎么捣鼓也没搞定,...
相关推荐
您好!请登录
已有0评论