一、防火墙配置

CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙。

1、关闭firewall:

  1. systemctl stop firewalld.service #停止firewall
  2. systemctl disable firewalld.service #禁止firewall开机启动

2、安装iptables防火墙

  1. yum install iptables-services #安装
  2. vi /etc/sysconfig/iptables #编辑防火墙配置文件
  3. # sample configuration for iptables service
  4. # you can edit this manually or use system-config-firewall
  5. # please do not ask us to add additional ports/services to this default configuration
  6. *filter
  7. :INPUT ACCEPT [0:0]
  8. :FORWARD ACCEPT [0:0]
  9. :OUTPUT ACCEPT [0:0]
  10. -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
  11. -A INPUT -p icmp -j ACCEPT
  12. -A INPUT -i lo -j ACCEPT
  13. -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
  14. -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
  15. -A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
  16. -A INPUT -j REJECT --reject-with icmp-host-prohibited
  17. -A FORWARD -j REJECT --reject-with icmp-host-prohibited
  18. COMMIT
  1. systemctl restart iptables.service #最后重启防火墙使配置生效
  2. systemctl enable iptables.service #设置防火墙开机启动
  1. /usr/libexec/iptables/iptables.init restart #重启防火墙

二、关闭SELINUX

  1. vi /etc/selinux/config
  2. #SELINUX=enforcing #注释掉
  3. #SELINUXTYPE=targeted #注释掉
  4. SELINUX=disabled #增加
  1.  
  1. setenforce 0 #使配置立即生效

三、下载软件包

  1. 1、下载nginx
  2. http://nginx.org/download/nginx-1.10.1.tar.gz
  3. 2、下载MySQL
  4. http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.33.tar.gz
  5. 3、下载php
  6. http://cn2.php.net/distributions/php-5.6.26.tar.gz
  7. 4、下载cmakeMySQL编译工具)
  8. https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz
  9. 5、下载pcre (支持nginx伪静态)
  10. ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
  11. 6、下载opensslnginx扩展)
  12. https://www.openssl.org/source/openssl-1.0.2j.tar.gz
  13. 7、下载zlibnginx扩展)
  14. http://zlib.net/zlib-1.2.8.tar.gz
  15. 8、下载libmcryptphp扩展)
  16. http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
  17. 9、下载yasmphp扩展)
  18. http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
  19. 10t1libphp扩展)
  20. ftp://sunsite.unc.edu/pub/Linux/libs/graphics/t1lib-5.1.2.tar.gz
  21. 11、下载gd库安装包
  22. https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.1.tar.gz
  23. 12libvpxgd库需要)
  24. http://ftp.osuosl.org/pub/blfs/conglomeration/libvpx/libvpx-1.6.0.tar.bz2
  25. 13tiffgd库需要)
  26. http://download.osgeo.org/libtiff/tiff-4.0.6.tar.gz
  27. 14libpnggd库需要)
  28. ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/libpng-1.6.25.tar.gz
  29. 15freetypegd库需要)
  30. http://download.savannah.gnu.org/releases/freetype/freetype-2.7.tar.gz
  31. 16jpegsrcgd库需要)
  32. http://www.ijg.org/files/jpegsrc.v9b.tar.gz

四、安装编译工具及库文件

  1. yum install -y apr* autoconf automake bison bzip2 bzip2* cloog-ppl compat* cpp curl curl-devel fontconfig fontconfig-devel freetype freetype* freetype-devel gcc gcc-c++ gtk+-devel gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng libpng-devel libjpeg* libsepol-devel libselinux-devel libstdc++-devel libtool* libgomp libxml2 libxml2-devel libXpm* libxml* libtiff libtiff* make mpfr ncurses* ntp openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils telnet t1lib t1lib* nasm nasm* wget zlib-devel

安装mysql,php,nginx:

一.安装mysql

1、安装cmake

  1. cd /usr/local/src
  2. tar zxvf cmake-3.6.2.tar.gz
  3. cd cmake-3.6.2
  4. ./configure
  5. make
  6. make install

