我对httpd.conf有一个扩展名。我用它来别名和改变root:
原始根设置为/data/www/html
,我需要它为/data/www/pages
。由于多种原因,我不想触及原始的httpd.conf
,因此,我创建了custom_config.conf
custom_config.conf
<VirtualHost *>
DocumentRoot /data/www/pages
Alias "/blah_blah" "/data/www/blah_blah"
<Directory "/data/www/pages">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
有了这个,我可以访问http
但不能访问https
。我尝试了<VirtualHost *:443>
并重新启动了httpd当然,但仍然无法正常工作。我不是Apache的专家,但我认为它必须对ssl.conf
for conf.d
下的custom_config.conf
做一些事情;我把public class ProtobufMessageConverter extends AbstractHttpMessageConverter<MyProto>{
@Override
protected boolean supports(Class<?> aClass) {
return MyProto.class.equals(aClass);
}
@Override
protected MyProto readInternal(Class<? extends MyProto> aClass, HttpInputMessage httpInputMessage)
throws IOException, HttpMessageNotReadableException {
return MyProto.parseFrom(httpInputMessage.getBody());
}
@Override
protected void writeInternal(MyProto proto, HttpOutputMessage httpOutputMessage)
throws IOException, HttpMessageNotWritableException {
OutputStream wr = httpOutputMessage.getBody();
wr.write(proto.toByteArray());
wr.close();
}
}
答案 0 :(得分:0)
检查并确保启用了别名扩展名:
print("\r [{0}] {1}%".format('#'*(progress/10), progress), end='')
然后尝试设置如下所示的别名:
LoadModule alias_module modules/mod_alias.so