sudo vi /etc/exports
加入:
/ -sec=sys
/users /users/popeye /users/popeye/movies -ro -mapall=popeye:staff -alldirs
检查配置:
sudo nfsd checkexports
重启:
sudo nfsd restart
这里要注意movies目录是我重新建立的755权限,不要用系统原来的目录,不然总是访问不了。
再到a410里网络浏览里就能找到了。
想要用到的场景:用户访问web服务,web访问非web服务1,服务1又再访问2、3,合并计算后,把数据返回给web及前端用户。想让访问链上的所有服务都能得到认证和鉴权,认为本次请求确实是来自用户的。所以想到用cas,让用户在一点登录,所有服务都到此处认证和鉴权。
this tutorial will walk you through how to configure ssl (https://localhost:8443 access) on tomcat in 5 minutes.
for this tutorial you will need:
the set up consists in 3 basic steps:
fisrt, open the terminal on your computer and type:
windows:
cd %java_home%/bin
linux or mac os:
cd $java_home/bin
the $java_home on mac is located on “/system/library/frameworks/javavm.framework/versions/{your java version}/home/”
you will change the current directory to the directory java is installed on your computer. inside the java home directory, cd to the bin folder. inside the bin folder there is a file named keytool. this guy is responsible for generating the keystore file for us.
next, type on the terminal:
keytool -genkey -alias tomcat -keyalg rsa
when you type the command above, it will ask you some questions. first, it will ask you to create a password (my password is “password“):
loiane:bin loiane$ keytool -genkey -alias tomcat -keyalg rsa enter keystore password: password re-enter new password: password what is your first and last name? [unknown]: loiane groner what is the name of your organizational unit? [unknown]: home what is the name of your organization? [unknown]: home what is the name of your city or locality? [unknown]: sao paulo what is the name of your state or province? [unknown]: sp what is the two-letter country code for this unit? [unknown]: br is cn=loiane groner, ou=home, o=home, l=sao paulo, st=sp, c=br correct? [no]: yes enter key password for (return if same as keystore password): password re-enter new password: password
it will create a .keystore file on your user home directory. on windows, it will be on: c:\documents and settings\[username]; on mac it will be on /users/[username] and on linux will be on /home/[username].
open your tomcat installation directory and open the conf folder. inside this folder, you will find the server.xml file. open it.
find the following declaration:
uncomment it and modify it to look like the following:
connector sslenabled="true" acceptcount="100" clientauth="false" disableuploadtimeout="true" enablelookups="false" maxthreads="25" port="8443" keystorefile="/users/loiane/.keystore" keystorepass="password" protocol="org.apache.coyote.http11.http11nioprotocol" scheme="https" secure="true" sslprotocol="tls" />
note we add the keystorefile, keystorepass and changed the protocol declarations.
start tomcat service and try to access https://localhost:8443. you will see tomcat’s local home page.
note if you try to access the default 8080 port it will be working too: http://localhost:8080
to force your web application to work with ssl, you simply need to add the following code to your web.xml file (before web-app tag ends):
securedapp /* confidential
the url pattern is set to /* so any page/resource from your application is secure (it can be only accessed with https). the transport-guarantee tag is set to confidential to make sure your app will work on ssl.
if you want to turn off the ssl, you don’t need to delete the code above from web.xml, simply changeconfidential to none.
reference: (this tutorial is a little confusing, that is why i decided to write another one my own).
happy coding!
把下面代码加到代码开头,它就可以自启动了,不需要再export或者-i
begin {
#需要加到loadpath的路径
my $need= '/usr/local/nagios/pkg/ebase/';
push @inc, $need;
if ( $^o!~ /mswin32/ ) {
my $ld= $env{dyld_library_path};
if ( !$ld) {
$env{dyld_library_path} = $need;
}
elsif ( $ld!~ m#(^|:)\q$need\e(:|$)# ) {
$env{dyld_library_path} .= ':' . $need;
}
else {
$need= "";
}
if ($need) {
exec 'env', $^x, $0, @argv;
}
}
}
@import ;@import url(/uploads/css/css/cuteeditor.css);建立nagiosdnld
指向软链接:/usr/local/nagios/dnld -> /users/nagiosdnld/dnld
编辑/etc/sshd_config
match user nagiosdnld
x11forwarding no
allowtcpforwarding no
forcecommand internal-sftp
chrootdirectory /users/nagiosdnld
重启下服务:
launchctl stop org.openbsd.ssh-agent
launchctl start org.openbsd.ssh-agent