2、安装MySQL

  1. groupadd mysql #添加mysql组
  2. useradd -g mysql mysql -s /bin/false #创建用户mysql并加入到mysql组,不允许mysql用户直接登录系统
  3. mkdir -p /data/mysql #创建MySQL数据库存放目录
  4. chown -R mysql:mysql /data/mysql #设置MySQL数据库存放目录权限
  5. mkdir -p /usr/local/mysql #创建MySQL安装目录
  6. cd /usr/local/src #进入软件包存放目录
  7. tar zxvf mysql-5.6.33.tar.gz #解压
  8. cd mysql-5.6.33 #进入目录
  9. cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc #配置
  10. make #编译
  11. make install #安装
  12. rm -rf /etc/my.cnf #删除系统默认的配置文件(如果默认没有就不用删除)
  13. cd /usr/local/mysql #进入MySQL安装目录
  14. ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql #生成mysql系统数据库
  15. ln -s /usr/local/mysql/my.cnf /etc/my.cnf #添加到/etc目录的软连接
  16. cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld #把Mysql加入系统启动
  17. chmod 755 /etc/init.d/mysqld #增加执行权限
  18. chkconfig mysqld on #加入开机启动
  19. vi /etc/rc.d/init.d/mysqld #编辑
  20. basedir=/usr/local/mysql #MySQL程序安装路径
  21. datadir=/data/mysql #MySQl数据库存放目录
  1. service mysqld start #启动
  2. vi /etc/profile #把mysql服务加入系统环境变量:在最后添加下面这一行
  3. export PATH=$PATH:/usr/local/mysql/bin
  1. source /etc/profile #使配置立刻生效
  2. 下面这两行把myslq的库文件链接到系统默认的位置,这样你在编译类似PHP等软件时可以不用指定mysql的库文件地址。
  3. ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
  4. ln -s /usr/local/mysql/include/mysql /usr/include/mysql
  5. mkdir /var/lib/mysql #创建目录
  6. ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock #添加软链接
  7. mysql_secure_installation #设置Mysql密码,根据提示按Y 回车输入2次密码

二、安装Nginx

1、安装pcre

  1. cd /usr/local/src
  2. mkdir /usr/local/pcre
  3. tar zxvf pcre-8.39.tar.gz
  4. cd pcre-8.39
  5. ./configure --prefix=/usr/local/pcre
  6. make
  7. make install

2、安装openssl

  1. cd /usr/local/src
  2. mkdir /usr/local/openssl
  3. tar zxvf openssl-1.0.2j.tar.gz
  4. cd openssl-1.0.2j
  5. ./config --prefix=/usr/local/openssl
  6. make
  7. make install
  8. vi /etc/profile
  9. export PATH=$PATH:/usr/local/openssl/bin
  10. :wq!
  11. source /etc/profile

3、安装zlib

  1. cd /usr/local/src
  2. mkdir /usr/local/zlib
  3. tar zxvf zlib-1.2.8.tar.gz
  4. cd zlib-1.2.8
  5. ./configure --prefix=/usr/local/zlib
  6. make
  7. make install

4、安装Nginx

  1. groupadd www
  2. useradd -g www www -s /bin/false
  3. cd /usr/local/src
  4. tar zxvf nginx-1.10.1.tar.gz
  5. cd nginx-1.10.1
  6. ./configure --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/usr/local/src/openssl-1.0.2j --with-zlib=/usr/local/src/zlib-1.2.8 --with-pcre=/usr/local/src/pcre-8.39
  7. 注意:--with-openssl=/usr/local/src/openssl-1.0.2j --with-zlib=/usr/local/src/zlib-1.2.8 --with-pcre=/usr/local/src/pcre-8.39指向的是源码包解压的路径,而不是安装的路径,否则会报错
  8. make
  9. make install
  10. /usr/local/nginx/sbin/nginx #启动Nginx

