目的:
安装jdk、tomcat,发布java工程。
流程:
1.安装jdk;
2.配置/etc/profile中java环境变量
3.下载安装tomcat
4.搭建vsftp,可以上传文件
过程:
1.安装jdk
安装jdk有多种方法,可以去oracle官网下载,也可以利用yum直接安装,由于下载比较慢,我就用yum安装了。
-
[root@web1 ~]# cat /etc/redhat-release
-
CentOS release 6.6 (Final)
-
[root@web1 ~]# file /sbin/init
-
/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
-
[root@web1 ~]#
-
[root@web1 ftppath]# yum -y list java*
-
Loaded plugins: fastestmirror, refresh-packagekit, security
-
Loading mirror speeds from cached hostfile
-
Installed Packages
-
java-1.6.0-openjdk.x86_64 1:1.6.0.0-11.1.13.4.el6 @anaconda-CentOS-201410241409.x86_64/6.6
-
java-1.7.0-openjdk.x86_64 1:1.7.0.65-2.5.1.2.el6_5 @anaconda-CentOS-201410241409.x86_64/6.6
-
Available Packages
-
java-1.5.0-gcj.x86_64 1.5.0.0-29.1.el6 centos-source-http
-
java-1.5.0-gcj-devel.x86_64 1.5.0.0-29.1.el6 centos-source-http
-
java-1.5.0-gcj-javadoc.x86_64 1.5.0.0-29.1.el6 centos-source-http
-
java-1.5.0-gcj-src.x86_64 1.5.0.0-29.1.el6 centos-source-http
-
java-1.6.0-openjdk-demo.x86_64 1:1.6.0.0-11.1.13.4.el6 centos-source-http
-
java-1.6.0-openjdk-devel.x86_64 1:1.6.0.0-11.1.13.4.el6 centos-source-http
-
java-1.6.0-openjdk-javadoc.x86_64 1:1.6.0.0-11.1.13.4.el6 centos-source-http
-
java-1.6.0-openjdk-src.x86_64 1:1.6.0.0-11.1.13.4.el6 centos-source-http
-
java-1.7.0-openjdk-demo.x86_64 1:1.7.0.65-2.5.1.2.el6_5 centos-source-http
-
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.65-2.5.1.2.el6_5 centos-source-http
-
java-1.7.0-openjdk-javadoc.noarch 1:1.7.0.65-2.5.1.2.el6_5 centos-source-http
-
java-1.7.0-openjdk-src.x86_64 1:1.7.0.65-2.5.1.2.el6_5 centos-source-http
-
java-1.8.0-openjdk.x86_64 1.8.0.20-3.b26.el6 centos-source-http
-
java-1.8.0-openjdk-demo.x86_64 1.8.0.20-3.b26.el6 centos-source-http
-
java-1.8.0-openjdk-devel.x86_64 1.8.0.20-3.b26.el6 centos-source-http
-
java-1.8.0-openjdk-headless.x86_64 1.8.0.20-3.b26.el6 centos-source-http
-
java-1.8.0-openjdk-javadoc.noarch 1.8.0.20-3.b26.el6 centos-source-http
-
java-1.8.0-openjdk-src.x86_64 1.8.0.20-3.b26.el6 centos-source-http
-
java_cup.x86_64 1:0.10k-5.el6 centos-source-http
-
java_cup-javadoc.x86_64 1:0.10k-5.el6 centos-source-http
-
java_cup-manual.x86_64 1:0.10k-5.el6 centos-source-http
-
javacc.x86_64 4.1-0.5.el6 centos-source-http
-
javacc-demo.x86_64 4.1-0.5.el6 centos-source-http
-
javacc-manual.x86_64 4.1-0.5.el6 centos-source-http
-
javassist.noarch 3.9.0-6.el6 centos-source-http
-
javassist-javadoc.noarch 3.9.0-6.el6 centos-source-http
-
[root@web1 ftppath]#
-
-
-
[root@web1 ftppath]# yum -y install java-1.8.0-openjdk*
-
Loaded plugins: fastestmirror, refresh-packagekit, security
-
Setting up Install Process
-
Loading mirror speeds from cached hostfile
-
Resolving Dependencies
-
--> Running transaction check
-
---> Package java-1.8.0-openjdk.x86_64 0:1.8.0.20-3.b26.el6 will be installed
-
---> Package java-1.8.0-openjdk-demo.x86_64 0:1.8.0.20-3.b26.el6 will be installed
-
---> Package java-1.8.0-openjdk-devel.x86_64 0:1.8.0.20-3.b26.el6 will be installed
-
---> Package java-1.8.0-openjdk-headless.x86_64 0:1.8.0.20-3.b26.el6 will be installed
-
---> Package java-1.8.0-openjdk-javadoc.noarch 0:1.8.0.20-3.b26.el6 will be installed
-
---> Package java-1.8.0-openjdk-src.x86_64 0:1.8.0.20-3.b26.el6 will be installed
-
--> Finished Dependency Resolution
-
-
Dependencies Resolved
-
-
================================================================================
-
Package Arch Version Repository Size
-
================================================================================
-
Installing:
-
java-1.8.0-openjdk x86_64 1.8.0.20-3.b26.el6 centos-source-http 186 k
-
java-1.8.0-openjdk-demo x86_64 1.8.0.20-3.b26.el6 centos-source-http 1.9 M
-
java-1.8.0-openjdk-devel x86_64 1.8.0.20-3.b26.el6 centos-source-http 9.5 M
-
java-1.8.0-openjdk-headless x86_64 1.8.0.20-3.b26.el6 centos-source-http 29 M
-
java-1.8.0-openjdk-javadoc noarch 1.8.0.20-3.b26.el6 centos-source-http 17 M
-
java-1.8.0-openjdk-src x86_64 1.8.0.20-3.b26.el6 centos-source-http 45 M
-
-
Transaction Summary
-
================================================================================
-
Install 6 Package(s)
-
-
Total download size: 103 M
-
Installed size: 450 M
-
Downloading Packages:
-
(1/6): java-1.8.0-openjdk-devel-1.8.0.20-3.b26.el6.x86_6 | 9.5 MB 00:00
-
(2/6): java-1.8.0-openjdk-headless-1.8.0.20-3.b26.el6.x8 | 29 MB 00:00
-
(3/6): java-1.8.0-openjdk-javadoc-1.8.0.20-3.b26.el6.noa | 17 MB 00:00
-
(4/6): java-1.8.0-openjdk-demo-1.8.0.20-3.b26.el6.x86_64 | 1.9 MB 00:00
-
(5/6): java-1.8.0-openjdk-1.8.0.20-3.b26.el6.x86_64.rpm | 186 kB 00:00
-
(6/6): java-1.8.0-openjdk-src-1.8.0.20-3.b26.el6.x86_64. | 45 MB 00:01
-
--------------------------------------------------------------------------------
-
Total 35 MB/s | 103 MB 00:02
-
Running rpm_check_debug
-
Running Transaction Test
-
Transaction Test Succeeded
-
Running Transaction
-
Installing : java-1.8.0-openjdk-headless-1.8.0.20-3.b26.el6.x86_64 1/6
-
Installing : java-1.8.0-openjdk-1.8.0.20-3.b26.el6.x86_64 2/6
-
Installing : java-1.8.0-openjdk-devel-1.8.0.20-3.b26.el6.x86_64 3/6
-
Installing : java-1.8.0-openjdk-demo-1.8.0.20-3.b26.el6.x86_64 4/6
-
Installing : java-1.8.0-openjdk-src-1.8.0.20-3.b26.el6.x86_64 5/6
-
Installing : java-1.8.0-openjdk-javadoc-1.8.0.20-3.b26.el6.noarch 6/6
-
Verifying : java-1.8.0-openjdk-devel-1.8.0.20-3.b26.el6.x86_64 1/6
-
Verifying : java-1.8.0-openjdk-headless-1.8.0.20-3.b26.el6.x86_64 2/6
-
Verifying : java-1.8.0-openjdk-javadoc-1.8.0.20-3.b26.el6.noarch 3/6
-
Verifying : java-1.8.0-openjdk-demo-1.8.0.20-3.b26.el6.x86_64 4/6
-
Verifying : java-1.8.0-openjdk-1.8.0.20-3.b26.el6.x86_64 5/6
-
Verifying : java-1.8.0-openjdk-src-1.8.0.20-3.b26.el6.x86_64 6/6
-
-
Installed:
-
java-1.8.0-openjdk.x86_64 0:1.8.0.20-3.b26.el6
-
java-1.8.0-openjdk-demo.x86_64 0:1.8.0.20-3.b26.el6
-
java-1.8.0-openjdk-devel.x86_64 0:1.8.0.20-3.b26.el6
-
java-1.8.0-openjdk-headless.x86_64 0:1.8.0.20-3.b26.el6
-
java-1.8.0-openjdk-javadoc.noarch 0:1.8.0.20-3.b26.el6
-
java-1.8.0-openjdk-src.x86_64 0:1.8.0.20-3.b26.el6
-
-
-
[root@web1 ftppath]#
-
测试成功
-
[root@web1 ftppath]# java -version
-
java version "1.7.0_65"
-
OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
-
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
-
[root@web1 ftppath]# echo $PATH
-
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
-
[root@web1 ftppath]# ll /usr/lib
-
lib/ lib64/ libexec/
-
[root@web1 ftppath]# ll /usr/lib/jvm
-
jvm/ jvm-commmon/ jvm-exports/ jvm-private/
-
[root@web1 ftppath]# ll /usr/lib/jvm
-
total 12
-
lrwxrwxrwx. 1 root root 26 Jul 21 12:13 java -> /etc/alternatives/java_sdk
-
drwxr-xr-x. 3 root root 4096 Jul 20 15:09 java-1.6.0-openjdk-1.6.0.0.x86_64
-
drwxr-xr-x. 3 root root 4096 Jul 20 14:56 java-1.7.0-openjdk-1.7.0.65.x86_64
-
lrwxrwxrwx. 1 root root 32 Jul 21 12:13 java-1.8.0 -> /etc/alternatives/java_sdk_1.8.0
-
lrwxrwxrwx. 1 root root 40 Jul 21 12:13 java-1.8.0-openjdk -> /etc/alternatives/java_sdk_1.8.0_openjdk
-
drwxr-xr-x. 9 root root 4096 Jul 21 12:14 java-1.8.0-openjdk-1.8.0.20-3.b26.el6.x86_64
-
lrwxrwxrwx. 1 root root 34 Jul 21 12:13 java-openjdk -> /etc/alternatives/java_sdk_openjdk
-
lrwxrwxrwx. 1 root root 21 Jul 21 12:13 jre -> /etc/alternatives/jre
-
lrwxrwxrwx. 1 root root 27 Jul 20 15:09 jre-1.6.0 -> /etc/alternatives/jre_1.6.0
-
lrwxrwxrwx. 1 root root 37 Jul 20 15:09 jre-1.6.0-openjdk.x86_64 -> java-1.6.0-openjdk-1.6.0.0.x86_64/jre
-
lrwxrwxrwx. 1 root root 27 Jul 20 14:56 jre-1.7.0 -> /etc/alternatives/jre_1.7.0
-
lrwxrwxrwx. 1 root root 38 Jul 20 14:56 jre-1.7.0-openjdk.x86_64 -> java-1.7.0-openjdk-1.7.0.65.x86_64/jre
-
lrwxrwxrwx. 1 root root 27 Jul 21 12:13 jre-1.8.0 -> /etc/alternatives/jre_1.8.0
-
lrwxrwxrwx. 1 root root 35 Jul 21 12:13 jre-1.8.0-openjdk -> /etc/alternatives/jre_1.8.0_openjdk
-
lrwxrwxrwx. 1 root root 48 Jul 21 12:13 jre-1.8.0-openjdk-1.8.0.20-3.b26.el6.x86_64 -> java-1.8.0-openjdk-1.8.0.20-3.b26.el6.x86_64/jre
-
lrwxrwxrwx. 1 root root 29 Jul 21 12:13 jre-openjdk -> /etc/alternatives/jre_openjdk
-
[root@web1 ftppath]#
-
-
http://blog.chinaunix.net/uid-15463753-id-4252690.html
-
默认情况下jdk安装得路径/usr/lib/jvm
-
这个机器可能同时安装好几个版本得jdk
-
[root@web1 bin]# cd /usr/lib/jvm
-
[root@web1 jvm]# ls
-
java
-
java-1.6.0-openjdk-1.6.0.0.x86_64
-
java-1.7.0-openjdk-1.7.0.65.x86_64
-
java-1.8.0
-
java-1.8.0-openjdk
-
java-1.8.0-openjdk-1.8.0.20-3.b26.el6.x86_64
-
java-openjdk
-
jre
-
jre-1.6.0
-
jre-1.6.0-openjdk.x86_64
-
jre-1.7.0
-
jre-1.7.0-openjdk.x86_64
-
jre-1.8.0
-
jre-1.8.0-openjdk
-
jre-1.8.0-openjdk-1.8.0.20-3.b26.el6.x86_64
-
jre-openjdk
-
[root@web1 jvm]#
2.配置java环境变量,并测试变量生效通过:
3.下载安装tomcat
去这里下载,很好找的:,然后传上来,解压、赋予启动脚本x权限、在catalina
.sh增加CATALINA_HOME
=/opt/apache
-tomcat
-6
.0
.30/。
-
root@web1 opt]# cd ./apache-tomcat-8.0.24
-
[root@web1 apache-tomcat-8.0.24]# ls
-
bin lib logs RELEASE-NOTES temp work
-
conf LICENSE NOTICE RUNNING.txt webapps
-
[root@web1 apache-tomcat-8.0.24]# cd bin/
-
[root@web1 bin]# ls
-
bootstrap.jar daemon.sh startup.sh
-
catalina.bat digest.bat tomcat-juli.jar
-
catalina.sh digest.sh tomcat-native.tar.gz
-
catalina-tasks.xml setclasspath.bat tool-wrapper.bat
-
commons-daemon.jar setclasspath.sh tool-wrapper.sh
-
commons-daemon-native.tar.gz shutdown.bat version.bat
-
configtest.bat shutdown.sh version.sh
-
configtest.sh startup.bat
-
[root@master bin]#vim catalina.sh
-
添加:
-
CATALINA_HOME=/opt/apache-tomcat-6.0.30/
-
[root@web1 bin]# ll
-
total 788
-
-rw-r--r--. 1 root root 28386 Jul 1 21:21 bootstrap.jar
-
-rw-r--r--. 1 root root 13825 Jul 1 21:21 catalina.bat
-
-rw-r--r--. 1 root root 21492 Jul 1 21:21 catalina.sh
-
-rw-r--r--. 1 root root 1686 Jul 1 21:21 catalina-tasks.xml
-
-rw-r--r--. 1 root root 24283 Jul 1 21:21 commons-daemon.jar
-
-rw-r--r--. 1 root root 204944 Jul 1 21:21 commons-daemon-native.tar.gz
-
-rw-r--r--. 1 root root 2040 Jul 1 21:21 configtest.bat
-
-rw-r--r--. 1 root root 1922 Jul 1 21:21 configtest.sh
-
-rw-r--r--. 1 root root 7888 Jul 1 21:21 daemon.sh
-
-rw-r--r--. 1 root root 2091 Jul 1 21:21 digest.bat
-
-rw-r--r--. 1 root root 1965 Jul 1 21:21 digest.sh
-
-rw-r--r--. 1 root root 3430 Jul 1 21:21 setclasspath.bat
-
-rw-r--r--. 1 root root 3547 Jul 1 21:21 setclasspath.sh
-
-rw-r--r--. 1 root root 2020 Jul 1 21:21 shutdown.bat
-
-rw-r--r--. 1 root root 1902 Jul 1 21:21 shutdown.sh
-
-rw-r--r--. 1 root root 2022 Jul 1 21:21 startup.bat
-
-rw-r--r--. 1 root root 1904 Jul 1 21:21 startup.sh
-
-rw-r--r--. 1 root root 40824 Jul 1 21:21 tomcat-juli.jar
-
-rw-r--r--. 1 root root 388787 Jul 1 21:21 tomcat-native.tar.gz
-
-rw-r--r--. 1 root root 4057 Jul 1 21:21 tool-wrapper.bat
-
-rw-r--r--. 1 root root 5061 Jul 1 21:21 tool-wrapper.sh
-
-rw-r--r--. 1 root root 2026 Jul 1 21:21 version.bat
-
-rw-r--r--. 1 root root 1908 Jul 1 21:21 version.sh
-
[root@web1 bin]# chmod +x s*
-
[root@web1 bin]# chmod +x ./s*
-
[root@web1 bin]# ./startup.sh
-
Cannot find ./catalina.sh
-
The file is absent or does not have execute permission
-
This file is needed to run this program
-
[root@web1 bin]# chmod +x ./ca*
-
[root@web1 bin]# ./startup.sh
-
Using CATALINA_BASE: /opt/apache-tomcat-8.0.24
-
Using CATALINA_HOME: /opt/apache-tomcat-8.0.24
-
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.24/temp
-
Using JRE_HOME: /usr/lib/jvm/java-1.8.0-openjdk
-
Using CLASSPATH: /opt/apache-tomcat-8.0.24/bin/bootstrap.jar:/opt/apache-tomcat-8.0.24/bin/tomcat-juli.jar
-
Tomcat started.
-
[root@web1 bin]#
-
修改tomcat的监听端口
-
[root@master ~]# cd /opt/apache-tomcat-6.0.30/conf
-
[root@master ~]# vim server.xml
-
-
<Server port="8005" shutdown="SHUTDOWN">【停止tomcat时的端口】
-
<Connector port="8081" protocol="HTTP/1.1"
-
connectionTimeout="20000"
-
redirectPort="8443" /> 【tomcat默认的监听端口是8080,现在改成8081】
-
-
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />【apache+tomcat模式时访问tomcat的端口】
-
-
现在重启tomcat
4.搭建vsftpd
-
[root@web1 ~]# cat /etc/redhat-release
-
CentOS release 6.6 (Final)
-
[root@web1 ~]# file /sbin/init
-
/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
-
[root@web1 ~]# rmp -qa |grep vsftpd
-
-bash: rmp: command not found
-
[root@web1 ~]# rpm -qa |grep vsftpd
-
[root@web1 ~]# yum -y install vsftpd
-
Loaded plugins: fastestmirror, refresh-packagekit, security
-
Setting up Install Process
-
Loading mirror speeds from cached hostfile
-
centos-source-http | 4.0 kB 00:00
-
Resolving Dependencies
-
--> Running transaction check
-
---> Package vsftpd.x86_64 0:2.2.2-12.el6_5.1 will be installed
-
--> Finished Dependency Resolution
-
-
Dependencies Resolved
-
-
================================================================================
-
Package Arch Version Repository Size
-
================================================================================
-
Installing:
-
vsftpd x86_64 2.2.2-12.el6_5.1 centos-source-http 151 k
-
-
Transaction Summary
-
================================================================================
-
Install 1 Package(s)
-
-
Total download size: 151 k
-
Installed size: 331 k
-
Downloading Packages:
-
vsftpd-2.2.2-12.el6_5.1.x86_64.rpm | 151 kB 00:00
-
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
-
Retrieving key from http://192.168.54.37/centos/6.6/os/x86_64/RPM-GPG-KEY-CentOS-6
-
Importing GPG key 0xC105B9DE:
-
Userid: "CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>"
-
From : http://192.168.54.37/centos/6.6/os/x86_64/RPM-GPG-KEY-CentOS-6
-
Running rpm_check_debug
-
Running Transaction Test
-
Transaction Test Succeeded
-
Running Transaction
-
Installing : vsftpd-2.2.2-12.el6_5.1.x86_64 1/1
-
Verifying : vsftpd-2.2.2-12.el6_5.1.x86_64 1/1
-
-
Installed:
-
vsftpd.x86_64 0:2.2.2-12.el6_5.1
-
-
-
[root@web1 ~]# vim /etc/vsftpd/
-
ftpusers vsftpd.conf
-
user_list vsftpd_conf_migrate.sh
-
[root@web1 ~]# vim /etc/vsftpd/vsftpd.conf
-
[root@web1 ~]# cd /etc/vsftpd/
-
[root@web1 vsftpd]# ll
-
total 20
-
-rw-------. 1 root root 125 Aug 4 2014 ftpusers
-
-rw-------. 1 root root 361 Aug 4 2014 user_list
-
-rw-------. 1 root root 4596 Jul 21 11:06 vsftpd.conf
-
-rwxr--r--. 1 root root 338 Aug 4 2014 vsftpd_conf_migrate.sh
-
[root@web1 vsftpd]# vim vsftpd.conf
-
[root@web1 vsftpd]# vim chroot_list
-
[root@web1 bin]# grep -v "#" /etc/vsftpd/vsftpd.conf
anonymous_enable=no
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
local_root=/ftppath/upload
[root@web1 bin]#
-
[root@web1 vsftpd]# mkdir ftppath
-
[root@web1 vsftpd]# mkdir /ftppath
-
[root@web1 vsftpd]# chown ftpjiance:ftpjiance /ftppath/
-
chown: invalid user: `ftpjiance:ftpjiance'
-
[root@web1 vsftpd]# useradd -d /ftppath/ -s /sbin/nologin -g ftp ftpjiance
-
useradd: warning: the home directory already exists.
-
Not copying any file from skel directory into it.
-
[root@web1 vsftpd]# passwd ftpjiance
-
Changing password for user ftpjiance.
-
New password:
-
BAD PASSWORD: it is too short
-
BAD PASSWORD: is too simple
-
Retype new password:
-
passwd: all authentication tokens updated successfully.
-
[root@web1 vsftpd]# chown ftpjiance:ftpjiance /ftppath/
-
chown: invalid group: `ftpjiance:ftpjiance'
-
[root@web1 vsftpd]# chown ftpjiance:ftp /ftppath/
-
[root@web1 vsftpd]#
-
[root@web1 vsftpd]# ftp localhost
-
-bash: ftp: command not found
-
[root@web1 vsftpd]# f
-
---------------------------------------------
-
Microsoft Windows [版本 6.1.7601]
-
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
-
-
C:\Users\yangkai>ftp 132.32.50.197
-
连接到 132.32.50.197。
-
220 (vsFTPd 2.2.2)
-
用户(132.32.50.197:(none)): ftpjiance
-
331 Please specify the password.
-
密码:
-
230 Login successful.
-
ftp> dir
-
200 PORT command successful. Consider using PASV.
-
150 Here comes the directory listing.
-
226 Transfer done (but failed to open directory).
-
ftp>
-
-----------------------------------------------------
-
C:\Users\yangkai>ftp 132.32.50.197
-
连接到 132.32.50.197。
-
220 (vsFTPd 2.2.2)
-
用户(132.32.50.197:(none)): ftpjiance
-
331 Please specify the password.
-
密码:
-
230 Login successful.
-
ftp> lcd e:\
-
目前的本地目录 E:\。
-
ftp> put test.dmp
-
200 PORT command successful. Consider using PASV.
-
553 Could not create file.
-
ftp>
-
-
--------------------------------------------------
-
另附:553 Could not create file.错误的解决
-
在RedHat 5上配置了Vsftpd,一切都是没有问题,用户也可以正常登陆,但是在上传文件的时候总是提示:
-
553 Could not create file.的错误,百思不得其解,在网上搜了一下,原来是:
-
centos 缺省状态是打开selinux的,在这个状态下,vsftp会出现本地用户无法上传的问题(可能是本地用户的home目录,或者是整个目录),错误信息为:
-
553 Could not create file.
-
要解决这个问题只要:
-
1. setsebool -P ftpd_disable_trans 1
-
2. service vsftpd restart
-
就可以了。
-
[root@web1 bin]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@web1 bin]#
-
---------------------------
-
查看SELinux状态:
-
-
1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
-
-
SELinux status: enabled
-
-
2、getenforce ##也可以用这个命令检查
-
-
关闭SELinux:
-
-
1、临时关闭(不用重启机器):
-
-
setenforce 0 ##设置SELinux 成为permissive模式
-
-
##setenforce 1 设置SELinux 成为enforcing模式
-
-
2、修改配置文件需要重启机器:
-
-
修改/etc/selinux/config 文件
-
-
将SELINUX=enforcing改为SELINUX=disabled
-
-
重启机器即可
-
--------------------------------------------------------
完成。
阅读(2252) | 评论(0) | 转发(0) |