Articles of apache 2.2

服务器域parsing,子域不

我设置了一个vanilla Ubuntu服务器安装, networking上的其他计算机可以使用http:// servername / 但是,当我尝试访问子域(例如http://something.servername/ )它不起作用。 有任何想法吗? 谢谢。

WAMP本地主机上的多个域

如果您正在阅读我的问题,谢谢,我感谢您的帮助 我在Windows Vista上使用Wamp。 我已经创build了2个项目文件夹: www/project1/ www/project2/ 我的虚拟主机文件如下所示: NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot "C:/wamp/www/project1/" ServerName project1.com </VirtualHost> <VirtualHost *:80> DocumentRoot "C:/wamp/www/project2/" ServerName project2.com </VirtualHost> 有人可以build议我怎么能这样做吗?

为什么mod_rewrite 禁止返回404而不是403?

我的.htaccess有这个简单的mod_rewrite规则,而且我的浏览器工具(Firebug和Web Dev Toolbar)和我的apache日志都显示服务器返回的是404而不是403.只是想知道这是否正常,如果不正确,我可以补救吗? <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REMOTE_ADDR} !^(192\.168\.0\.11|192\.168\.0\.161)$ RewriteRule ^(admin|login\.php) – [F] </IfModule> 服务器回复: GET login.php 404 Not Found 日志文件显示: (404) (Request:) "GET /login.php HTTP/1.1" 编辑1: 还有一件事。 我应该在[F]禁止之后join[L]最后一​​个标志吗? 例如[F,L]谢谢! 🙂 编辑2: 有问题的文件绝对存在。 当我更改IP地址以允许自己访问时,我可以通过http向他们发送问题。 此外,当我将[F]更改为[G]时,将返回预期的服务器响应(410 Gone)。

虚拟主机无法从同一networking上的其他计算机访问

我已经在一台机器上创build了一个虚拟主机并重新加载了apache,但似乎无法从同一networking上的另一台计算机访问它。 (当我设置服务器的IP和另一台机器的主机文件时,它工作) 使虚拟主机我编辑/etc/httpd/conf/httpd.conf并添加: <VirtualHost 192.168.0.1:80> DocumentRoot /home/sites/mysite ServerName mysite.test.corp ErrorLog logs/mysite.test.corp-error_log CustomLog logs/mysite.test.corp-access_log common <Directory /home/sites/mysite> AllowOverride All </Directory> </VirtualHost>

设置Apache重写规则,只在目录中转发

我目前有一个在httpd.conf中的以下站点设置: <VirtualHost xxxx:80> ServerName testsite ExpiresActive On ExpiresByType image/gif A2592000 ExpiresByType image/png A2592000 ExpiresByType image/jpg A2592000 ExpiresByType image/jpeg A2592000 ExpiresByType text/css A2592000 ExpiresByType application/x-javascript A1 ExpiresByType text/javascript A1 AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript DocumentRoot /usr/local/www/apache22/data/thesite/trunk RewriteEngine On RewriteRule !\.(htc|js|tiff|gif|css|jpg|png|swf|ico|jar|html|doc|pdf|htm|xml)$ %{DOCUMENT_ROOT}/../platform.php [L] </VirtualHost> xxxx是我的IP。 目前它转发任何不在集合(htc | js | tiff | gif | css […]

“/ phpMyAdmin / index.php在这个服务器上找不到”错误

我想在Ubuntu 9.04上运行phpmyadmin 我通过apt-get安装安装了phpmyadmin,并将其configuration为使用apache-2 PHP文件可以正确运行 mysql服务器设置正确 我找不出有什么问题 有人可以帮忙吗?

Apache拒绝确认我的站点文件夹

我在Mac上运行Apache,突然之间的http://localhost导致了Apache的HTDOCS文件夹,而一段时间以后,它正确地引用了我的Sites文件夹。 运行apachectl -D DUMP_HOSTS产生: (13)Permission denied: make_sock: could not bind to address [::]:80 (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs 一些HTTPD.CONF设置: Listen 80 DocumentRoot "/Users/[username]/Sites" <VirtualHost *> DocumentRoot "/Users/[username]/Sites" ServerName localhost </VirtualHost> 帮帮我。

Apache的mod_cache没有cachingFCGI的PHP输出

我有一个非常简单的PHP脚本来testing我的mod_cache设置。 然而,它不工作 – 我可以通过等待页面加载5秒延迟和打印date。 <?php ob_start(); header('Last-Modified: '.gmdate('D, d MYH:i:s', filemtime(__FILE__)).' GMT', true, 200); header('Cache-Control: max-age=31536000, public',true); header('Pragma: Public',true); header('Expires: ' . gmdate('D, d MYH:i:s', strtotime('now + 10 years')) . ' GMT',true); header("Vary: Accept-Encoding"); header("Content-Type: {$mime}",true); sleep(5); echo "test: ".date('n/d/yg:i:s A'); header('Content-Length: '.ob_get_length()); ob_end_flush(); 这个相同的脚本在mod_php下工作得很好。 可以mod_fastcgi内容不被caching? 我是否需要更改标题才能使内容可caching? build议欢迎。 编辑:添加相关的Apacheconfiguration: ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" LoadModule fastcgi_module modules/mod_fastcgi.so […]

帮助我的根目录不可执行CGI脚本

我正在尝试为虚拟主机创build根目录,以便它可以执行CGI脚本。 我把我的虚拟主机声明如下: <VirtualHost *:80> <Directory /> Options +ExecCGI </Directory> DocumentRoot /path/to/root ServerName servername AddHandler cgi-script .pl </VirtualHost>

Traclogin表单

我无法让HTMLlogin表单工作,而不是默认的popup式authenticationlogin表单。 这是我在我的trac.ini帐户pipe理器和组件部分: [account-manager] generated_password_length = 8 hash_method = HtDigestHashMethod password_file = /trac/.htpasswds/passwd password_format = htpasswd password_store = HtPasswdStore [components] acct_mgr.admin.accountmanageradminpage = enabled acct_mgr.db.sessionstore – disabled acct_mgr.pwhash.htdigesthashmethod =disabled acct_mgr.web_ui.accountmodule = enabled acct_mgr.web_ui.loginmodule = enabled acct_mgr.web_ui.registrationmodule = enabled trac.web.auth.loginmodule = disabled webadmin.* enabled 这些设置看起来是否正确?