Centos7环境搭建安装jdk、tomcat、nginx、redis、fastDFS

centos7安装jdk,tomcat,nginx,redis,fastDFS的步骤

1.linux安装jdk

1.1安装配置:

cd /usr

rz tar -zxvf jdk-8u73-linux-x64.tar.gz

mv jdk1.8.0_73 jdk8

1、 全局配置 vi /etc/profile

export JAVA_HOME=/usr/jdk8

export JAVA_BIN=/usr/jdk8/bin

export PATH=$PATH:$JAVA_HOME/bin

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export JAVA_HOME JAVA_BIN PATH CLASSPATH

立即生效,执行

source /etc/profile

1.2、重启测试

java -version

屏幕输出:

[root@localhost usr]# java -version

openjdk version "1.8.0_131"

OpenJDK Runtime Environment (build 1.8.0_131-b12)

OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)

2.linux安装tomcat

2.1安装配置:

cd /usr/local

rz

tar -zxvf apache-tomcat-8.0.33.tar.gz

mv apache-tomcat-8.0.33 tomcat

cd /tomcat/bin

2.2 启动tomcat:

[root@localhost bin]# ./startup.sh

Using CATALINA_BASE: /usr/local/tomcat

Using CATALINA_HOME: /usr/local/tomcat

Using CATALINA_TMPDIR: /usr/local/tomcat/temp

Using JRE_HOME: /usr/jdk8

Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

Tomcat started.

[root@localhost bin]# ./shutdown.sh

Using CATALINA_BASE: /usr/local/tomcat

Using CATALINA_HOME: /usr/local/tomcat

Using CATALINA_TMPDIR: /usr/local/tomcat/temp

Using JRE_HOME: /usr/jdk8

Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

3.linux安装redis

3.1安装配置

cd /usr/local

rz

tar redis-4.0.9.tar.gz

cd redis-4.0.9 make

cd src make install

CC redis-cli.o

LINK redis-cli

CC redis-benchmark.o

LINK redis-benchmark

INSTALL redis-check-rdb

INSTALL redis-check-aof

Hint: It's a good idea to run 'make test' ;)

make[1]: 离开目录“/usr/local/redis-4.0.9/src”

[root@localhost redis-4.0.9]# cd src/

[root@localhost src]# make install

CC Makefile.dep

Hint: It's a good idea to run 'make test' ;)

INSTALL install

INSTALL install

INSTALL install

INSTALL install

INSTALL install

[root@localhost src]#

配置修改:

3.2启动redis

[root@localhost src]# ./redis-server /usr/local/redis/redis.conf

9125:C 25 Apr 17:50:28.770 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

9125:C 25 Apr 17:50:28.770 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=9125, just started

9125:C 25 Apr 17:50:28.770 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf

9125:M 25 Apr 17:50:28.771 * Increased maximum number of open files to 10032 (it was originally set to 1024).

_._

_.-``__ ''-._

_.-`` `. `_. ''-._ Redis 4.0.9 (00000000/0) 64 bit

.-`` .-```. ```\/ _.,_ ''-._

