百度360必应搜狗淘宝本站头条
当前位置:网站首页 > IT知识 > 正文

「原创」基于CentOS环境下,LNMP+REDIS+YAF+Java环境搭建

liuian 2025-02-26 12:46 36 浏览

Hi,大家好,我是森哥,今天森哥给大家带来的是一篇《基于CentOS环境下,LNMP+REDIS+YAF+Java环境搭建》,这些内容都是经过森哥自己本身亲自整理、测试后,撰写而成的原创内容。希望对大家有所帮助。

一个完整的服务器环境应用服务内容,不能缺少的就是相关的web、数据库、应用等环境。下面,在基于CentOS的系统环境下,为大家提供一个完整的应用服务教程,大家在使用的过程中,可以根据自己的需求进行取舍,若是不清楚的,可以与森哥取得联系,互相探讨,互相进步。

一、CentOS 7.0安装

选择最小安装,将相关的"调试工具"、“兼容性程序库”、“开发工具”选中。

此操作是为了减少后期安装或编译相关服务时出现依赖、或环境的问题。

硬盘分区,可根据个人的习惯而定,不清楚的可以直接选择系统自动分区,

安装过程这里就省略点。

由于个人的习惯,本人的分区如下,仅供参考:

/boot ? 500M ? ? 用于启动Linux的核心文件
swap ? 5120M(5G)  Linux下的交换分区,又称为虚拟内存,一般是物理内存的2倍,但不建议超过8G
/ ? ? ? ? ? 51200M(50G) ? 所有系统的文件等,都在该分区下
/home  剩下的空间 ? ? 用户主目录,新建的用户的目录将会出现在这里,本人习惯也把数据存在于此

二、基本环境配置

2.1、关闭SeLinux

sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
setenforce 0

2.2、关闭系统自带的防火墙

systemctl stop firewalld ?  //停止系统默认的防火墙
systemctl mask firewalld ? //屏蔽服务(让它不能启动)

2.3、系统管理工具

此举是为了今后方便运维管理使用。可根据情况而定。

yum install -y chkconfig  net-tools ntsysv mlocate lrzsz wget lsof setuptool system-config-securitylevel-tui system-config-network-gui system-config-network-tui system-config-date tcpdump
yum install -y vim nano ? ? ? ? ? ? //安装编辑器
yum install -y git

2.4、更新yum源

yum install -y epel-release
rpm -Uvh http://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el7/webtatic-release.rpm

2.5、安装nginx yum安装的第三方repo源文件(使用编译安装则不需要)

cd /root/software
wget https://mirrors.ustc.edu.cn/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
rpm -ivh epel-release-7-11.noarch.rpm

2.6、安装mysql yum安装的第三方repo源文件(使用编译安装则不需要)

cd /root/software ? //进入源文件集中文件夹
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm  //下载
(wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm Mysql8.0)
yum localinstall -y mysql57-community-release-el7-8.noarch.rpm ? //通过rpm安装得到repo源
yum repolist enabled | grep "mysql.*-community.*" ?  //检查mysql源是否安装成功

2.7、PHP yum的第三方repo源文件(使用编译安装则不需要)

rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

2.8、清理并更新yum源

yum clean all
yum makecache

加快yum工具下载安装速度以及解决yum安装过程中断

mkdir /root/software
cd /root/software
yum install -y yum-fastestmirror
wget https://wilmer.gaa.st/downloads/axel-1.0b.tar.gz
tar zxvf axel-1.0b.tar.gz
cd axel-1.0b
./configure --i18n=1
make
make install
yum -y install yum-utils
yum clean all
yum-complete-transaction --cleanup-only

三、应用环境安装

编译等环境预装

yum install -y make cmake gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers  gd gd-devel perl expat expat-devel nss_ldap unixODBC-devel libxslt-devel libevent-devel libtool-ltdl bison libtool zip unzip gmp-devel python-devel perl-devel perl-ExtUtils-Embed //安装各种环境所需要的插件
yum install -y pcre pcre-devel  //安装PCRE(可与预装环境同步进行)
yum update -y ?  //升级补丁

3.1、iptables应用(可不安装)

3.1.1、安装iptables

