1435216752368.jpg (13.33 KB, 下载次数: 11)
下载附件 保存到相册
VPS主机 Ghost博客 Nginx配置 Node.js MariaDB
2017-1-9 23:37 上传
1.nginx 1.9.2 编译SPDY模块 ; 2.node.js v0.12.4 ; 3.MariaDB 10.1.5(YUM快速安装) ; 4.安装并配置Ghost 0.6.3程序 。
cd /usr/local/srcwget http://nginx.org/download/nginx-1.9.2.tar.gz复制代码
tar xzvf nginx-1.9.2.tar.gzcd nginx-1.9.2复制代码
yum update -y && yum install -y ncurses-devel make gcc bc cd /usr/local/src wget http://www.openssl.org/source/openssl-1.0.1h.tar.gz tar zxvf openssl-1.0.1h.tar.gz cd openssl-1.0.1h ./configmake复制代码
#安装依赖环境yum update -y && yum install pcre-devel zlib-devel #编译nginx./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --with-http_spdy_module --with-openssl=/usr/local/src/openssl-1.0.1huseradd www -g www make make install 复制代码
#!/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="http://www.chinaz.com/usr/local/nginx/conf/nginx.conf"[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginxlockpold=/var/lock/subsys/nginxmake_dirs() { # make required directoriesuser=`$nginx -V 2>&1 | grep "configure arguments:" | sed 's/[^*]*--user=\([^ ]*\).*/\1/g' -`if [ -z "`grep $user /etc/passwd`" ]; thenuseradd -M -s /bin/nologin $userfioptions=`$nginx -V 2>&1 | grep 'configure arguments:'`for opt in $options; doif [ `echo $opt | grep '.*-temp-path'` ]; thenvalue=`echo $opt | cut -d "=" -f 2`if [ ! -d "$value" ]; then# echo "creating" $valuemkdir -p $value && chown -R $user $valuefifidone}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" 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 复制代码
chkconfig --add /etc/init.d/nginx service nginx start chkconfig --level 2345 nginx on 复制代码
cd /etc/yum.repos.d vim MariaDB.repo #输入如下内容[mariadb]name = MariaDB baseurl = http://yum.mariadb.org/10.1.5/centos6-amd64/ gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 #保存退出复制代码
yum install MariaDB-server MariaDB-client MariaDB-devel service mysql start 复制代码
cd /etc/my.cnf.d vim server.cnf #在[mysqld]段下加入character-set-server=utf8 #在[server]段上方输入[client]default-character-set=utf8 #保存退出service mysql restart 复制代码
1435216752425.gif (4.66 KB, 下载次数: 10)
mysql -uroot -p你的密码 #MariaDB>表示在mysql客户端中输入MariaDB>CREATE DATABASE ghost; MariaDB>quit 复制代码
tar xzvf nginx-1.9.2.tar.gzcd nginx-1.9.20复制代码
tar xzvf nginx-1.9.2.tar.gzcd nginx-1.9.21复制代码
1435216752629.gif (6.91 KB, 下载次数: 7)
使用道具 举报
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
|关于我们|申请友链|Archiver|手机版|拘留所|冠富商务通
GMT+8, 2025-5-18 12:47 , Processed in 0.117007 second(s), 24 queries , Wincache On.
Powered by HCMS Version 2.0
© 2008-05-14 guanfu.net.cn