Articles of httpd.conf

无法从networking连接到Apache

我有一个与vhostconfiguration运行的apache实例,这里是httpd.conf: #Listen {the_server_ip}:80 Listen 80 # <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/example.com ServerName example.com ServerAlias www.example.com ErrorLog logs/example.com-error_log CustomLog logs/example.com-access_log common </VirtualHost> 这是/ etc / hosts中的logging: 127.0.0.1 example.com www.example.com 服务器正在运行并正在侦听: Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 :::80 :::* LISTEN 8756/httpd 这是来自服务器的CURL请求: [root @ localhost示例]#curl -I http://example.com/index.html HTTP/1.1 200 […]

访问DocumentRoot之外的目录

我最近使用Capistrano在我的Linux Redhat服务器上部署了一个Web应用程序,它在站点的文档根目录下创build以下目录结构: /var/www/html/example.com/releases/* /var/www/html/example.com/current 为了加载页面加载当前目录,我改变了我的httpd.conf,以便example.com的DirectoryRoot被设置为/var/www/html/example.com/current 。 问题是,我想要某些目录可用于浏览“当前”目录(phpMyAdmin和Bugzilla)之外。 我已经尝试touch .htaccess文件到/var/www/html/example.com但没有创build… 为了访问位于DocumentRoot外部的目录,我需要做些什么? 我应该更改DocumentRoot并使用.htaccess将Web浏览器转发到当前目录,还是有更好的方法? 另外,作为一个不重要的方面问题:使用特定端口用于某些服务是否明智? 当我使用cPanel时,他们使用:2082和使用的WHM:2086。 我可以在我的服务器上做类似的事情,使服务(phpMyAdmin和Bugzilla)更隐藏一点吗?

apache是​​否按顺序应用指令?

我是新的新的Apache和我不能轻松谷歌的答案。 请问httpd.conf里面的同样的指令是否会覆盖前者? 例如: Timeout 400 Timeout 500 结果超时500?

你如何http-auth服务器上的所有网站?

我正在设置一个开发服务器,需要将这些基本规则应用到/var/www/html目录下的服务器上的所有虚拟主机。 AuthType Basic AuthName "Development Area" AuthUserFile /var/www/.htpasswd Require valid-user 我只是试图把它放在我的httpd.conf ,但是在检查语法时apache会抛出一个错误: AuthType not allowed here

在Apache的VirtualHost中需要“ServerAdmin [email protected]”吗?

我宁愿没有 ServerAdmin 在我的VirtualHost,因为它只是吸引垃圾邮件。 没有用过的东西。 可以忽略吗?

是否有可能重写一些查询stringHTTPS并保持一切HTTP?

我正在重写查询string到美丽的URI,例如: index.php?q=/en/contact成为/en/contact ,所有的作品很好.. # httpd.conf # HANDLE THE QUERY RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] 甚至有可能重写单个查询来强制https和强制一切到http ? 我已经尝试了许多不同的方法,通常以无穷循环结束。 我可以写一个插件来做到这一点在PHP中,但认为这将是更有效的处理这在服务器conf。 我会很乐意提供任何build议。 编辑:为了澄清,我想能够重写非SSL http://example.com/index.php?q=/en/contact启用S​​SL https://example.com/en/contact并且每个不是/en/contact查询都被写入http://example.com/…

如何为反向代理设置不同的mod_mime规则?

默认情况下,httpd包含以下configuration: <IfModule mime_module> # # TypesConfig points to the file containing the list of mappings from # filename extension to MIME-type. # TypesConfig conf/mime.types … </IfModule> 此文件包含从文件扩展名到MIMEtypes的映射。 通常这是我想要的,但我想禁用反向代理映射。 我如何指示mime_module来处理/*但排除/proxy/* ? 为什么? mime_module包含以下行: application/x-msdownload exe dll com bat msi 正在代理的应用程序接受PUT /proxy/rest/[email protected]并返回200 OK而不设置Content-Type或响应主体。 根据http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-24#section-3.1.1.5这是完全合法的(因为没有响应正文)。 mime_module认为该URL适用于.com文件,并且错误地应用了Content-Type: application/x-msdownload 。 因为我知道/proxy/rest/永远不会返回文件,我想要禁用该path的mime_module 。

.htaccess无法在Cent Os上运行6.4

我已经安装了Cent Os 6.4 -Final Version,并为PHP Web开发设置了环境。 我的应用程序使用.htaccess的URL重写&否认直接访问文件。 我的configuration文件httpd – /etc/httpd/conf/httpd.conf如下, <Directory "/var/www/html"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* — "Options All" # doesn't give it to you. # # […]

如何在没有虚拟主机的情况下将SSL / 443添加到Apache服务器?

我在CentOS上安装了一个apache服务器。 我正在尝试添加SSL。 我能够创build证书和密钥,然后更新/etc/httpd/conf.d/ssl.conf以进行以下configuration: /etc/httpd/conf.d/ssl.conf #Where I put my cert SSLCertificateFile /etc/pki/tls/certs/ca.crt #where I put my key SSLCertificateKeyFile /etc/pki/tls/private/ca.key 然后我更新了/etc/httpd/conf/httpd.conf : /etc/httpd/conf/httpd.conf中 Listen 443 SSLEngine on SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key 然后我跑service httpd restart ,我得到的错误: Stopping httpd: [OK] Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:443 [OK] 我需要做什么来启用SSL?

在Ubuntu上找不到httpd.conf

我已经安装了Apache并在Ubuntu 12.10中configurationApache的设置,但我找不到httpd.conf文件(我已经search过,但似乎我没有在我的系统中的文件)。 我可以创build文件(将工作)还是有另一种解决scheme?