yum install -y iptables-services  //安装iptables
systemctl enable iptables ?  //开机自启动
service iptables start ?  //启动服务
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT //允许远程访问mysql
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT //允许远程访问http
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT //允许远程访问https
service iptables save ? //保存相关操作配置
systemctl stop iptables.service ? //关闭iptables服务

3.1.2、iptables规则

3.1.2.1、清除所有规则,所有设置从头开始
iptables -F ? ? ?  //清除预设表filter中的所有规则链的规则
iptables -X ? ? ?  //清除预设表filter中使用者自定链中的规则
service iptables save ? ? //保存结果,否则重启后又恢复原来的状态
iptables -L -n

结果如下:

Chain INPUT (policy ACCEPT)
target ? ? ? prot opt source ? ? ? ? ? ? ? ? destination ? ? ? ?
Chain FORWARD (policy ACCEPT)
target ? ? ? prot opt source ? ? ? ? ? ? ? ? destination ? ? ? ?
Chain OUTPUT (policy ACCEPT)
target ? ? ? prot opt source ? ? ? ? ? ? ? ? destination ? ? ?
3.1.2.2、设定预设规则
iptables -A INPUT -p tcp --dport 22 -j ACCEPT ? //允许所有IP,访问22端口(流入)
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT  //允许所有IP,访问22端口(流出)
iptables -I INPUT -s 10.17.162.137 -p tcp --dport 22 -j ACCEPT  //指定IP访问指定端口
iptables -I OUTPUT -s 10.17.162.137 -p tcp --sport 22 -j ACCEPT  //若流出被禁止,则需要追加该条规则
注:优先允许SSH端口,否则,在执行下面的规则时,将会直接失去连接,无法管理远程机器。
iptables -P INPUT DROP ? ? //禁止所有流入规则
iptables -P OUTPUT ACCEPT ? //允许所有流出规则
iptables -P FORWARD DROP ? //禁止所有转发规则
service iptables save ? ? //保存结果,否则重启后又恢复原来的状态
php-fpm访问的时候,需要用到以下规则,否则将无法访问php文件。
iptables -A INPUT -i lo -j ACCEPT ? //允许来自于lo接口接收数据包
iptables -A OUTPUT -o lo -j ACCEPT ? //允许向lo接口发送数据包

上述规则可根据实际情况而定,而iptables -A的意思是添加到当前规则的最后一条;而iptables -I的意思是添加到当前规则的某一个位置,默认为第一条,若是iptables -I 3 则意思是在第三条插入。

iptables -A INPUT -p tcp --dport 53 -j ACCEPT ? //开放53端口,DNS端口,否则无法使用yum安装
iptables -A INPUT -p udp --dport 53 -j ACCEPT ? //开放53端口,DNS端口,否则无法使用yum安装
iptables -A INPUT -p tcp --dport 80 -j ACCEPT ? //开放80端口
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT ? //tomcat服务需用到的端口
iptables -I INPUT 2 -m state --state RELATED,ESTABLISHED -j ACCEPT  //tomcat服务需要
iptables -A INPUT -p tcp --dport 443 -j ACCEPT ? //开放443端口
允许icmp包通过,也就是允许ping,
iptables -A OUTPUT -p icmp -j ACCEPT (OUTPUT设置成DROP的话)
iptables -A INPUT -p icmp -j ACCEPT ?  (INPUT设置成DROP的话)
iptables -A INPUT -i lo -p all -j ACCEPT (如果是INPUT DROP)
iptables -A OUTPUT -o lo -p all -j ACCEPT(如果是OUTPUT DROP)
丢弃坏的TCP包
iptables -A FORWARD -p TCP ! --syn -m state --state NEW -j DROP
处理IP碎片数量,防止攻击,允许每秒100个
iptables -A FORWARD -f -m limit --limit 100/s --limit-burst 100 -j ACCEPT
设置ICMP包过滤,允许每秒1个包,限制触发条件是10个包.
iptables -A FORWARD -p icmp -m limit --limit 1/s --limit-burst 10 -j ACCEPT
防止外网用内网IP欺骗
iptables -t nat -A PREROUTING -i eth0 -s 10.0.0.0/8 -j DROP
iptables -t nat -A PREROUTING -i eth0 -s 172.16.0.0/12 -j DROP
iptables -t nat -A PREROUTING -i eth0 -s 192.168.0.0/16 -j DROP
禁止与某个具体IP的所有连接
iptables -t nat -A PREROUTING ?  -d ip地址(0.0.0.0) -j DROP
禁用FTP(21)端口
iptables -t nat -A PREROUTING -p tcp --dport 21 -j DROP
禁止某个IP连接FTP(21)端口.
iptables -t nat -A PREROUTING ?  -p tcp --dport 21 -d ip地址 -j DROP
drop非法连接
iptables -A INPUT ? ? -m state --state INVALID -j DROP
iptables -A OUTPUT ?  -m state --state INVALID -j DROP
iptables -A FORWARD -m state --state INVALID -j DROP
允许所有已经建立的和相关的连接
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
service iptables save
service iptables restart

