mg4377娱乐娱城官网_mg4377娱乐手机版_www.mg4377.com

mg4377娱乐娱城官网:CentOS下LNMP架构及应用,5下利

时间:2019-07-28 07:43来源:mg4377娱乐娱城官网
出于各大网盘,有的也初叶限制速度,文件的安全也未尝保持。所以还比不上自身搭建三个网盘。互连网看了下,发掘有二个Nextcloud比较好用。帮助多平台湾游客户端,援救共享,使用

出于各大网盘,有的也初叶限制速度,文件的安全也未尝保持。所以还比不上自身搭建三个网盘。互连网看了下,发掘有二个Nextcloud比较好用。帮助多平台湾游客户端,援救共享,使用操作简捷。辅助插件扩张,文件预览,在线同盟。那就试试自个儿在CentOS 6.5情状下使用LNMP框架结构安装nextcloud私人云盘吧。

CentOS 7.3安装LNMP

策动干活

cd/usr/local/src``wgethttp://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz``wgethttp://cn2.php.net/distributions/php-5.6.30.tar.gz``wgethttp://nginx.org/download/nginx-1.12.1.tar.gz``tarzxfmysql-5.6.35-linux-glibc2.5-x86_64.tar.gz``tarzxfphp-5.6.30.tar.gz``tarzxfnginx-1.12.1.tar.gz

软件安装

MySQL

mvmysql-5.6.35-linux-glibc2.5-x86_64/usr/local/mysql``cd../mysql/``useraddmysql``mkdir/data/``yuminstall-yperlperl-Data-Dumperlibaiolibaio-devel``./scripts/mysql_install_db--user=mysql--datadir=/data/mysql``cpsupport-files/my-default.cnf/etc/my.cnf``cpsupport-files/mysql.server/etc/init.d/mysqld``vi/etc/init.d/mysqld````basedir=/usr/local/mysql````datadir=/data/mysql``chkconfig--addmysqld``servicemysqldstart

PHP

useradd-s/sbin/nologinphp-fpm``cd/usr/local/src/php-5.6.30``wgethttp://vault.centos.org/5.7/os/x86_64/CentOS/kernel-headers-2.6.18-274.el5.x86_64.rpm``rpm-ivhkernel-headers-2.6.18-274.el5.x86_64.rpm``yuminstall-ygcclibxml2-developenssl-develbzip2-devellibjpeg-turbo-devellibpng-develfreetype-devellibmcrypt-devellibcurl-devel``./configure--prefix=/usr/local/php-fpm--with-config-file-path=/usr/local/php-fpm/etc--enable-fpm--with-fpm-user=php-fpm--with-fpm-group=php-fpm--with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config--with-pdo-mysql=/usr/local/mysql--with-mysql-sock=/tmp/mysql.sock--with-libxml-dir--with-gd--with-jpeg-dir--with-png-dir--with-freetype-dir--with-iconv-dir--with-zlib-dir--with-mcrypt--enable-soap--enable-gd-native-ttf--enable-ftp--enable-mbstring--enable-exif--with-pear--with-curl--with-openssl``make&&makeinstall``cpphp.ini-production/usr/local/php-fpm/etc/php.ini``cp/usr/local/src/php-5.6.30/sapi/fpm/init.d.php-fpm/etc/init.d/php-fpm``vi/usr/local/php-fpm/etc/php-fpm.conf````[global]````pid=/usr/local/php-fpm/var/run/php-fpm.pid````error_log=/usr/local/php-fpm/var/log/php-fpm.log````[www]````listen=/tmp/php-fcgi.sock````listen.mode=666````user=php-fpm````group=php-fpm````pm=dynamic````pm.max_children=50````pm.start_servers=20````pm.min_spare_servers=5````pm.max_spare_servers=35````pm.max_requests=500````rlimit_files=1024``chmod755/etc/init.d/php-fpm``chkconfig--addphp-fpm``chkconfigphp-fpmon``servicephp-fpmstart

Nginx