设置nginx开机启动

  1. vi /etc/rc.d/init.d/nginx #编辑启动文件添加下面内容
  2. ############################################################
  3. #!/bin/sh
  4. #
  5. # nginx - this script starts and stops the nginx daemon
  6. #
  7. # chkconfig: - 85 15
  8. # description: Nginx is an HTTP(S) server, HTTP(S) reverse \
  9. # proxy and IMAP/POP3 proxy server
  10. # processname: nginx
  11. # config: /etc/nginx/nginx.conf
  12. # config: /usr/local/nginx/conf/nginx.conf
  13. # pidfile: /usr/local/nginx/logs/nginx.pid
  14. # Source function library.
  15. . /etc/rc.d/init.d/functions
  16. # Source networking configuration.
  17. . /etc/sysconfig/network
  18. # Check that networking is up.
  19. [ "$NETWORKING" = "no" ] && exit 0
  20. nginx="/usr/local/nginx/sbin/nginx"
  21. prog=$(basename $nginx)
  22. NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"
  23. [ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
  24. lockfile=/var/lock/subsys/nginx
  25. make_dirs() {
  26. # make required directories
  27. user=`$nginx -V 2>&1 | grep "configure arguments:" | sed 's/[^*]*--user=\([^ ]*\).*/\1/g' -`
  28. if [ -z "`grep $user /etc/passwd`" ]; then
  29. useradd -M -s /bin/nologin $user
  30. fi
  31. options=`$nginx -V 2>&1 | grep 'configure arguments:'`
  32. for opt in $options; do
  33. if [ `echo $opt | grep '.*-temp-path'` ]; then
  34. value=`echo $opt | cut -d "=" -f 2`
  35. if [ ! -d "$value" ]; then
  36. # echo "creating" $value
  37. mkdir -p $value && chown -R $user $value
  38. fi
  39. fi
  40. done
  41. }
  42. start() {
  43. [ -x $nginx ] || exit 5
  44. [ -f $NGINX_CONF_FILE ] || exit 6
  45. make_dirs
  46. echo -n $"Starting $prog: "
  47. daemon $nginx -c $NGINX_CONF_FILE
  48. retval=$?
  49. echo
  50. [ $retval -eq 0 ] && touch $lockfile
  51. return $retval
  52. }
  53. stop() {
  54. echo -n $"Stopping $prog: "
  55. killproc $prog -QUIT
  56. retval=$?
  57. echo
  58. [ $retval -eq 0 ] && rm -f $lockfile
  59. return $retval
  60. }
  61. restart() {
  62. #configtest || return $?
  63. stop
  64. sleep 1
  65. start
  66. }
  67. reload() {
  68. #configtest || return $?
  69. echo -n $"Reloading $prog: "
  70. killproc $nginx -HUP
  71. RETVAL=$?
  72. echo
  73. }
  74. force_reload() {
  75. restart
  76. }
  77. configtest() {
  78. $nginx -t -c $NGINX_CONF_FILE
  79. }
  80. rh_status() {
  81. status $prog
  82. }
  83. rh_status_q() {
  84. rh_status >/dev/null 2>&1
  85. }
  86. case "$1" in
  87. start)
  88. rh_status_q && exit 0
  89. $1
  90. ;;
  91. stop)
  92. rh_status_q || exit 0
  93. $1
  94. ;;
  95. restart|configtest)
  96. $1
  97. ;;
  98. reload)
  99. rh_status_q || exit 7
  100. $1
  101. ;;
  102. force-reload)
  103. force_reload
  104. ;;
  105. status)
  106. rh_status
  107. ;;
  108. condrestart|try-restart)
  109. rh_status_q || exit 0
  110. ;;
  111. *)
  112. echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
  113. exit 2
  114. esac
  115. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1. chmod 775 /etc/rc.d/init.d/nginx #赋予文件执行权限
  2. chkconfig nginx on #设置开机启动
  3. /etc/rc.d/init.d/nginx restart #重启