3.2、安装mysql及初始设置mysql

3.2.1、安装mysql

yum install -y bison-devel libaio-devel perl-Data-Dumper  //预装mysql环境
yum install -y mysql-server ? //安装mysqld
service mysqld start  //启动mysql
systemctl enable mysqld.service  //开机自启动

3.2.2、初始化设置

grep 'temporary password' /var/log/mysqld.log ? ? //mysql5.7版本后,初始密码不再为空,默认随机生成,可通过该命令查询
mysql -u root -p ? //进入mysql
alter user root@localhost identified by '三种或以上的八位字符'; ? 默认需要先修改密码,才能其他操作
use mysql; ? //加载mysql表
UPDATE user SET Password=PASSWORD('三种或以上的八位字符') where USER='root';  //设置初始密码
FLUSH PRIVILEGES;
exit; ?  //退出mysql管理

3.2.3、设置mysql 不分大小写

vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
lower_case_table_names=1
character-set-server=utf8
max_connections=500
innodb_log_file_size=60M
innodb_buffer_pool_size=128M
symbolic-links=0
?
[client]
default-character-set=utf8
socket=/var/lib/mysql/mysql.sock
?
[mysqld_safe]
open-files-limit = 8192
log-error=/var/log/mysqld.log
socket=/var/lib/mysql/mysql.sock
pid-file=/var/run/mysqld/mysqld.pid
service mysqld restart

3.3、安装PHP环境(任选一个版本)

3.3.1、安装PHP5.6版本

yum install -y php56w php56w-cli php56w-common php56w-gd php56w-ldap php56w-mbstring php56w-mcrypt php56w-mysql php56w-pdo php56w-devel php56w-bcmath
yum install -y traceroute net-snmp-devel vim sysstat tree mysql-devel ntpdate libjpeg* bind-utils
yum install -y php56w-imap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc php56w-mhash libmcrypt php56w-bcmath
yum install -y php56w-fpm
配置运行的用户名:
vi /etc/php-fpm.d/www.conf
user = nginx ? ? ?  //默认为apache,修改与nginx一致的用户  可以先修改,安装nginx后再重启
group = nginx ? ?  //默认为apache,修改与nginx一致的组  可以先修改,安装nginx后再重启
chkconfig php-fpm on
service php-fpm start

3.3.2、安装PHP7.0版本

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm ?
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm ? ? //php7 yum源
yum install -y php70w php70w-cli php70w-common php70w-gd php70w-ldap php70w-mbstring php70w-mcrypt php70w-mysql php70w-pdo php70w-devel php70w-bcmath
yum install -y traceroute net-snmp-devel vim sysstat tree mysql-devel ntpdate libjpeg* bind-utils
yum install -y php70w-imap php70w-odbc php70w-pear php70w-xml php70w-xmlrpc php70w-mhash libmcrypt php70w-bcmath
yum install -y php70w-fpm
配置运行的用户名:
vi /etc/php-fpm.d/www.conf
user = nginx ? ? ?  //默认为apache,修改与nginx一致的用户  可以先修改,安装nginx后再重启
group = nginx ? ?  //默认为apache,修改与nginx一致的组  可以先修改,安装nginx后再重启
chkconfig php-fpm on
service php-fpm start

3.3.3、安装PHP7.3版本

rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum --enablerepo=remi install -y php73-php php73-php-pear php73-php-bcmath php73-php-pecl php73-php-jsond php73-php-mysqlnd php73-php-mysql php73-php-gd php73-php-common php73-php-fpm php73-php-intl php73-php-cli php73-php php73-php-xml php73-php-opcache php73-php-pecl-apcu php73-php-pdo php73-php-odbc php73-php-xmlrpc php73-php-mhash php73-php-gmp php73-php-process php73-php-pecl-imagick php73-php-devel php73-php-mbstring php73-php-zip php73-php-ldap php73-php-imap php73-php-pecl-mcrypt php73-php-soap traceroute net-snmp-devel vim sysstat tree mysql-devel ntpdate libjpeg* bind-utils
php73 -v
systemctl restart php73-php-fpm
systemctl enable php73-php-fpm
ln -s /opt/remi/php73/root/usr/bin/php /usr/bin/php
ln -s /opt/remi/php73/root/usr/bin/phpize /usr/bin/phpize
ln -s /opt/remi/php73/root/usr/bin/php-config /usr/bin/php-config
vi /etc/opt/remi/php73/php.ini
memory_limit = 512M
配置运行的用户名:
vi /etc/opt/remi/php73/php-fpm.d/www.conf
user = nginx ? ? ?  //默认为apache,修改与nginx一致的用户  可以先修改,安装nginx后再重启
group = nginx ? ?  //默认为apache,修改与nginx一致的组  可以先修改,安装nginx后再重启
systemctl restart php73-php-fpm
systemctl enable php73-php-fpm

3.3.4、修改时区

vi /etc/php.ini
date.timezone = Asia/Shanghai

3.4、安装 REDIS 及 REDIS-php 服务

3.4.1、安装 REDIS

yum install -y tcl ? //若不安装tcl,在make test时会出现错误
cd /home/software
wget http://download.redis.io/releases/redis-4.0.10.tar.gz ? //下载redis安装包
tar zxvf redis-4.0.10.tar.gz ? ? //解压
mkdir /data/deploy -p
mv redis-4.0.10 /data/deploy/redis
cd /data/deploy/redis  //进入redis安装文件夹中,该文件为二进制文件,可直接make操作。
make distclean ? ?  //清理旧的一些编译过的文件
make MALLOC=libc
make test && make install
mkdir -p /data/deploy/redis/etc
mkdir -p /data/deploy/redis/run
mkdir -p /data/deploy/redis/bin
mkdir -p /data/deploy/redis/data/6379
mkdir -p /data/deploy/redis/log
cp redis.conf /data/deploy/redis/etc/redis.conf
cp -r src/redis-* /data/deploy/redis/bin
cd /data/deploy/redis/
./bin/redis-server etc/redis.conf ?  //即可启动redis服务
测试安装是否成功
cd /data/deploy/redis/bin
./redis-server --version
显示下面内容,说明安装成功
Redis server v=3.2.9 sha=00000000:0 malloc=libc bits=64 build=35b33d1f1bb9d2fc
配置redis
vi /data/deploy/redis/etc/redis.conf
requirepass Credit2016Admin ? ? ? ? ? ? ? ?  //配置密码
bind 0.0.0.0 ? ? ? ? ? ?  //允许其他服务器访问
daemonize yes ? ? ? ? ? ? ? ?  //改成后台启动
启动服务文件
touch /etc/init.d/redis
vi /etc/init.d/redis
#!/bin/sh
#chkconfig: 2345 80 90
# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.
?
PATH="/data/deploy/redis/bin:$PATH"
EXEC="/data/deploy/redis/bin/redis-server"
CLIEXEC="/data/deploy/redis/bin/redis-cli"
PIDFILE="/data/deploy/redis/run/redis.pid"
CONF="/data/deploy/redis/etc/redis.conf"
PORT="6379"
?
case "$1" in
 ? start)
 ? ? ? if [ -f $$PIDFILE ]
 ? ? ? then
 ? ? ? ? ? ? ? echo "$PIDFILE exists, process is already running or crashed."
 ? ? ? else
 ? ? ? ? ? ? ? echo "Starting Redis server..."
 ? ? ? ? ? ? ? $EXEC $CONF
 ? ? ? fi
 ? ? ? ;;
 ? stop)
 ? ? ? if [ ! -f $PIDFILE ]
 ? ? ? then
 ? ? ? ? ? ? ? echo "$PIDFILE does not exist, process is not running."
 ? ? ? else
 ? ? ? ? ? ? ? PID=$(cat $PIDFILE)
 ? ? ? ? ? ? ? echo "Stopping ..."
 ? ? ? ? ? ? ? $CLIEXEC -p $PORT shutdown
 ? ? ? ? ? ? ? while [ -x /proc/${PID} ]
 ? ? ? ? ? ? ? do
 ? ? ? ? ? ? ? ? ? echo "Waiting for Redis to shutdown ..."
 ? ? ? ? ? ? ? ? ? sleep 1
 ? ? ? ? ? ? ? done
 ? ? ? ? ? ? ? echo "Redis stopped."
 ? ? ? fi
 ? ? ? ;;
 ? restart)
 ? ? ? $0 stop && $0 start
 ? ? ? ;;
 ? *)
 ? ? ? echo "Usage: $0 {start|stop|restart}" >&2
 ? ? ? exit 1
 ? ? ? ;;