( ' , .-` | `, ) Running in standalone mode

|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379

| `-._ `._ / _.-' | PID: 9125

`-._ `-._ `-./ _.-' _.-'

|`-._`-._ `-.__.-' _.-'_.-'|

| `-._`-._ _.-'_.-' | http://redis.io

`-._ `-._`-.__.-'_.-' _.-'

|`-._`-._ `-.__.-' _.-'_.-'|

| `-._`-._ _.-'_.-' |

`-._ `-._`-.__.-'_.-' _.-'

`-._ `-.__.-' _.-'

`-._ _.-'

`-.__.-'

9125:M 25 Apr 17:50:28.771 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

9125:M 25 Apr 17:50:28.771 # Server initialized

9125:M 25 Apr 17:50:28.771 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

9125:M 25 Apr 17:50:28.771 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.

9125:M 25 Apr 17:50:28.771 * Ready to accept connections

3.3启动redis客户端测试:

[root@bogon bin]# redis-cli

127.0.0.1:6379> set key "value"

OK

127.0.0.1:6379> get key

"value"

127.0.0.1:6379> exit

[root@bogon bin]# netstat -tunpl|grep 6379

tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 9125/./redis-server

tcp6 0 0 :::6379 :::* LISTEN 9125/./redis-server

3.4关闭客户端

[root@bogon bin]# redis-cli shutdown

[root@bogon bin]# netstat -tunpl|grep 6379

3.5关闭服务器

[root@localhost bin]# ps -ef |grep redis

root 9644 9310 0 18:21 pts/0 00:00:00 redis-server *:6379

root 9675 4170 0 18:23 pts/1 00:00:00 grep --color=auto redis

[root@localhost bin]# netstat -tunpl |grep 6379

tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 9644/redis-server *

tcp6 0 0 :::6379 :::* LISTEN 9644/redis-server *

[root@localhost bin]# redis-cli

127.0.0.1:6379>

127.0.0.1:6379>

127.0.0.1:6379> exit

[root@localhost bin]# netstat -tunpl |grep 6379

tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 9644/redis-server *

tcp6 0 0 :::6379 :::* LISTEN 9644/redis-server *

[root@localhost bin]# netstat -tunpl |grep 6379

tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 9644/redis-server *

tcp6 0 0 :::6379 :::* LISTEN 9644/redis-server *

[root@localhost bin]# pkill redis-server

[root@localhost bin]# netstat -tunpl |grep 6379

[root@localhost bin]# redis-cli

Could not connect to Redis at 127.0.0.1:6379: Connection refused

Could not connect to Redis at 127.0.0.1:6379: Connection refused

not connected>

4.linux安装fastdfs

4.1下载libfastcommon 网址https://github.com/happyfish100/fastdfs/releases

4.2解压libfastcommon tar.gz包

[root@bogon ~]# tar -zxvf libfastcommon-1.0.36.tar.gz

[root@bogon ~]# cd libfastcommon-1.0.36/

[root@bogon libfastcommon-1.0.36]# cd ..

[root@bogon ~]# mv libfastcommon-1.0.36 libfastcommon

[root@bogon ~]# ll

总用量 1388

-rw-------. 1 root root 2254 4月 18 22:05 anaconda-ks.cfg

drwxrwxr-x 10 root root 258 4月 26 10:53 fastdfs-5.05

-rw-r--r-- 1 root root 336001 4月 26 10:26 fastdfs-5.05.tar.gz

drwxrwxr-x 10 root root 258 4月 26 11:07 fastdfs-5.09

-rw-r--r-- 1 root root 335132 4月 26 11:04 fastdfs-5.09.tar.gz

-rw-r--r--. 1 root root 2285 4月 18 14:10 initial-setup-ks.cfg

drwxrwxr-x 5 root root 135 4月 5 2017 libfastcommon

-rw-r--r-- 1 root root 434873 4月 26 11:08 libfastcommon-1.0.36.tar.gz

-rw-r--r-- 1 root root 73148 4月 26 10:37 libfastcommon-1.0.7.tar.gz

-rwxr-xr-x 1 root root 174744 4月 26 10:48 libfastcommon.so

-rw-r--r-- 1 root root 45680 4月 25 19:42 libfastcommon_v1.01.tar.gz

drwxr-xr-x 3 27626 users 87 10月 4 2009 src

drwxr-xr-x 2 root root 6 4月 18 19:40 公共

drwxr-xr-x 2 root root 6 4月 18 19:40 模板

drwxr-xr-x 2 root root 6 4月 18 19:40 视频

drwxr-xr-x 2 root root 6 4月 18 19:40 图片

drwxr-xr-x 2 root root 6 4月 18 19:40 文档

drwxr-xr-x 2 root root 6 4月 18 19:40 下载

drwxr-xr-x 2 root root 6 4月 18 19:40 音乐

drwxr-xr-x 2 root root 6 4月 18 19:40 桌面

4.3安装libfastcommon

[root@bogon ~]# cd libfastcommon/

[root@bogon libfastcommon]# ./make

-bash: ./make: 没有那个文件或目录

[root@bogon libfastcommon]# ./make.sh

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o hash.o hash.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o chain.o chain.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o shared_func.o shared_func.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ini_file_reader.o ini_file_reader.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o logger.o logger.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o sockopt.o sockopt.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o base64.o base64.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o sched_thread.o sched_thread.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o http_func.o http_func.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o md5.o md5.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o pthread_func.o pthread_func.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o local_ip_func.o local_ip_func.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o avl_tree.o avl_tree.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ioevent.o ioevent.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ioevent_loop.o ioevent_loop.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_task_queue.o fast_task_queue.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_timer.o fast_timer.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o process_ctrl.o process_ctrl.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_mblock.o fast_mblock.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o connection_pool.o connection_pool.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_mpool.o fast_mpool.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_allocator.o fast_allocator.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_buffer.o fast_buffer.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o multi_skiplist.o multi_skiplist.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o flat_skiplist.o flat_skiplist.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o system_info.o system_info.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_blocked_queue.o fast_blocked_queue.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o id_generator.o id_generator.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o char_converter.o char_converter.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o char_convert_loader.o char_convert_loader.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o hash.lo hash.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o chain.lo chain.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o shared_func.lo shared_func.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o ini_file_reader.lo ini_file_reader.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o logger.lo logger.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o sockopt.lo sockopt.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o base64.lo base64.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o sched_thread.lo sched_thread.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o http_func.lo http_func.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o md5.lo md5.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o pthread_func.lo pthread_func.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o local_ip_func.lo local_ip_func.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o avl_tree.lo avl_tree.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o ioevent.lo ioevent.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o ioevent_loop.lo ioevent_loop.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_task_queue.lo fast_task_queue.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_timer.lo fast_timer.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o process_ctrl.lo process_ctrl.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_mblock.lo fast_mblock.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o connection_pool.lo connection_pool.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_mpool.lo fast_mpool.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_allocator.lo fast_allocator.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_buffer.lo fast_buffer.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o multi_skiplist.lo multi_skiplist.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o flat_skiplist.lo flat_skiplist.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o system_info.lo system_info.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_blocked_queue.lo fast_blocked_queue.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o id_generator.lo id_generator.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o char_converter.lo char_converter.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o char_convert_loader.lo char_convert_loader.c

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -o libfastcommon.so -shared hash.lo chain.lo shared_func.lo ini_file_reader.lo logger.lo sockopt.lo base64.lo sched_thread.lo http_func.lo md5.lo pthread_func.lo local_ip_func.lo avl_tree.lo ioevent.lo ioevent_loop.lo fast_task_queue.lo fast_timer.lo process_ctrl.lo fast_mblock.lo connection_pool.lo fast_mpool.lo fast_allocator.lo fast_buffer.lo multi_skiplist.lo flat_skiplist.lo system_info.lo fast_blocked_queue.lo id_generator.lo char_converter.lo char_convert_loader.lo -lm -lpthread

ar rcs libfastcommon.a hash.o chain.o shared_func.o ini_file_reader.o logger.o sockopt.o base64.o sched_thread.o http_func.o md5.o pthread_func.o local_ip_func.o avl_tree.o ioevent.o ioevent_loop.o fast_task_queue.o fast_timer.o process_ctrl.o fast_mblock.o connection_pool.o fast_mpool.o fast_allocator.o fast_buffer.o multi_skiplist.o flat_skiplist.o system_info.o fast_blocked_queue.o id_generator.o char_converter.o char_convert_loader.o

[root@bogon libfastcommon]# ./make.sh install

mkdir -p /usr/lib64

mkdir -p /usr/lib

install -m 755 libfastcommon.so /usr/lib64

install -m 755 libfastcommon.so /usr/lib

mkdir -p /usr/include/fastcommon

install -m 644 common_define.h hash.h chain.h logger.h base64.h shared_func.h pthread_func.h ini_file_reader.h _os_define.h sockopt.h sched_thread.h http_func.h md5.h local_ip_func.h avl_tree.h ioevent.h ioevent_loop.h fast_task_queue.h fast_timer.h process_ctrl.h fast_mblock.h connection_pool.h fast_mpool.h fast_allocator.h fast_buffer.h skiplist.h multi_skiplist.h flat_skiplist.h skiplist_common.h system_info.h fast_blocked_queue.h php7_ext_wrapper.h id_generator.h char_converter.h char_convert_loader.h /usr/include/fastcommon

[root@bogon libfastcommon]#

f

4.4安装fastdfs-5.09

[root@bogon ~]# cd fastdfs-5.09/

[root@bogon fastdfs-5.09]# ./make.sh

cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_service.o tracker_service.c -I../common -I/usr/include/fastcommon

make: 对“all”无需做任何事。

[root@bogon fastdfs-5.09]# ./make.sh install

mkdir -p /usr/bin

mkdir -p /etc/fdfs

cp -f fdfs_trackerd /usr/bin

if [ ! -f /etc/fdfs/tracker.conf.sample ]; then cp -f ../conf/tracker.conf /etc/fdfs/tracker.conf.sample; fi

if [ ! -f /etc/fdfs/storage_ids.conf.sample ]; then cp -f ../conf/storage_ids.conf /etc/fdfs/storage_ids.conf.sample; fi

mkdir -p /usr/bin

mkdir -p /etc/fdfs

cp -f fdfs_storaged /usr/bin

if [ ! -f /etc/fdfs/storage.conf.sample ]; then cp -f ../conf/storage.conf /etc/fdfs/storage.conf.sample; fi

mkdir -p /usr/bin

mkdir -p /etc/fdfs

mkdir -p /usr/lib64

mkdir -p /usr/lib

cp -f fdfs_monitor fdfs_test fdfs_test1 fdfs_crc32 fdfs_upload_file fdfs_download_file fdfs_delete_file fdfs_file_info fdfs_appender_test fdfs_appender_test1 fdfs_append_file fdfs_upload_appender /usr/bin

if [ 0 -eq 1 ]; then cp -f libfdfsclient.a /usr/lib64; cp -f libfdfsclient.a /usr/lib/;fi

if [ 1 -eq 1 ]; then cp -f libfdfsclient.so /usr/lib64; cp -f libfdfsclient.so /usr/lib/;fi

mkdir -p /usr/include/fastdfs

cp -f ../common/fdfs_define.h ../common/fdfs_global.h ../common/mime_file_parser.h ../common/fdfs_http_shared.h ../tracker/tracker_types.h ../tracker/tracker_proto.h ../tracker/fdfs_shared_func.h ../storage/trunk_mgr/trunk_shared.h tracker_client.h storage_client.h storage_client1.h client_func.h client_global.h fdfs_client.h /usr/include/fastdfs

if [ ! -f /etc/fdfs/client.conf.sample ]; then cp -f ../conf/client.conf /etc/fdfs/client.conf.sample; fi

[root@bogon fastdfs-5.09]#

4.5配置fdfs

[root@bogon /]# mkdir -p /data/fdfs_tracker

[root@bogon /]# mkdir -p /data/fdfs_storage

[root@bogon /]# cd /etc/fdfs/

[root@bogon fdfs]# ls

client.conf.sample storage.conf.sample storage_ids.conf.sample tracker.conf.sample

[root@bogon fdfs]# cp tracker.conf.sample tracker.conf

[root@bogon fdfs]# ls

client.conf.sample storage.conf.sample storage_ids.conf.sample tracker.conf tracker.conf.sample

[root@bogon fdfs]# vim tracker.conf

[root@bogon fdfs]# ll

总用量 32

-rw-r--r-- 1 root root 1461 4月 26 10:53 client.conf.sample

-rw-r--r-- 1 root root 7927 4月 26 11:13 storage.conf.sample

-rw-r--r-- 1 root root 105 4月 26 11:13 storage_ids.conf.sample

-rw-r--r-- 1 root root 7316 4月 26 11:38 tracker.conf

-rw-r--r-- 1 root root 7318 4月 26 11:13 tracker.conf.sample

[root@bogon fdfs]# cp storage.conf.sample storage.conf

[root@bogon fdfs]# ll

总用量 40

-rw-r--r-- 1 root root 1461 4月 26 10:53 client.conf.sample

-rw-r--r-- 1 root root 7927 4月 26 11:41 storage.conf

-rw-r--r-- 1 root root 7927 4月 26 11:13 storage.conf.sample

-rw-r--r-- 1 root root 105 4月 26 11:13 storage_ids.conf.sample

-rw-r--r-- 1 root root 7316 4月 26 11:38 tracker.conf

-rw-r--r-- 1 root root 7318 4月 26 11:13 tracker.conf.sample

[root@bogon fdfs]# vim storage.conf

[root@bogon fdfs]# mkdir -p /data/fdfs_storage/base

4.6启动tracker

[root@bogon fdfs]# /etc/init.d/fdfs_trackerd start

Reloading systemd: [ 确定 ]

Starting fdfs_trackerd (via systemctl): [ 确定 ]

4.7配置storage

[root@bogon fdfs]# vim storage.conf

[root@bogon fdfs]# vim storage.conf

[root@bogon fdfs]# > mkdir -p /data/fdfs_storage/storage0

bash: -p: 未找到命令...

[root@bogon fdfs]# > mkdir -p /data/fdfs_storage/storage1

bash: -p: 未找到命令...

[root@bogon fdfs]# > mkdir /data/fdfs_storage/storage1

-bash: /data/fdfs_storage/storage1: 没有那个文件或目录

[root@bogon fdfs]# cd /data/fdfs_storage/

[root@bogon fdfs_storage]# ll

总用量 0

drwxr-xr-x 3 root root 18 4月 26 11:44 base

[root@bogon fdfs_storage]# mkdir storage0

[root@bogon fdfs_storage]# mkdir storage1

[root@bogon fdfs_storage]# ll

总用量 0

drwxr-xr-x 3 root root 18 4月 26 11:44 base

drwxr-xr-x 2 root root 6 4月 26 13:40 storage0

drwxr-xr-x 2 root root 6 4月 26 13:40 storage1

[root@bogon fdfs_storage]# /etc/init.d/fdfs_trackerd restart

Restarting fdfs_trackerd (via systemctl): [ 确定 ]

4.8启动fdfs_storaged

[root@bogon fdfs_storage]# /etc/init.d/fdfs_storaged restart

Restarting fdfs_storaged (via systemctl): [ 确定 ]

[root@bogon fdfs_storage]#

5.linux安装nginx

5.1安装pcre

[root@bogon ~]# useradd -s /sbin/nologin -M nginx

[root@bogon ~]# ll

总用量 3712

-rw-------. 1 root root 2254 4月 18 22:05 anaconda-ks.cfg

drwxrwxr-x 10 root root 258 4月 26 11:13 fastdfs-5.09

-rw-r--r-- 1 root root 335132 4月 26 11:04 fastdfs-5.09.tar.gz

-rw-r--r-- 1 root root 22192 4月 26 14:10 fastdfs-nginx-module-master.zip

-rw-r--r--. 1 root root 2285 4月 18 14:10 initial-setup-ks.cfg

drwxrwxr-x 5 root root 135 4月 26 11:11 libfastcommon

-rw-r--r-- 1 root root 434873 4月 26 11:08 libfastcommon-1.0.36.tar.gz

drwxr-xr-x 8 mysql mysql 158 1月 31 2017 nginx-1.10.3

-rw-r--r-- 1 root root 911509 4月 26 14:08 nginx-1.10.3.tar.gz

drwxr-xr-x 7 1169 1169 8192 1月 11 2017 pcre-8.40

-rw-r--r-- 1 root root 2065161 4月 26 13:53 pcre-8.40.tar.gz

drwxr-xr-x 3 27626 users 87 10月 4 2009 src

drwxr-xr-x 2 root root 6 4月 18 19:40 公共

drwxr-xr-x 2 root root 6 4月 18 19:40 模板

drwxr-xr-x 2 root root 6 4月 18 19:40 视频

drwxr-xr-x 2 root root 6 4月 18 19:40 图片

drwxr-xr-x 2 root root 6 4月 18 19:40 文档

drwxr-xr-x 2 root root 6 4月 18 19:40 下载

drwxr-xr-x 2 root root 6 4月 18 19:40 音乐

drwxr-xr-x 2 root root 6 4月 18 19:40 桌面

[root@bogon ~]# cd pcre-8.40/

[root@bogon pcre-8.40]# ./configure --prefix=/data/pcre

CCLD libpcre.la

CC libpcreposix_la-pcreposix.lo

CCLD libpcreposix.la

CXX libpcrecpp_la-pcrecpp.lo

CXX libpcrecpp_la-pcre_scanner.lo

CXX libpcrecpp_la-pcre_stringpiece.lo

CXXLD libpcrecpp.la

CC pcretest-pcretest.o

.3

ln -sf pcre_exec.3 /data/pcre/share/man/man3/pcre16_exec.3

ln -sf pcre_free_study.3 /data/pcre/share/man/man3/pcre16_free_study.3

ln -sf pcre_free_substring.3 /data/pcre/share/man/man3/pcre16_free_substring.3

ln -sf pcre_free_substring_list.3 /data/pcre/share/man/man3/pcre16_free_substring_list.3

ln -sf pcre_fullinfo.3 /data/pcre/share/man/man3/pcre16_fullinfo.3

ln -sf pcre_get_named_substring.3 /data/pcre/share/man/man3/pcre16_get_named_substring.3

ln -sf pcre_get_stringnumber.3 /data/pcre/share/man/man3/pcre16_get_stringnumber.3

ln -sf pcre_get_stringtable_entries.3 /data/pcre/share/man/man3/pcre16_get_stringtable_entries.3

ln -sf pcre_get_substring.3 /data/pcre/share/man/man3/pcre16_get_substring.3

ln -sf pcre_get_substring_list.3 /data/pcre/share/man/man3/pcre16_get_substring_list.3

ln -sf pcre_jit_exec.3 /data/pcre/share/man/man3/pcre16_jit_exec.3

ln -sf pcre_jit_stack_alloc.3 /data/pcre/share/man/man3/pcre16_jit_stack_alloc.3

ln -sf pcre_jit_stack_free.3 /data/pcre/share/man/man3/pcre16_jit_stack_free.3

ln -sf pcre_maketables.3 /data/pcre/share/man/man3/pcre16_maketables.3

ln -sf pcre_pattern_to_host_byte_order.3 /data/pcre/share/man/man3/pcre16_pattern_to_host_byte_order.3

ln -sf pcre_refcount.3 /data/pcre/share/man/man3/pcre16_refcount.3

ln -sf pcre_study.3 /data/pcre/share/man/man3/pcre16_study.3

ln -sf pcre_utf16_to_host_byte_order.3 /data/pcre/share/man/man3/pcre16_utf16_to_host_byte_order.3

ln -sf pcre_version.3 /data/pcre/share/man/man3/pcre16_version.3

ln -sf pcre_assign_jit_stack.3 /data/pcre/share/man/man3/pcre32_assign_jit_stack.3

ln -sf pcre_compile.3 /data/pcre/share/man/man3/pcre32_compile.3

ln -sf pcre_compile2.3 /data/pcre/share/man/man3/pcre32_compile2.3

ln -sf pcre_config.3 /data/pcre/share/man/man3/pcre32_config.3

ln -sf pcre_copy_named_substring.3 /data/pcre/share/man/man3/pcre32_copy_named_substring.3

ln -sf pcre_copy_substring.3 /data/pcre/share/man/man3/pcre32_copy_substring.3

ln -sf pcre_dfa_exec.3 /data/pcre/share/man/man3/pcre32_dfa_exec.3

ln -sf pcre_exec.3 /data/pcre/share/man/man3/pcre32_exec.3

ln -sf pcre_free_study.3 /data/pcre/share/man/man3/pcre32_free_study.3

ln -sf pcre_free_substring.3 /data/pcre/share/man/man3/pcre32_free_substring.3

ln -sf pcre_free_substring_list.3 /data/pcre/share/man/man3/pcre32_free_substring_list.3

ln -sf pcre_fullinfo.3 /data/pcre/share/man/man3/pcre32_fullinfo.3

ln -sf pcre_get_named_substring.3 /data/pcre/share/man/man3/pcre32_get_named_substring.3

ln -sf pcre_get_stringnumber.3 /data/pcre/share/man/man3/pcre32_get_stringnumber.3

ln -sf pcre_get_stringtable_entries.3 /data/pcre/share/man/man3/pcre32_get_stringtable_entries.3

ln -sf pcre_get_substring.3 /data/pcre/share/man/man3/pcre32_get_substring.3

ln -sf pcre_get_substring_list.3 /data/pcre/share/man/man3/pcre32_get_substring_list.3

ln -sf pcre_jit_exec.3 /data/pcre/share/man/man3/pcre32_jit_exec.3

ln -sf pcre_jit_stack_alloc.3 /data/pcre/share/man/man3/pcre32_jit_stack_alloc.3

ln -sf pcre_jit_stack_free.3 /data/pcre/share/man/man3/pcre32_jit_stack_free.3

ln -sf pcre_maketables.3 /data/pcre/share/man/man3/pcre32_maketables.3

ln -sf pcre_pattern_to_host_byte_order.3 /data/pcre/share/man/man3/pcre32_pattern_to_host_byte_order.3

ln -sf pcre_refcount.3 /data/pcre/share/man/man3/pcre32_refcount.3

ln -sf pcre_study.3 /data/pcre/share/man/man3/pcre32_study.3

ln -sf pcre_utf32_to_host_byte_order.3 /data/pcre/share/man/man3/pcre32_utf32_to_host_byte_order.3

ln -sf pcre_version.3 /data/pcre/share/man/man3/pcre32_version.3

make[3]: 离开目录“/root/pcre-8.40”

make[2]: 离开目录“/root/pcre-8.40”

make[1]: 离开目录“/root/pcre-8.40”

5.2下载:zlib-devel

https://centos.pkgs.org/7/centos-x86_64/zlib-devel-1.2.7-17.el7.x86_64.rpm.html

5.3下载:openssl-devel

https://pkgs.org/download/openssl-devel

root@bogon nginx-1.10.3]# yum -y install openssl openssl-devel

已加载插件:fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: mirrors.aliyun.com

* extras: mirrors.aliyun.com

* updates: mirrors.aliyun.com

软件包 1:openssl-1.0.2k-8.el7.x86_64 已安装并且是最新版本

软件包 1:openssl-devel-1.0.2k-8.el7.x86_64 已安装并且是最新版本

无须任何处理

5.4安装nginx

[root@bogon nginx-1.10.3]# ./configure

checking for OS

+ Linux 3.10.0-693.el7.x86_64 x86_64

.....

nginx http scgi temporary files: "scgi_temp"

5.5启动nginx

[root@bogon nginx-1.10.3]#

[root@bogon nginx-1.10.3]# cd objs

[root@bogon objs]# ll

总用量 3540

-rw-r--r-- 1 root root 15172 4月 26 15:32 autoconf.err

-rw-r--r-- 1 root root 38230 4月 26 15:32 Makefile

-rwxr-xr-x 1 root root 3504256 4月 26 15:33 nginx

-rw-r--r-- 1 root root 5341 4月 26 15:33 nginx.8

-rw-r--r-- 1 root root 6638 4月 26 15:32 ngx_auto_config.h

-rw-r--r-- 1 root root 657 4月 26 15:32 ngx_auto_headers.h

-rw-r--r-- 1 root root 5508 4月 26 15:32 ngx_modules.c

-rw-r--r-- 1 root root 30536 4月 26 15:33 ngx_modules.o

drwxr-xr-x 9 root root 91 4月 26 15:32 src

[root@bogon objs]# ./nginx

6参考文档:

rides参考文档:https://www.cnblogs.com/wangchunniu1314/p/6339416.html

fastDFS参考文档:https://www.cnblogs.com/jkko123/p/6490744.html

https://www.cnblogs.com/yufeng218/p/8111961.html

nginx参考文档:https://blog.csdn.net/testcs_dn/article/details/39233569

https://www.cnblogs.com/hackerer/archive/2016/03/12/5270034.html

redis参考文档:https://www.cnblogs.com/oskyhg/p/7293905.html

maven安装参考文档:https://blog.csdn.net/bigtree_3721/article/details/79045028

7.下载链接:

7.1fastDFS下载:

https://github.com/happyfish100

7.2 pcre-devel下载

https://centos.pkgs.org/7/centos-x86_64/pcre-devel-8.32-17.el7.x86_64.rpm.html

7.3 openssl-devel下载

https://centos.pkgs.org/7/centos-x86_64/openssl-devel-1.0.2k-8.el7.x86_64.rpm.html

7.4 zlib-devel

https://centos.pkgs.org/7/centos-x86_64/zlib-devel-1.2.7-17.el7.x86_64.rpm.html

7.5 redis下载:

http://www.redis.cn/

7.6nginx下载:

http://nginx.org/en/download.html

原创声明,本文系作者授权云+社区发表,未经许可,不得转载。

如有侵权,请联系 yunjia_community@tencent.com 删除。

编辑于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏数据库新发现

Oracle诊断案例-Sql_trace之二

http://www.eygle.com/case/sql_trace_2.htm

12340
来自专栏编程坑太多

springboot (11) mybatis

15130
来自专栏一个会写诗的程序员的博客

6.1 Spring Boot集成mybatis6.1 Spring Boot集成mybatis

在SpringBoot集成MyBatis时,我们将去掉和Mybatis配置相关的xml文件配置方式,用注解和属性配置来代替这些繁杂的配置。

10850
来自专栏dalaoyang

SpringBoot整合Mybatis

介绍一下SpringBoot整合mybatis,数据库选用的是mysql。 首先创建数据库 CREATE DATABASE test; 建表以及插入初始数据(s...

45660
来自专栏数据库新发现

字符集问题的初步探讨(五)

http://www.eygle.com/special/NLS_CHARACTER_SET_05.htm

21630
来自专栏一个会写诗的程序员的博客

《Spring Boot极简教程》 第6章 Springboot数据库集成

在SpringBoot集成MyBatis时,我们将去掉和Mybatis配置相关的xml文件配置方式,用注解和属性配置来代替这些繁杂的配置。

11410
来自专栏乐沙弥的世界

ORA-00932: inconsistent datatypes: expected - got CLOB

      最近数据库从10.2.0.3升级到了10.2.0.5之后,一些对象无法编译通过。查看了这些对象主要表现在之前写法不严格的SQL语法导致了这些pack...

17930
来自专栏数据库新发现

Oracle诊断案例-Job任务停止执行[最终版]

Last Updated: Friday, 2004-11-26 9:48 Eygle

13330
来自专栏龙首琴剑庐

mybaits3整合spring总结

1、maven定义properties: <org.springframework.version>4.3.1.RELEASE</org.springframe...

37870
来自专栏公众号_薛勤的博客

SpringBoot整合Mybatis使用注解或XML的方式开发

[User{id=1, name='name', age=18}, User{id=2, name='name2', age=19}, User{id=3, n...

8620

扫码关注云+社区

领取腾讯云代金券