tomcat不能直接在43.227.223.1杭州服务器使用

有tomcat不能直接在bin中用startup.sh,shutdown.sh进行启动和停止,要通过写shell脚本进行此操作,也就是说有两个步骤,创建用户并设置权限,写tomcat启动脚本,下面我们就完成这两个步骤。

1.首先我们就来创建一个普通用户。
1.groupadd tomcat #加组
2.useradd -g tomcat -s /usr/sbin/nologin tomcat #向组加用户
3.usermod -L tomcat #锁定密码,杭州BGP高防我去43.227.223使密码无效
4.passwd tomcat # 设置密码


通过这四步,我们就把普通用户创建好了,在创建用户时,我们是先创建的组,组创建完成后创建用户并加入该组。

用户创建完成后,就开始给用户设置权限
1.chown -R tomcat:tomcat /data #分配权限给用户


这就是给tomcat这个用户设置了可以操作data目录及其子目录下的权限,-R就代表该目录及其级联子目录。
1.[root@localhost data]# ls -l
2.total 0
3.drwxr-xr-x. 4 tomcat tomcat 79 May 20 08:03 tomcat
4.[root@localhost data]# 


此时我们通过ls -l 命令就可以看到data目录已经属于tomcat用户,且拥有查看,写入,执行权限。

43.227.223.99 43.227.223.1 43.227.223.101 43.227.223.201 43.227.223.156 43.227.223.56 43.227.223.246
43.227.223.100 43.227.223.2 43.227.223.102 43.227.223.202 43.227.223.157 43.227.223.57 43.227.223.247
43.227.223.243 43.227.223.3 43.227.223.103 43.227.223.203 43.227.223.158 43.227.223.58 43.227.223.248
43.227.223.244 43.227.223.4 43.227.223.104 43.227.223.204 43.227.223.159 43.227.223.59 43.227.223.249
43.227.223.245 43.227.223.5 43.227.223.105 43.227.223.205 43.227.223.160 43.227.223.60 43.227.223.250
43.227.223.94 43.227.223.6 43.227.223.106 43.227.223.206 43.227.223.161 43.227.223.61 43.227.223.251
43.227.223.95 43.227.223.7 43.227.223.107 43.227.223.207 43.227.223.162 43.227.223.62 43.227.223.252
43.227.223.198 43.227.223.8 43.227.223.108 43.227.223.208 43.227.223.163 43.227.223.63 43.227.223.253
43.227.223.199 43.227.223.9 43.227.223.109 43.227.223.209 43.227.223.164 43.227.223.64 43.227.223.254
43.227.223.200 43.227.223.10 43.227.223.110 43.227.223.210 43.227.223.165 43.227.223.65 43.227.223.255
43.227.223.194 43.227.223.11 43.227.223.111 43.227.223.211 43.227.223.166 43.227.223.66 43.227.223.146
43.227.223.195 43.227.223.12 43.227.223.112 43.227.223.212 43.227.223.167 43.227.223.67 43.227.223.147
43.227.223.196 43.227.223.13 43.227.223.113 43.227.223.213 43.227.223.168 43.227.223.68 43.227.223.148
43.227.223.197 43.227.223.14 43.227.223.114 43.227.223.214 43.227.223.169 43.227.223.69 43.227.223.149
43.227.223.15 43.227.223.115 43.227.223.215 43.227.223.170 43.227.223.70 43.227.223.150
43.227.223.239 43.227.223.16 43.227.223.116 43.227.223.216 43.227.223.171 43.227.223.71 43.227.223.151
43.227.223.240 43.227.223.17 43.227.223.117 43.227.223.217 43.227.223.172 43.227.223.72 43.227.223.152
43.227.223.241 43.227.223.18 43.227.223.118 43.227.223.218 43.227.223.173 43.227.223.73 43.227.223.153
43.227.223.242 43.227.223.19 43.227.223.119 43.227.223.219 43.227.223.174 43.227.223.74 43.227.223.154
43.227.223.** 43.227.223.20 43.227.223.120 43.227.223.220 43.227.223.175 43.227.223.75 43.227.223.155
43.227.223.139 43.227.223.21 43.227.223.121 43.227.223.76 43.227.223.46 43.227.223.221 43.227.223.176
43.227.223.140 43.227.223.22 43.227.223.122 43.227.223.77 43.227.223.47 43.227.223.222 43.227.223.177
43.227.223.141 43.227.223.23 43.227.223.123 43.227.223.78 43.227.223.48 43.227.223.223 43.227.223.178
43.227.223.142 43.227.223.24 43.227.223.124 43.227.223.79 43.227.223.49 43.227.223.224 43.227.223.179
43.227.223.X 43.227.223.25 43.227.223.125 43.227.223.80 43.227.223.50 43.227.223.225 43.227.223.180
43.227.223.39 43.227.223.26 43.227.223.126 43.227.223.81 43.227.223.51 43.227.223.226 43.227.223.181
43.227.223.40 43.227.223.27 43.227.223.127 43.227.223.82 43.227.223.52 43.227.223.227 43.227.223.182
43.227.223.143 43.227.223.28 43.227.223.128 43.227.223.83 43.227.223.53 43.227.223.228 43.227.223.183
43.227.223.144 43.227.223.29 43.227.223.129 43.227.223.84 43.227.223.54 43.227.223.229 43.227.223.184
43.227.223.145 43.227.223.30 43.227.223.130 43.227.223.85 43.227.223.55 43.227.223.230 43.227.223.185
43.227.223.93 43.227.223.31 43.227.223.131 43.227.223.86 43.227.223.41 43.227.223.231 43.227.223.186
43.227.223.98 43.227.223.32 43.227.223.132 43.227.223.87 43.227.223.42 43.227.223.232 43.227.223.187
43.227.223.193 43.227.223.33 43.227.223.133 43.227.223.88 43.227.223.43 43.227.223.233 43.227.223.188
43.227.223.238 43.227.223.34 43.227.223.134 43.227.223.89 43.227.223.44 43.227.223.234 43.227.223.189
43.227.223.138 43.227.223.35 43.227.223.135 43.227.223.90 43.227.223.45 43.227.223.235 43.227.223.190
43.227.223.38 43.227.223.36 43.227.223.136 43.227.223.91 43.227.223.96 43.227.223.236 43.227.223.191
43.227.223.37 43.227.223.137 43.227.223.92 43.227.223.97 43.227.223.237 43.227.223.192

 

您可能还会对下面的文章感兴趣:

COPYRIGHT © 2010-2018 东莞云悫计算机系统有限公司 All Rights Reserved.

粤ICP备16096532号
客服中心 customer service center

大客户经理咨询 (投诉建议QQ:1635789366 电话:183-0000-3210)

售后服务 (网维技术QQ:404634181 值班电话:18929-444-536)

工作时间: 周一至周五 9:30至17:30 周六13:30至17:30,其它日期按国家法定节假日休假,如果有不便之请敬请谅解! 售后技术支持:多部门7*24小时机制。

客户投诉留言

电话和QQ,以便我们为您提供优质服务! *为必填项