esac
 chmod +x /etc/init.d/redis
chkconfig --add redis
chkconfig redis on
service redis start ? ? ? ? ? ? ? ? //启动redis
Redis环境变量设置
vi /etc/profile
export REDIS_HOME=/data/deploy/redis
export PATH=$PATH:$REDIS_HOME/bin
source /etc/profile ?  //立即生效
 chmod +x /etc/init.d/redis
3.4.2、安装REDIS-php
cd /usr/local/src/
git clone https://github.com/phpredis/phpredis.git
cd phpredis
phpize
./configure --with-php-config=php-config
make
make test
make install
vi /etc/php.ini ?  //最底部添加下面的内容
[redis]
extension = /usr/lib64/php/modules/redis.so
chkconfig --add redis ?  //开机自启动

3.5、YAF编译安装

cd /usr/local/src/
wget http://pecl.php.net/get/yaf-2.3.5.tgz ?  //需与PHP(5.6)版本匹配
wget http://pecl.php.net/get/yaf-3.0.8.tgz  //与php70版本匹配
tar zxvf yaf-2.3.5.tgz
cd yaf-2.3.5
phpize
./configure --with-php-config=/usr/bin/php-config
make
make test
make install
vi /etc/php.ini ? ? ? //最底部
[Yaf]
extension=/usr/lib64/php/modules/yaf.so
yaf.use_namespace = 1
yaf.environ = "develop"
php -i | grep yaf
出现下面这些内容,说明安装成功
yaf
yaf support => enabled
Supports => http://pecl.php.net/package/yaf
yaf.action_prefer => Off => Off
yaf.cache_config => Off => Off
yaf.environ => develop => develop
yaf.forward_limit => 5 => 5
yaf.library => no value => no value
yaf.lowcase_path => Off => Off
yaf.name_separator => no value => no value
yaf.name_suffix => On => On
yaf.st_compatible => Off => Off
yaf.use_namespace => On => On
yaf.use_spl_autoload => Off => Off

3.6、Nginx安装

yum install automake autoconf libtool make
yum install -y nginx
chkconfig nginx on
cd /etc/nginx
vi nginx.conf
在server{}中添加如下内容
默认首页文件名
index ? ? ?  index.php default.php index.html index.htm
在server中添加支持PHP的语句
 location ~ .php$ {
 ? ? ? ? ? root html;
 ? ? ? ? ? fastcgi_pass 127.0.0.1:9000;
 ? ? ? ? ? fastcgi_index index.php;
 ? ? ? ? ? fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 ? ? ? ? ? include fastcgi_params;
 ? ? ? }
禁止IP直接访问
 ? server {
 ? ? ? ?  server_name _;
 ? ? ? ?  return 404;
 ? }