在浏览器中打开服务器IP地址,会看到下面的界面,说明Nginx安装成功。

三、安装php

1、安装yasm

  1. cd /usr/local/src
  2. tar zxvf yasm-1.3.0.tar.gz
  3. cd yasm-1.3.0
  4. ./configure
  5. make
  6. make install

2、安装libmcrypt

  1. cd /usr/local/src
  2. tar zxvf libmcrypt-2.5.8.tar.gz
  3. cd libmcrypt-2.5.8
  4. ./configure
  5. make
  6. make install

3、安装libvpx

cd /usr/local/src

tar xvf libvpx-1.6.0.tar.bz2

cd libvpx-1.6.0

./configure --prefix=/usr/local/libvpx --enable-shared --enable-vp9

make

make install

4、安装tiff

  1. cd /usr/local/src
  2. tar zxvf tiff-4.0.6.tar.gz
  3. cd tiff-4.0.6
  4. ./configure --prefix=/usr/local/tiff --enable-shared
  5. make
  6. make install

5、安装libpng

  1. cd /usr/local/src
  2. tar zxvf libpng-1.6.25.tar.gz
  3. cd libpng-1.6.25
  4. ./configure --prefix=/usr/local/libpng --enable-shared
  5. make
  6. make install

6、安装freetype

  1. cd /usr/local/src
  2. tar zxvf freetype-2.7.tar.gz
  3. cd freetype-2.7
  4. ./configure --prefix=/usr/local/freetype --enable-shared
  5. make #编译
  6. make install #安装

7、安装jpeg

  1. cd /usr/local/src
  2. tar zxvf jpegsrc.v9b.tar.gz
  3. cd jpeg-9b
  4. ./configure --prefix=/usr/local/jpeg --enable-shared
  5. make #编译
  6. make install #安装

8、安装libgd

  1. cd /usr/local/src
  2. tar zxvf libgd-2.1.1.tar.gz #解压
  3. cd libgd-2.1.1 #进入目录
  4. ./configure --prefix=/usr/local/libgd --enable-shared --with-jpeg=/usr/local/jpeg --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-fontconfig=/usr/local/freetype --with-xpm=/usr/ --with-tiff=/usr/local/tiff --with-vpx=/usr/local/libvpx/ #配置
  5. make #编译
  6. make install #安装
  7. 说明:如果libgd编译失败,可以先跳过,直接使用系统默认的2.1.0版本,在编译php的时候把参数--with-gd=/usr/local/libgd修改为--with-gd即可

9、安装t1lib

  1. cd /usr/local/src
  2. tar zxvf t1lib-5.1.2.tar.gz
  3. cd t1lib-5.1.2
  4. ./configure --prefix=/usr/local/t1lib --enable-shared
  5. make without_doc
  6. make install

10、安装php

注意:如果系统是64位,请执行以下两条命令,否则安装php会出错(32位系统不需要执行)

  1. \cp -frp /usr/lib64/libltdl.so* /usr/lib/
  2. \cp -frp /usr/lib64/libXpm.so* /usr/lib/
  3. cd /usr/local/src
  4. tar -zvxf php-5.6.26.tar.gz
  5. cd php-5.6.26
  6. export LD_LIBRARY_PATH=/usr/local/libgd/lib
  7. ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/usr/local/mysql --with-gd=/usr/local/libgd --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-xpm-dir=/usr/lib64 --with-vpx-dir=/usr/local/libvpx/ --with-zlib-dir=/usr/local/zlib --with-t1lib=/usr/local/t1lib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype #配置
  8. make #编译
  9. make install #安装