cd/usr/local/src/nginx-1.12.1``./configure--prefix=/usr/local/nginx``make&&makeinstall``vi/etc/init.d/nginx````#!/bin/bash````#chkconfig:-3021````#description:httpservice.````#SourceFunctionLibrary````./etc/init.d/functions````#NginxSettings````NGINX_SBIN="/usr/local/nginx/sbin/nginx"````NGINX_CONF="/usr/local/nginx/conf/nginx.conf"````NGINX_PID="/usr/local/nginx/logs/nginx.pid"````RETVAL=0````prog="Nginx"````start()````{````echo-n$"Starting$prog:"````mkdir-p/dev/shm/nginx_temp````daemon$NGINX_SBIN-c$NGINX_CONF````RETVAL=$?````echo````return$RETVAL````}````stop()````{````echo-n$"Stopping$prog:"````killproc-p$NGINX_PID$NGINX_SBIN-TERM````rm-rf/dev/shm/nginx_temp````RETVAL=$?````echo````return$RETVAL````}````reload()````{````echo-n$"Reloading$prog:"````killproc-p$NGINX_PID$NGINX_SBIN-HUP````RETVAL=$?````echo````return$RETVAL````}````restart()````{````stop````start````}````configtest()````{````$NGINX_SBIN-c$NGINX_CONF-t````return0````}````case"$1"in````start)````start````;;````stop)````stop````;;````reload)````reload````;;````restart)````restart````;;````configtest)````configtest````;;````*)````echo$"Usage:$0{start|stop|reload|restart|configtest}"````RETVAL=1````esac````exit$RETVAL``chmod755/etc/init.d/nginx``chkconfig--addnginx``chkconfignginxon``cd/usr/local/nginx/conf/;mvnginx.confnginx.conf.bak``vinginx.conf````usernobodynobody;````worker_processes2;````error_log/usr/local/nginx/logs/nginx_error.logcrit;````pid/usr/local/nginx/logs/nginx.pid;````worker_rlimit_nofile51200;````events````{````useepoll;````worker_connections6000;````}````http````{````includemime.types;````default_typeapplication/octet-stream;````server_names_hash_bucket_size3526;````server_names_hash_max_size4096;````log_formatcombined_realip'$remote_addr$http_x_forwarded_for[$time_local]'````'$host"$request_uri"$status'````'"$http_referer""$http_user_agent"';````sendfileon;````tcp_nopushon;````keepalive_timeout30;````client_header_timeout3m;````client_body_timeout3m;````send_timeout3m;````connection_pool_size256;````client_header_buffer_size1k;````large_client_header_buffers84k;````request_pool_size4k;````output_buffers432k;````postpone_output1460;````client_max_body_size10m;````client_body_buffer_size256k;````client_body_temp_path/usr/local/nginx/client_body_temp;````proxy_temp_path/usr/local/nginx/proxy_temp;````fastcgi_temp_path/usr/local/nginx/fastcgi_temp;````fastcgi_intercept_errorson;````tcp_nodelayon;````gzipon;````gzip_min_length1k;````gzip_buffers48k;````gzip_comp_level5;````gzip_http_version1.1;````gzip_typestext/plainapplication/x-javascripttext/csstext/htm````application/xml;````server````{````listen80;````server_namelocalhost;````indexindex.htmlindex.htmindex.php;````root/usr/local/nginx/html;````location~.php$````{````includefastcgi_params;````fastcgi_passunix:/tmp/php-fcgi.sock;````fastcgi_indexindex.php;````fastcgi_paramSCRIPT_FILENAME/usr/local/nginx/html$fastcgi_script_name;````}````}````}``/etc/init.d/nginxstart

功能测量检验

vi/usr/local/nginx/html/1.php````<?php````echo"test";````?>

mg4377娱乐娱城官网 1

7.3安装LNMP 计划专门的职业 cd/usr/local/src wget wget....

CentOS下LNMP架构及应用

mg4377娱乐娱城官网 2

LNMP代表的便是:Linux系统下Nginx MySQL PHP这种网址服务器架设。

Linux是一类UnixComputer操作系统的统称,是时下最盛行的无偿操作系统。

Nginx是一个高品质的HTTP和反向代理服务器,也是二个IMAP/POP3/SMTP代理服务器。

mg4377娱乐娱城官网:CentOS下LNMP架构及应用,5下利用LNMP架构安装Nextcloud私人云盘。有以下优势:

作为web服务器,nginx处理静态文件、索引文件,自动索引的频率异常高;