service nginx restart ?  //重启nginx服务
配置虚拟主机
cd /etc/nginx/conf.d
vi domain.conf
server {
listen 80;
server_name youself domain; ? ? ? ? ? ? ? ? //实际访问的域名,多域名之间加个空格
root /home/webdata/yourwebsite/wwwroot; ? //存放网页的根目录
location / {
  index index.php index.html index.shtml; ? ? ? ? //默认首页文件名
}
?
location ~ \.php$ {
 fastcgi_pass ? 127.0.0.1:9000;
 fastcgi_index  index.php;
 fastcgi_param  SCRIPT_FILENAME  /home/webdata/yourwebsite/wwwroot$fastcgi_script_name;
 include ? ? ?  fastcgi_params;
}
#log...
}
service nginx restart ?  //重启nginx服务

3.7、JAVA开发环境安装

yum search java-1.8 ? ? ? ?  //搜索java-1.8的版本
yum install -y java-1.8.0-openjdk-devel.x86_64 ? ?  //安装java-1.8.0版本开发环境
cd /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64 ? //进入安装目录
vi /etc/profile ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  //环境配置
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64 ?  //版本不同,路径不一样,需要注意这个问题
在文件最后面,添加上
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
source /etc/profile ? ? ? ? ?  //立即生效
运行测试
javac
显示以下内容说明配置成功
Usage: javac  
where possible options include:
 -g ? ? ? ? ? ? ? ? ? ? ? ? Generate all debugging info
 -g:none ? ? ? ? ? ? ? ? ?  Generate no debugging info
 -g:{lines,vars,source} ? ? Generate only some debugging info
 -nowarn ? ? ? ? ? ? ? ? ?  Generate no warnings
 -verbose ? ? ? ? ? ? ? ? ? Output messages about what the compiler is doing
 -deprecation ? ? ? ? ? ? ? Output source locations where deprecated APIs are used
 -classpath  ? ? ? ?  Specify where to find user class files and annotation processors
 -cp  ? ? ? ? ? ? ? ? Specify where to find user class files and annotation processors
 -sourcepath  ? ? ? ? Specify where to find input source files
 -bootclasspath  ? ?  Override location of bootstrap class files
 -extdirs  ? ? ? ? ?  Override location of installed extensions
 -endorseddirs  ? ? ? Override location of endorsed standards path
 -proc:{none,only} ? ? ? ?  Control whether annotation processing and/or compilation is done.
 -processor [,,...] Names of the annotation processors to run; bypasses default discovery process
 -processorpath  ? ?  Specify where to find annotation processors
 -parameters ? ? ? ? ? ? ?  Generate metadata for reflection on method parameters
 -d  ? ? ? ? ? ? Specify where to place generated class files
 -s  ? ? ? ? ? ? Specify where to place generated source files
 -h  ? ? ? ? ? ? Specify where to place generated native header files
 -implicit:{none,class} ? ? Specify whether or not to generate class files for implicitly referenced files
 -encoding  ? ? ? Specify character encoding used by source files
 -source  ? ? ? ?  Provide source compatibility with specified release
 -target  ? ? ? ?  Generate class files for specific VM version
 -profile  ? ? ? ? Check that API used is available in the specified profile
 -version ? ? ? ? ? ? ? ? ? Version information
 -help ? ? ? ? ? ? ? ? ? ?  Print a synopsis of standard options
 -Akey[=value] ? ? ? ? ? ?  Options to pass to annotation processors
 -X ? ? ? ? ? ? ? ? ? ? ? ? Print a synopsis of nonstandard options
 -J ? ? ? ? ? ? ? ? ? Pass  directly to the runtime system
 -Werror ? ? ? ? ? ? ? ? ?  Terminate compilation if warnings occur
 @ ? ? ? ? ? ? ?  Read options and filenames from file

若输入javac显示:bash: javac: 未找到命令… 则说明配置失败,检查环境变量路径是否正确。

结束语

至此,基于CentOS系统下的LNMP+REDIS+YAF+Java环境配置完成 。

相关推荐

windows11我的电脑在哪里打开

1/6通过“开始”进入“设置”-“时间和语言”。2/6在“时间和语言”界面选择“区域”3/6这里我们将区域更改位“新加披”,退出。4/6打开微软自带的市场,搜索“你的手机”获取并下载。5/6安装完成后...

win10怎么取消开机自启动(win10如何关闭开机自动启动)

要关闭Windows10的开机自动启动程序,你可以按下Win+R键,输入"msconfig"并按回车键打开系统配置工具。在"启动"选项卡中,你可以看到所有开机自动...

手机cpu排名2025(手机cpu排名榜)

一、2022手机CPU性能综合排名前八名手机CPU:1、型号:苹果A16---综合分数:暂无2、型号:骁龙8gen1---综合分数:42333、联发科天玑9000---综合分数:38724、...

论坛系统(论坛系统数据流图)

BBS是电子布告栏系统的简称,一种网站系统,也是目前流行网络论坛的前身。它允许用户使用终端程序通过调制解调器拨接或者因特网来进行连接,BBS站台提供布告栏、分类讨论区、新闻阅读、软件下载与上传、游戏、...

hp1020plus打印机无法打印(惠普1020plus打印机突然不能打印了)

 删除惠普打印机驱动和软件:1.如果你的打印机已通过USB连接到电脑,断开USB连接;2.打开控制面板—程序和功能(卸载或更改应用程序);3.在软件列表中找到惠普打印机,将其卸载;4.重启电脑...

wifi密码破解器电脑版(wifi密码破解工具电脑版)

肯定不是万能钥匙这种“破解”wifi的东西。不是一两次见到把万能钥匙当做破解wifi用的人了,但实际上那玩意就是个分享wifi的软件。你连上一个wifi,密码就会被分享到云端(可以不分享),别...

手机临时文件夹在哪个位置(手机临时文件夹在哪个位置找)

1.手机文件临时文件是指在手机使用过程中产生的临时文件。2.手机应用程序在运行时需要产生一些临时文件,如缓存文件、日志文件、临时下载文件等,这些文件可以提高应用程序的运行效率和用户体验。但是,这些...

安卓10系统下载(安卓10 下载)

方法及步骤:  其实使用安卓车机下载歌曲的方法十分的简单,具体操作步骤和安卓手机一模一样。  首先我们需要在车机的应用商店上,下载一个音乐播放器,例如网易云音乐或者QQ音乐等。  下载完成后点击进入...

华硕人工客服24小时吗(华硕售后人工客服)

华硕服务中心广东省惠州市惠东县城平深路(创富斜对面)惠东同心电脑城1L11(1.3km)笔记本电脑,平板电脑华硕服务中心广东省惠州市惠东县平山镇同心电脑城1F26(1.3km)笔记本电脑,平...

电脑音量小喇叭不见了(电脑声音喇叭图标不见了怎么办)

如果您电脑上的小喇叭(扬声器)不见了,可以尝试以下方法找回:1.检查设备管理器:在Windows下,右键点击“我的电脑”(或此电脑)->点击“属性”->点击“设备管理器”,查看“声音、视...

腾达路由器手机设置教程(腾达路由器手机设置教程视频)

用手机设置腾达路由器的方法如下:1在手机上打开浏览器,输入路由器背面的管理IP和用户及对应的密码2一般第一次打开,默认会跳出设置向导,准备好宽带用户名和密码,3按向导提示输入相应内容4在无线设置的安全...

自配电脑配置推荐(自配电脑配置推荐百度)

首先,像这类软件最低要求不高。最高没上限。纯粹看你的工程量大小。CPU有双核,内存有4G,就可以运行。但是实际体验肯定比较差,卡是肯德。渲染时间也会超长,一个小作品渲染几小时是正常的。稍微大点的工程也...

2025年平板性价比排行(2020年值得买的平板)

推荐台电P30S好。 基本配置:10.1英寸IPS广视角屏幕,1280*800分辨率,16:10的黄金显示比例,K9高压独立功放,支持3.5mm耳麦接口,联发科MT8183八核处理器,4GB...

2020显卡天梯图10月(2020显卡天梯图极速空间)

排行球队名称积分已赛胜平负进球失球净胜球  1?诺维奇城974629107753639 2?沃特福德91462710...

路由器加密防蹭网(路由器加密防蹭网吗)
  • 路由器加密防蹭网(路由器加密防蹭网吗)
  • 路由器加密防蹭网(路由器加密防蹭网吗)
  • 路由器加密防蹭网(路由器加密防蹭网吗)
  • 路由器加密防蹭网(路由器加密防蹭网吗)