如果编译错误,可以清理后在编译一次

  1. make clean #清理
  2. make #编译
  3. cp php.ini-production /usr/local/php/etc/php.ini #复制php配置文件到安装目录
  4. rm -rf /etc/php.ini #删除系统自带配置文件
  5. ln -s /usr/local/php/etc/php.ini /etc/php.ini #添加软链接到 /etc目录
  6. cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf #拷贝模板文件为php-fpm配置文件
  7. ln -s /usr/local/php/etc/php-fpm.conf /etc/php-fpm.conf #添加软连接到 /etc目录
  8. vi /usr/local/php/etc/php-fpm.conf #编辑
  9. user = www #设置php-fpm运行账号为www
  10. group = www #设置php-fpm运行组为www
  11. pid = run/php-fpm.pid #取消前面的分号

设置 php-fpm开机启动

  1. cp /usr/local/src/php-5.6.26/sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm #拷贝php-fpm到启动目录
  2. chmod +x /etc/rc.d/init.d/php-fpm #添加执行权限
  3. chkconfig php-fpm on #设置开机启动
  4. vi /usr/local/php/etc/php.ini #编辑配置文件
  5. 找到:disable_functions =
  6. 修改为:disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname

#列出PHP可以禁用的函数,如果某些程序需要用到这个函数,可以删除,取消禁用。

  1. 找到:;date.timezone =
  2. 修改为:date.timezone = PRC #设置时区
  3. 找到:expose_php = On
  4. 修改为:expose_php = Off #禁止显示php版本的信息
  5. 找到:short_open_tag = Off
  6. 修改为:short_open_tag = ON #支持php短标签
  7. 找到opcache.enable=0
  8. 修改为opcache.enable=1 #php支持opcode缓存
  9. 找到:;opcache.enable_cli=1 #php支持opcode缓存
  10. 修改为:opcache.enable_cli=0
  11. 在最后一行添加:zend_extension=opcache.so #开启opcode缓存功能

配置nginx支持php

  1. vi /usr/local/nginx/conf/nginx.conf
  2. 修改/usr/local/nginx/conf/nginx.conf 配置文件,需做如下修改
  3. user www www; #首行user去掉注释,修改Nginx运行组为www www;必须与/usr/local/php/etc/php-fpm.conf中的user,group配置相同,否则php运行出错
  4. index index.html index.htm index.php; #添加index.php
  5. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  6. #
  7. location ~ \.php$ {
  8. root html;
  9. fastcgi_pass 127.0.0.1:9000;
  10. fastcgi_index index.php;
  11. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  12. include fastcgi_params;
  13. }

#取消FastCGI server部分location的注释,注意fastcgi_param行的参数,改为$document_root$fastcgi_script_name,或者使用绝对路径

  1. /etc/init.d/nginx restart #重启nginx
  2. service php-fpm start #启动php-fpm

测试:

  1. cd /usr/local/nginx/html/ #进入nginx默认网站根目录
  2. rm -rf /usr/local/nginx/html/* #删除默认测试页
  3. vi index.php #新建index.php文件
  4. <?php
  5. phpinfo();
  6. ?>
  1. chown www.www /usr/local/nginx/html/ -R #设置目录所有者
  2. chmod 700 /usr/local/nginx/html/ -R #设置目录权限

LNMP 部署的更多相关文章

  1. 分离式lnmp部署

    分离式lnmp简介 lnmp和lamp一样,是一种常用的web环境, 在实际环境中,lnmp中的三个服务常常为了更好的性能而分在三台主机上安装. 本篇内只介绍nginx和php-fpm+mysql分离 ...

  2. Docker Swarm应用--lnmp部署WordPress

    一.简介 目的:使用Docker Swarm 搭建lnmp来部署WordPress 使用Dockerfile构建nginx.php镜像 将构建的镜像上传docker私有仓库 使用volume做work ...

  3. Docker自学纪实(四)搭建LNMP部署wordpress

    我们在工作中最常用的就是LNMP网站平台 这个架构呢,是整个公司网站的核心 如果对于访问量较小的网站,可以直接在服务器上面部署 而如果是访问量很大的网站,那负载就是个很大的问题. 要么需要再买很多服务 ...

  4. 编译LNMP部署动态网站环境

    LNMP动态网站部署架构是由一套 Linux+Nginx+MySQL+PHP 组成的动态网站系统解决方案. 以下配置环境为:Linux=RHEL7 --> Nginx=1.13 --> M ...

  5. LNMP部署

    部署企业LNMP架构 源码包:nginx-* ; mysql-* ; php-* ; boost-* ; zend-loader-php5.6-linux-* ;yum软件: pcre-devel z ...

  6. 源码编译配置lnmp部署zabbix

    环境说明: [root@wcy ~]# cat /etc/redhat-release CentOS release 6.9 (Final) [root@wcy ~]# uname -a Linux ...

  7. 使用 Docker LNMP 部署 PHP 运行环境

    简介 Docker LNMP 是基于 Docker 的 PHP 集成开发环境. Github 地址:https://github.com/YanlongMa/docker-lnmp 包含软件 ngin ...

  8. lnmp部署知乎出现403

    查看错误日志: [root@web01 /]# tailf  /var/log/nginx/error.log 2019/01/16 19:02:06 [error] 10023#10023: *8 ...

  9. 基于LNMP部署DiscuzX

    [root@nginx~]# unzip ComsenzDiscuz-DiscuzX-master.zip[root@nginxDiscuzX]# mv upload/ /usr/local/ngin ...

随机推荐

  1. 关于representation的理解

    目前见过的定义的比较确切的是Yoshua Bengio在ACL2010的一篇paper中关于word representation的定义: " A word Representation i ...

  2. linux下python调用c模块

    在C调用Python模块时需要初始化Python解释器,导入模块等,但Python调用C模块却比较简单,下面还是以helloWorld.c 和 main.py 做一说明:   (1)编写C代码,hel ...

  3. Spark RDD aggregateByKey

    aggregateByKey 这个RDD有点繁琐,整理一下使用示例,供参考 直接上代码 import org.apache.spark.rdd.RDD import org.apache.spark. ...

  4. Noip2016提高组 玩具谜题toy

    Day 1 T1 题目大意 一些naive的玩具小人把小南的眼镜藏起来,但小南有一份too simple的小纸条,告诉小南眼镜在第一个小人往哪数第几个的往哪数的第几个的往哪数第几个的往哪数的第几个的往 ...

  5. Oracle以及SDE维护常用命令-查看表空间等

    之前现场反馈一个数据更新的问题,查看感觉是因为表空间满了导致的(错误在之前的博客随笔中写过),因此远程对服务器进行查看.个人平常都是通过Oracle客户端的Entreprise Manager Con ...

  6. 今天发现之前瑞乐做的登录和注册居然都是用的get请求,瞬间出了一身冷汗.

    今天发现之前瑞乐做的登录和注册居然都是用的get请求,瞬间出了一身冷汗. 然后迅速的让晓勇改成post请求了. 不然我觉得凡是有点抓包能力的人抓到我们登录和注册这么涉及安全的东西居然用的是get请求, ...

  7. RTMP协议中文翻译(首发)(转)

    Adobe公司的实时消息传输协议 摘要 此备忘录描述了 Adobe公司的实时消息传输协议(RTMP),此协议从属于应用层,被设计用来在适合的传输协议(如TCP)上复用和打包多媒体传输流(如音频.视频和 ...

  8. Scala学习笔记一

    首先是安装Scala 下载Scala进行安装 http://www.scala-lang.org/ 安装好scala后,为scala配置系统环境参数 新建环境变量SCALA_HOME,值为scala安 ...

  9. 危险的“我以为”DDoS&丑陋的现实

    有些话题可能终其一生你也可以假装不知道就好了,比如全球气候在变暖,不过有些话题确是不得不面对的冰冷现实,在互联网日益发达的当下,比如你不得不面对的DDoS攻击. DDoS代表了分布式拒绝服务,通过许多 ...

  10. Git入门仅这篇就够了

    版权声明:本文为博主原创文章,未经博主允许不得转载. 转载请表明出处:http://www.cnblogs.com/cavalier-/p/5978937.html 前言 大家好,我是Cavalier ...