用作代理服务器,nginx能够兑现无缓存的反向代理加速,进步网址的运作速度;

作为负载均衡服务器,nginx不仅可以够在里头一贯协助Rails和PHP,也足以协助HTTP代理服务器对外开始展览劳动,同不平日间还援救轻便的容错和行使算法进行负荷均衡;

在性能上,占用相当少的财富,能支持更加多的产出连接,达到越来越高的拜望效用;

在效能上,nginx是美观的代理服务器和负载均衡服务器;

设置配备上,nginx安装简便、配置灵活;

个性方面,nginx是特地为品质优化而开拓的,特别重申效用。它选用Poll模型,能够支持越来越多的面世连接,最大能够支撑对四千0个并发连接数的形影,何况只占用十分的低的内部存储器财富;

高可用性,nginx扶助热安排,运转速度特别高效,能够在不间断服务的事态下,对软件版本只怕安顿实行进级换代,及时周转数月也不须要再一次开动,差不离能够形成7*24体现不间断运维

Mysql是二个小型关系型数据库管理种类。PHP是一种在服务器端试行的嵌入HTML文书档案的脚本语言。

那五种软件均为无需付费开源软件,组合到一同,成为一个免费、高效、扩充性强的网址服务体系。

1.Nginx的安装及基本的利用布署

nginx.org 官网

tarzxf nginx-1.4.2.tar.gznginx-1.4.2/src/corevinginx.h#define NGINX_VER "nginx/" NGINX_VERSION //NGINX_VESportageSION展现版本,能够去掉,防止骇客恶意抨击

#nginx-1.4.2/auto/cc#vi gcc# debug#CFLAGS="$CFLAGS -g" //关闭debug调试

#./configure --prefix=/usr/local/lnmp/nginx --with-http_ssl_module --withhttp_stub_status_module//编写翻译,启用https加密 和nginx 的 NginxStatus 功效,//用来监督 Nginx 的此时此刻情景。

#make && make install

#cd /usr/local/lnmp/nginx/sbin#ln -s /usr/local/lnmp/nginx/sbin/nginx /usr/local/sbin/ //将nginx命令参加遭受变量#useradd -M -s /sbin/nologin nginx

#vim conf/nginx.confuser nginx nginx;worker_processes 2;events {use epoll;//优化nginxworker_connections 1024;}http {//打开日志效率log_format main'$remote_addr - $remote_user [$time_local]"$request" ''$status $body_bytes_sent "$http_referer"''"$http_user_agent""$http_x_forwarded_for"';server {location/status{stub_status on;access_log off;}}}

Nginx援救如下管理连接的措施(I/O复用方法),那一个主意能够透过use指令内定。

  • select-标准方法。借使当前平台未有更实用的办法,它是编写翻译时暗中同意的点子。你可以使用布署参数--with-select_module和--without-select_module来启用或剥夺这么些模块。

  • poll-标准方法。假如当前平台未有更管用的格局,它是编译时私下认可的方法。你能够使用布署参数--with-poll_module和--without-poll_module来启用或剥夺那些模块。

  • kqueue-高效的章程,使用于FreeBSD 4.1 , OpenBSD 2.9 , NetBSD 2.0和MacOS X.使用双管理器的MacOSX系统使用kqueue也许会导致基本崩溃。

  • epoll-高效的法子,使用于Linux内核2.6版本及之后的系列。在一些发行版本中,如SuSE8.2,有让2.4版本的水源援救epoll的补丁。

nginx -t //检测语法

nginx //启动nginx

nginx -s reload //重新加载nginx

nginx -s stop //关闭nginx

nginx完毕设想主机

vinginx.confhttp {server {listen 80;server_name www.tjf.com;location / {root/html/tjf;index index.html index.htm;}}server {listen 80;server_name www.ty.com;location / {root/html/ty;index index.html index.htm;}}}

[[email protected] conf]# mkdir /html[[email protected] conf]# mkdir /html/tjf[[email protected] conf]# mkdir /html/ty[[email protected] conf]# echo "tjf" >/html/tjf/index.html[[email protected] conf]# echo "ty" >/html/ty/index.html[[email protected] conf]# nginx -s reload

在/etc/hosts中步入深入分析,浏览器访问域名就足以兑现设想主机

