我开始使用Docker for WordPress。我遵循了Docker文档以使其启动并运行:
https://docs.docker.com/compose/wordpress/
我为插件和主题目录添加了卷。
第一次运行命令@EnableWebSecurity
public class MultiHttpSecurityConfig {
private static final String[] PUBLIC_MATCHERS = {
"/css/**",
"/js/**",
"/image/**",
"/newUser",
"/forgetPassword",
"/",
"/login",
"/fonts/**",
"/admin/adminLogin"
};
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
@Order(2)
public static class UserConfiguration extends WebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
/* .antMatchers("/**")*/
.antMatchers(PUBLIC_MATCHERS).permitAll()
.anyRequest().hasAnyRole("USER", "ADMIN");
http
.csrf().disable()
.cors().disable()
.formLogin()
.failureUrl("/login?error")
.defaultSuccessUrl("/jobList")
.loginPage("/login")
.permitAll()
.and()
.logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutSuccessUrl("/?logout")
.deleteCookies("remember-me")
.permitAll()
.and()
.rememberMe();
}
@Autowired
private UserSecurityService userSecurityService;
private BCryptPasswordEncoder passwordEncoder() {
return SecurityUtility.passwordEncoder();
}
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userSecurityService).passwordEncoder(passwordEncoder());
}
}
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
@Order(1)
public static class AdminConfigurerAdapter extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers(PUBLIC_MATCHERS).permitAll()
.anyRequest().hasRole("ADMIN");
http
.csrf().disable()
.cors().disable()
.formLogin()
.failureUrl("/login?error")
.defaultSuccessUrl("/admin/adminHome")
.loginPage("/admin/adminLogin")
.permitAll()
.and()
.logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutSuccessUrl("/?logout")
.deleteCookies("remember-me")
.permitAll()
.and()
.rememberMe();
}
@Autowired
private UserSecurityService userSecurityService;
private BCryptPasswordEncoder passwordEncoder() {
return SecurityUtility.passwordEncoder();
}
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.userDetailsService(userSecurityService)
.passwordEncoder(passwordEncoder());
}
}
}
并转到http://localhost:8000/时,我看到了WordPress的安装。当我重新启动PC并使用docker-compose up -d
或docker-compose up -d
重新启动服务时,出现错误消息:ERR_EMPTY_RESPONSE。
我尝试过:
目前,我不知道为什么它不再起作用了。我正在使用macOS
这是我当前的docker-compose.yml
docker-compose start
答案 0 :(得分:0)
遵循这些步骤
@NgModule({
imports: [
Daterangepicker
],
exports: [
SomeComponent
],
declarations: [
SomeComponent
]
})
-两次@NgModule({
declarations: [
],
imports: [
Daterangepicker,
],
providers: [
],
exports: [
Daterangepicker,
]
})
或者,
docker-compose down
-两次{同样也删除了网络} docker-compose up -d
docker-compose down