www.lizs.cc
2016-05-01Python
2016-04-27PHP
最近用微擎框架做微信公众号开发,需要通过绑定站点域名来收发信息。因此,平常在本地的开发环境是不能够满足需求的。但是,我们不可能每更改一点东西就将更改之后的内容更新到服务器上面去测试吧。为了能够让 URL 访问到本地的服务器,可以将指定域名的访问反向代理到本地来。
2016-03-26Nginx
2016-03-19Linux
2016-02-13Git
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
#!/bin/sh### BEGIN INIT INFO# Provides: php5-cgi# Required-Start: $remote_fs $network# Required-Stop: $remote_fs $network# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: starts the php5-cgi# Description: Starts the PHP FastCGI Process Manager Daemon### END INIT INFOPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/binDAEMON=/usr/bin/spawn-fcgiNAME=php5-cgiCGI_FILE=/usr/bin/$NAMEPID_FILE=/var/run/${NAME}.pidDAEMON_ARGS="-a 127.0.0.1 -p 9000 -C 32 -u lizs -g lizs -f $CGI_FILE -P $PID_FILE"# Load the VERBOSE setting and other rcS variables. /lib/init/vars.sh# Define LSB functions.. /lib/lsb/init-functions## Check if php5-cgi is running#do_check(){ # Return # 0 if php5-cgi doesn't has been started # 1 if php5-cgi was already running ps -ef | grep $NAME | grep -v grep > /dev/null || return 0 return 0}## Start php5-cgi#do_start(){ # Return # 0 if daemon has been started successfully # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --test --quiet --pidfile $PID_FILE --exec $DAEMON > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_ARGS 2> /dev/null \ || return 2 #spawn-fcgi -a 127.0.0.1 -p 9000 -C 32 -u lizs -g lizs -f /usr/bin/${NAME} -P $PID_FILE}## Stop php5-cgi#do_stop(){ # Return # 0 if daemon has beent stopped successfully # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=QUIT/30/TERM/5/KILL/5 --pidfile $PID_FILE --name $NAME --remove-pidfile RETVAL="$?" return "$RETVAL" #killall $NAME #rm -f $PID_FILE}case "$1" in start) if init_is_upstart; then exit 1 fi log_daemon_msg "Starting $NAME" do_start case "$?" in 0|1) log_end_msg 0 ;; 2) log_end_msg 1 ;; esac ;; stop) if init_is_upstart; then exit 1 fi log_daemon_msg "Stopping $NAME" do_stop case "$?" in 0|1) log_end_msg 0 ;; 2) log_end_msg 1 ;; *) log_end_msg 1 ;; esac ;; restart) if init_is_upstart; then exit 1 fi log_daemon_msg "Restarting $NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; 2) log_end_msg 1 ;; *) log_end_msg 1 ;; esac ;; *) log_end_msg 1 ;; esac ;; status) status_of_proc "$CGI_FILE" "$NAME" && exit 0 || exit $? exit 0; ;; reload|force-reload) # No-op exit 0 ;; *) echo "Usage: $NAME {start|stop|status|help}" >&2 exit 1 ;;esac
2016-02-04PHP
每天定时访问一次网站的某个网页,而且这个网页是需要登录才能够访问。
2016-02-02PHP
2016-02-01PHP
2016-01-02Git
2016-01-01Git