nginx负载均衡:

#vi nginx.confupstream ty {//ty只是二个名字,能够随意server 192.168.0.25:8080 weight=3;//weight设置该服务器每趟被访谈的次数server 192.168.0.26:8080;}//加在http{}中

想让这一个server达成负载均衡,就修改其server{}内的口舌

server {listen 80;server_name www.ty.org;# access_log logs/ty.org.access.log main;location / {proxy_pass

nginx的session保持:

使用nginx sticky模块完毕基于cookie的负载均衡

即五个ip一次始终就拜会三个tomcat服务器,(当用户注册账户时,第贰个注册页注册成功,实行下一步时即切换页面,不会切到另一台tomcat服务器),其余贰个ip访问下一台tomcat服务器

#nginx -s stop //给nginx加多模块徐重新编译,先stop#tar zxf nginx-sticky-module-1.1.tar.gz#cd nginx-1.4.2#make clean

#./configure --prefix=/usr/local/lnmp/nginx --with-http_ssl_module--with-http_stub_status_module--add-module=/root/nginx-sticky-module-1.1#make && make install

#vim /usr/local/lnmp/nginx/conf/nginx.conf //配置文件中投入sticky模块upstream ty {sticky;server 192.168.1.25:8080;server 192.168.1.26:8080;}

#nginx //运维nginx,就足以窥见叁个ip每一回在使得时间内平昔访谈一台tomcat服务器

https加密web访问

cd/etc/pki/tls/certsmakecert.pem//密钥和密文均在此文件cpcert.pem/usr/local/lnmp/nginx/conf

vim nginx.conf//将HTTPSserver段打开,即去掉#ssl_certificate cert.pem;ssl_certificate_key cert.pem;

nginx -t

nginx -s reload

访谈浏览器

mg4377娱乐娱城官网 3
收获证书

mg4377娱乐娱城官网 4
2.Mysql的源码安装

mysql-5.5.12.tar.gz

#yum install cmake make gcc gcc-c

#tar zxf mysql-5.5.12.tar.gz

#cd mysql-5.5.

1234567#cmake-DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql #安装目录>-DMYSQL_DATADIR=/usr/local/lnmp/mysql/data#数据库贮存目录>-DMYSQL_UNIX_ADDR=/usr/local/lnmp/mysql/data/mysql.sock #Unixsocket 文件路线>-DWITH_MYISAM_STORAGE_ENGINE=1 #安装 myisam 存款和储蓄引擎>-DDEFAULT_CHARSET=utf8 #使用utf8 字符>-DDEFAULT_COLLATION=utf8_general_ci #校验字符>-DEXTRA_CHARSETS=all#安装具备扩展字符集

mg4377娱乐娱城官网 5

并发此难点依照提醒知道须求安装yuminstall ncurses-devel,安装完后剔除缓存文件CMakeCache.txt,重新推行编写翻译

make&&makeinstalluseradd-M -s/sbin/nologinmysqlcd/usr/local/lnmp/mysqlcdscripts/

./mysql_install_db--user=mysql--basedir=/usr/local/lnmp/mysql/--datadir=/usr/local/lnmp/mysql/data///能够使用./mysql_install_db--help查看参数音信

chown-R root.mysql/usr/local/lnmp/mysql/*chown-R mysql data/

cpsupport-files/my-medium.cnf/etc/my.cnf//配置文件cpmysql.server/etc/init.d/mysqld//运行脚本service mysqld start

#vi /root/.bash_profile

PATH=$PATH:$HOME/bin:/usr/local/lnmp/mysql/bin

// //今后直接运用mysql等一声令下,可能无法施行,必要配备意况变量,查找源码编写翻译后的mysql命令路线为/usr/local/lnmp/mysql/bin,将其投入该公文PATH后,以分局相隔,即

#source .bash_profile //使其收效

3.php的源码安装

gd是一个用于生成图片的库
libiconv用于落到实处贰个字符编码到另一个字符编码的转移
mhash是叁个哈稀演函数库,它能够援助七种哈稀演算法,如MD5、SHA1
libmcrypt能够使php扶助越来越多加密算法

tarzxf libiconv-1.13.1.tar.gz#提升系统对协助字符编码转换的功能cdlibiconv-1.13.1./configure--prefix=/usr/local/lnmp/modules/libiconvmake&&makeinstall

tarjxf libmcrypt-2.5.8.tar.bz2# mcrypt mhash 是 php 加密算法扩张库cdlibmcrypt-2.5.8./configure--prefix=/usr/local/lnmp/modules/libmcryptmake&&makeinstall

cdlibltdl/./configure--prefix=/usr/local/lnmp/modules/libmcrypt/libltdl--enable-ltdl-installmake&&makeinstall

tarjxf mhash-0.9.9.9.tar.bz2cdmhash-0.9.9.9./configure--prefix=/usr/local/lnmp/modules/mhashmake&&makeinstall

tarzxf mcrypt-2.6.8.tar.gzcdmcrypt-2.6.8./configure--prefix=/user/local/lnmp/modules/mcrypt--with-libmcrypt-prefix=/user/local/lnmp/modules/libmcrypt

mg4377娱乐娱城官网 6

此处会报错如上,供给如下操作:

1234#vi /etc/ld.so.confinclude ld.so.conf.d/*.conf/usr/local/lnmp/modules/libmcrypt/lib#ldconfig

重复编写翻译会报mhash错误,如下

mg4377娱乐娱城官网 7

需操作

vi/etc/ld.so.conf 加多如下一条/usr/local/lnmp/modules/mhash/libln-s/usr/local/lnmp/modules/mhash/lib/*/usr/local/libln-s/usr/local/lnmp/modules/mhash/include/*/usr/loca/includeldconfig

再另行编写翻译则OK

#make && make install

Php软件包信赖性:

yum install net-snmp-devel curl-devellibxml2-devel libpng-devel libjpeg-devel freetype-

devel gmp-devel

tarjxf php-5.4.12.tar.bz2cdphp-5.4.12./configure--prefix=/usr/local/lnmp/php--with-config-file-path=/usr/local/lnmp/php/etc--with-mysql=/usr/local/lnmp/mysql--with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir--with-png-dir--with-jpeg-dir--with-freetype-dir--with-pear --with-gettext --with-gmp --enable-inline-optimization --enable-soap --enable-ftp--enable-sockets --enable-mbstring --with-mysqli=/usr/local/lnmp/mysql/bin/mysql_config--enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-mcrypt=/usr/local/lnmp/modules/libmcrypt--with-mhash

mg4377娱乐娱城官网 8

#make ZEND_EXTRA_LIBS='-liconv' #ZEND 加快php实施,手工业钦赐将iconv加到php额外库中,#貌似的话那个库的加码php能够活动完毕,不过iconv要求手工业操作参加

#vi /etc/ld.so.confusr/local/lnmp/modules/libiconv/lib#ln -s/usr/local/lnmp/modules/libiconv/lib/* /usr/local/lib#ldconfig

#make install

#cd /usr/local/lnmp/php/etc

#cp php-fpm.conf.default php-fpm.conf#vi php-fpm.conf;pid = run/php-fpm.pid//去掉前边的批注

#cd php-5.4.12#cp php.ini-production /usr/local/lnmp/php/etc/php.ini #顺应php生产条件下的配备文件#vi /usr/local/php/etc/php.inicgi.fix_pathinfo=0#防护Nginx 文件类型错误剖析漏洞date.timezone = Asia/Shanghai#安装时区

#cd sapi/fpm/#cp init.d.php-fpm /etc/init.d/fpm //fpm运维脚本,暗中同意端口为8000#chmod x /etc/init.d/fpm#/etc/init.d/fpm start

今后就足以布置nginx访问php测验页如下:

vi/usr/local/lnmp/nginx/conf/nginx.confserver {location / {root html;index index.phpindex.html index.htm;//记得要加多index.php}location ~ .php$ {root html;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;include fastcgi.conf;}}

#cat html/index.php

<?php

phpinfo()

?>

#nginx -s reload //浏览器访问ip/index.php看到php测量试验页则成功

mg4377娱乐娱城官网 9
前段时间LNMP架构已经搭建完结,接下去在lnmp架构上搭建一个bbs网址:

软件下载地址

1.上传upload目录中的文件到服务器

2.设置目录属性(windows服务器可忽略这一步)

以下那些目录需求可读写权限

./config

./data含子目录

3.进行安装脚本/install/

请在浏览器中运营install程序,即访谈

  1. 参谋页面指示,实行设置,直至安装完结

设置完后如下

mg4377娱乐娱城官网 10

汤姆cat动态页面:

Tomcat 服务器是三个免费的怒放源代码的动态Web 应用服务器,属于轻量级应用服务器,在中型Mini型系统和出现访问用户不是众多的场地下被附近运用,是付出和调整JSP 程序的首推

tomcat也正是jsp的解释器,首要用以动态页面,nignx适用于web静态页面

安装tomcat要求求安装jdk

安装jdk-6u32-linux-x64.bin

sh jdk-6u32-linux-x64.bin

mv jdk1.6.0_32/ /usr/local/jdk //移动到内定目录

vim/etc/profile//设置java全局变量exportJAVA_HOME=/usr/local/jdkexportCLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib//指定java库目录exportPATH=$PATH:$JAVA_HOME/bin

source /etc/profile //使其登时生效

tar zxf apache-tomcat-7.0.42.tar.gz -C/usr/local/lnmp/

cd/usr/local/lnmp/apache-tomcat-7.0.42/bin

./startup.sh //tomcat私下认可打起始口为8080

浏览器访谈192.168.1.25:8080就足以看出tomcat网页

mg4377娱乐娱城官网 11

老是访谈都得加上:8080,若不想加能够修改nginx.conf

location ~ .jsp$ {

proxy_pass ;

}

如此那般就足以不用加:8080端口访谈192.168.1.25/index.jsp,未来jsp动态网页是经过nginx访谈

mg4377娱乐娱城官网 12

因为nginx未来不帮助图片功用,所以访谈时不可能健康展现图片,此时亟待在ngix.conf投入一下字段:

location ~.(png|gif|css|jsp|js)${

root/usr/local/lnmp/tomcat/webapps/ROOT;

}

再次访谈就可以出现图片

测量试验页内容Thissystem's time is <%=new java.util.Date() %>

行使nginx实现tomcat动态页面包车型的士载荷均衡

vi nginx.conf

http {

upstream ty {

server 192.168.1.25:8080; //25、26主机上都兼备tomcat

server 192.168.1.26:8080;

}

}

server {

location ~ .jsp$ {

proxy_pass ;

}

}

布置好各服务器的jsp动态网页文件

nginx -s reload

今日就能够访问实现负载均衡了


Memcached

是贰个高质量的遍及式的内部存款和储蓄器对象缓存系统,通过在内部存款和储蓄器里维护八个合併的宏大的hash表,它亦可用来积攒种种格式的数额,包含图像、摄像、文件以及数据库检索的结果等。一句话来讲正是将数据调用到内部存款和储蓄器中,然后从内部存储器中读取,进而大大升高读取速度。

memcache为php的三个模块,使php能够利用内部存款和储蓄器存款和储蓄,加载到内部存款和储蓄器进步访问速度

enterprise6的Package里提够memcached

RPM包安装

yum install memcached

/etc/init.d/memcached start

mg4377娱乐娱城官网 13
mg4377娱乐娱城官网 14

telnet localhost 11211 //测验memcached是否中标开采

stats查看景况

set设置

add添加

get查看delete删除

mg4377娱乐娱城官网 15

tomcat负载均衡的session调节

(正在访谈的服务器宕机,直接切换至另台server,上次作客的笔录仍可用)

session:

mg4377娱乐娱城官网 16时有时无存款和储蓄memcache

汤姆cat-1 (T1)将session存款和储蓄在memcached-2(T2)上。唯有当M2不可用时,T1才将session存

储在memcached-1上(M1是T1 failoverNode)。使用这种布局的平价是,当T1和M1同期崩

溃时也不会舍弃session会话,防止单点故障。

官网

首先A、B已经为tomcat负载均衡:

A:

1、

asm-3.2.jar minlog-1.2.jar

kryo-1.04.jar msm-kryo-serializer-1.6.5.jar

kryo-serializers-0.10.jar reflectasm-1.01.jar

memcached-session-manager-1.6.3.jar spymemcached-2.7.3.jar

memcached-session-manager-tc7-1.6.3.jar //tc7对应tomcat的版本7

//将.jar包放至tomcat/lib目录,一定细心包的本子

2、

vim/tomcat/conf/context.xml<ManagerclassName="de.javakaffee.web.msm.MemcachedBackupSessionManager"memcachedNodes="n1:192.168.1.25:11211,n2:192.168.1.26:11211"failoverNodes="n1"requestUriIgnorePattern=".*.(ico|png|gif|jpg|css|js)$"transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"/>

3、

cd/tomcat/webapps/ROOTvitest.jsp//创立测量试验页<%@ page contentType="text/html;charset=GBK"%><%@ pageimport="java.util.*"%><html><head><title>ClusterApp Test</title></head><body>Server Info:<%out.println(request.getLocalAddr() " : " request.getLocalPort() "<br>");%><%out.println("<br> ID " session.getId() "<br>");String dataName =request.getParameter("dataName");if(dataName != null &&dataName.length() > 0) {String dataValue =request.getParameter("dataValue");session.setAttribute(dataName,dataValue);}out.print("<b>Sessionlist</b>");Enumeration e =session.getAttributeNames();while(e.hasMoreElements()) {String name =(String)e.nextElement();String value =session.getAttribute(name).toString();out.println( name " = " value "<br>");System.out.println( name " =" value);}%><form action="test.jsp"method="POST">name:<inputtype=text size=20name="dataName"><br>key:<inputtype=text size=20name="dataValue"><br><inputtype=submit></form></body></html>

4、

/etc/init.d/memcachedstart/tomcat/bin/./shutdown.sh/tomcat/bin/./startup.sh//重启tomcat

tail-f/tomcat/logs/catalina.out//查看日志,如开始化finished,则成功INFO: MemcachedSessionServicefinished initialization……

B:中1、3、4步骤同样,2配置的内容有一点有改观

<ManagerclassName="de.javakaffee.web.msm.MemcachedBackupSessionManager"memcachedNodes="n1:192.168.1.25:11211,n2:192.168.1.26:11211"failoverNodes="n2"requestUriIgnorePattern=".*.(ico|png|gif|jpg|css|js)$"transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"/>

LNMP代表的便是:Linux系统下Nginx MySQL PHP这种网址服务器架设。 Linux是一类Unix计算机操作系统的统称,是前段时间最风靡的...

1.安装nginx

wget

tar -zxf nginx-1.10.3.tar.gz && cd nginx-1.10.3

./configure --prefix=/usr/local/data/nginx --user=nginx --group=nginx --with-pcre --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module

make && make install

2.装置配备php

yum install

yum --enablerepo=remi-php56 install php php-fpm php-mysql php-gd php-xml php-redis php-libs php-devel php-zlib php-mbstring

nginx 和php-fpm 的周转用户这里运用nginx

vim /etc/php-fpm.conf

user = nginx

group = nginx

listen = 127.0.0.1:9000

env[HOSTNAME] = $HOSTNAME

env[PATH] = /usr/local/bin:/usr/bin:/bin

env[TMP] = /tmp

env[TMPDIR] = /tmp

env[TEMP] = /tmp

3.安装mysql

yum -y install mysql mysql-server

service mysqld start

4.建库,授权

CREATE DATABASE nextcloud_db;GRANT ALL ON nextcloud_db.* TO 'nextcloud'@'%' IDENTIFIED BY 'nextcloud'; //注意一定要加 "%",不然不恐怕让网络让任哪个人上传文件

FLUSH PRIVILEGES;

5.安装nextcloud

wget --no-check-certificate

unzip nextcloud-10.0.2.zip

mv nextcloud /usr/local/data/nginx/html

/usr/local/data/nginx/html

chown -R nginx.nginx

创制数量目录,这里建议数据目录不要和web目录放到一齐

/usr/local/data/nginx/html/nextcloud/data

6.申请证书

为了网盘的平安,有至关重要接纳https 证书,这里能够在Ali云后台申请无偿的DV证书

7.配置nginx

成立虚构主机文件

cd /usr/local/data/nginx/conf

vim nextcloud.conf

编辑:mg4377娱乐娱城官网 本文来源:mg4377娱乐娱城官网:CentOS下LNMP架构及应用,5下利

关键词: