我们的大部分开发都有一个带有Apache2,PHP5和MySQL 5的RedHat盒子.现在,我们有一个Rails客户端,我们需要在同一台服务器上设置Rails应用程序.我们可以用相同的Apache安装Ruby和Rails框架,还是应该避免这种情况?为什么或者为什么不?是否可以在单个V主机定义中将子域指向PHP或Ruby?
我在Windows Server 2003上运行Apache/SVN,通过LDAP/Active Directory和平面文件进行身份验证.
除了任何 LDAP用户都可以访问所有内容之外,它工作得很好.我希望能够按用户或组限制SVN存储库.
理想情况下,我会得到这样的东西:
<Location /svn/repo1>
# Restricted to ldap-user1, file-user1, or members of ldap-group1,
# all others denied
</Location>
<Location /svn/repo2>
# Restricted to ldap-user2, file-user2, or members of ldap-group2,
# all others denied
</Location>
Run Code Online (Sandbox Code Playgroud)
真正的诀窍可能是我有混合身份验证:LDAP和文件:
<Location /svn>
DAV svn
SVNParentPath C:/svn_repository
AuthName "Subversion Repository"
AuthType Basic
AuthBasicProvider ldap file
AuthUserFile "svn-users.txt" #file-based, custom users
AuthzLDAPAuthoritative On
AuthLDAPBindDN ldapuseraccount@directory.com
AuthLDAPBindPassword ldappassword
AuthLDAPURL ldap://directory.com:389/cn=Users,dc=directory,dc=com?sAMAccountName?sub?(objectCategory=person)
Require valid-user
</Location>
Run Code Online (Sandbox Code Playgroud)
在我的谷歌搜索中,我看到有些人通过authz像这样拉入文件来实现这一点:
<Location /svn>
...
AuthzSVNAccessFile "conf/svn-authz.txt"
</Location …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Windows(7)x64(使用Apache 2.2)上安装mod_xsendfile Apache模块 - 是的,我从一开始就注定了,我知道:-).显然有:
a)没有用于mod_xsendfile的Win x64二进制文件,只是来自模块网站的Win32二进制文件
b)没有来自ApacheLounge的 apxs的Win x64二进制文件
我已经尝试了平常LoadModule xsendfile_module modules/mod_xsendfile.so但是出现了半明显的错误(httpd: Syntax error on line 127 of C:/Apache/conf/httpd.conf: Cannot load C:/Apache/modules/mod_xsendfile.so into
server: The specified module could not be found.),它不是Win x64兼容的.
问题仍然存在 - 如何为x64构建模块,甚至是可能的?我有VS和任何可能需要的工具.
我只是想看看这是否会提高我的Rails保护附件下载速度 - 目前对简单图像的速度非常可怕.
先感谢您 !
我发现这个类似的问题,但针对Debian的这里.
但是,由于我没有apt-cache,它对我没有帮助.运行:
httpd -M
Run Code Online (Sandbox Code Playgroud)
给我一个所有已安装模块的列表,但不是它们的版本.我的同事刚刚指出你可以使用:
yum info mod_dav_svn.x86_64
Run Code Online (Sandbox Code Playgroud)
这将返回已安装的版本和通过Yum提供的版本,但是,如果我使用httpd -M,它会列出如下名称:
mod_proxy_http.so
有没有简单的方法来匹配已安装的模块文件名(即x86_64 i386),所以我可以检查每个模块,甚至更好的是有人知道一种方法一次输出所有模块的这个信息?
有些脚本需要在环境中设置某些路径才能运行.我想编辑我的路径以包含这些位置.这些是我想要添加到我的exec路径的位置.
$JAVA_HOME = "/usr/java/jdk1.6.0_31";
$ANT_HOME = "/usr/apache-ant-1.8.3";
$ANT_BIN = "$ANT_HOME/bin";
$JAVA_BIN = "$JAVA_HOME/bin";
$ADDPATH=$JAVA_HOME . ":" . $ANT_HOME . ":" . $ANT_BIN .":" . $JAVA_BIN . ":" . $PATH;
Run Code Online (Sandbox Code Playgroud)
我用putenv
putenv("JAVA_HOME=" . $JAVA_HOME);
putenv("ANT_HOME=" . $ANT_HOME);
putenv("ANT_BIN=" . $ANT_BIN);
putenv("JAVA_BIN=" . $JAVA_BIN);
putenv("PATH=".$_ENV["PATH"].":".$ADDPATH);
Run Code Online (Sandbox Code Playgroud)
但是,当我做一个
echo getenv("PATH");
Run Code Online (Sandbox Code Playgroud)
我明白了
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Run Code Online (Sandbox Code Playgroud)
我有两个问题:(a)如何将路径变量设置为我想要的值(b)是否有方法(或位置)将这些位置添加为服务器环境的一部分(在php.ini或apache中)配置)而不是使用脚本来进行这些编辑.
我正在尝试设置Apache以使用私钥和证书进行SSL使用.问题是Apache不知何故认为密钥和crt文件不匹配:
[Thu Aug 01 11:35:18 2013] [warn] RSA server certificate wildcard CommonName (CN) `*.-----.nl' does NOT match server name!?
[Thu Aug 01 11:35:18 2013] [debug] ssl_engine_init.c(846): Configuring RSA server private key
[Thu Aug 01 11:35:18 2013] [error] Unable to configure RSA server private key
[Thu Aug 01 11:35:18 2013] [error] SSL Library Error: 185073780 error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch
Run Code Online (Sandbox Code Playgroud)
在此错误之后我检查了密钥和证书是否匹配使用:
$ openssl x509 -noout -modulus -in server.crt | openssl md5
$ openssl rsa -noout -modulus -in server.key | openssl md5 …Run Code Online (Sandbox Code Playgroud) 我在OSX上使用apache2,默认php.ini位置是:
/private/etc/php.ini
Run Code Online (Sandbox Code Playgroud)
我需要把它改成这个......
/Library/FileMaker Server/Web Publishing/publishing-engine/php/lion/lib/php.ini
Run Code Online (Sandbox Code Playgroud)
有帮助吗?
我有很多VirtualHost,似乎我们每次都需要做这两行:
<VirtualHost *:80>
...
ServerName www.example.com
ServerAlias example.com
Run Code Online (Sandbox Code Playgroud)
是否有允许这样做的单行解决方案?
<VirtualHost *:80>
ServerName *.example.com # works for both http://example.com and http://www.example.com
Run Code Online (Sandbox Code Playgroud)
即无需复制example.com?
是否可以在Apache2上进行代理传递,该传递还包含传递给后端服务器的参数?
例:
www.frontserver.com -> www.frontserver.com (meaning that on the base directory it will not be proxied to any backend servers.)
Run Code Online (Sandbox Code Playgroud)
如果它位于/ _nuxt目录下,它将被代理
www.frontserver.com/_nuxt/index.js -> backserver.com/_nuxt/index.js (dynamicaly)
Run Code Online (Sandbox Code Playgroud) 我有一个问题,尝试使用rest api时会收到响应:“ 从原始地址“ https://kollektivet.app ” 获取到' https://kollektivet.app:8082/api/login/ '的访问权限已被CORS政策阻止:对预检请求的响应未通过访问控制检查:预检请求不允许重定向。”
当我尝试使用任何其他api时,就会发生这种情况。从我所阅读的内容来看,此错误表示我正在尝试重定向,但不是。
后端是Django,看起来像这样:
@csrf_exempt
@api_view(["POST"])
@permission_classes((AllowAny,))
def register(request,):
password = request.data.get("password", "")
email = request.data.get("email", "")
if not email and not password and not email:
return Response(
data={
"message": "username, password and email is required to register a user"
},
status=status.HTTP_400_BAD_REQUEST
)
new_user = User.objects.create_user(
email=email, password=password
)
return Response(status=status.HTTP_201_CREATED)
Run Code Online (Sandbox Code Playgroud)
前端处于反应状态,如下所示:
createUser(event) {
event.preventDefault();
let data = {
name: this.state.name,
password: this.state.password,
repeatPassword: this.state.repeatPassword,
email: this.state.email
};
if (this.state.name !== '' && …Run Code Online (Sandbox Code Playgroud) apache2 ×10
apache ×3
php ×2
apache2.4 ×1
centos ×1
certificate ×1
cors ×1
django ×1
filemaker ×1
httpd.conf ×1
lamp ×1
ldap ×1
openssl ×1
proxypass ×1
reactjs ×1
rhel ×1
ssl ×1
svn ×1
virtualhost ×1
x-sendfile ×1