我有我的Apache2.4服务器设置为始终阻止隐藏的文件和文件夹(以“。”开头)在主apache2configuration文件中使用这个: <FilesMatch "^\."> Require all denied </FilesMatch> <DirectoryMatch "^\.|\/\."> Require all denied </DirectoryMatch> 现在我的问题是,我需要排除一个以“。”开头的文件夹。 从一个虚拟主机的根。 所以我试图用vhostconfiguration覆盖它: <Directory /var/www/.hidden> Require all granted </Directory> 而且我也尝试在.htaccess(根和子文件夹)中做到上面的事情,但没有任何作用,因为每次我去的URL这个.folder的内容被阻止。 此外,我尝试在apache2.conf和vhostconfiguration中添加AllowOverride all 。 也试过谷歌这个,但它只显示我无关的结果:(任何人在那里遇到此之前,或有一个解决scheme? 旁注/问题:他们也可能是错误的方式,我试图阻止所有文件/文件夹以“。”开头,所以所有改进的build议都欢迎:)
重新生成新的主机的SSL使用相同的site.conf文件只是新* .crt(validation指向正确)apache重新启动没有错误错误日志显示没有错误(超时)端口443是打开 netstat -a | grep https tcp6 0 0 [::]:https [::]:* LISTEN netstat -lnp|grep 443 tcp6 0 0 :::443 :::* LISTEN 1644/apache2 ps waux |grep 1644 root 1644 0.0 0.4 418960 35564 ? Ss 23:32 0:00 /usr/sbin/apache2 -k start 并在编辑我的ports.conf文件后显示IPv4: <IfModule ssl_module> Listen my.server.ip.add:443 </IfModule> <IfModule mod_gnutls.c> Listen my.server.ip.add:443 </IfModule> netstat -lnp | grep […]
我坚持使用容器化的虚拟主机。 设置如下: mydomain.com Ubuntu VPS(digitalOcean,上下文),Docker预安装 Apache容器(反向代理),访客端口80到主机80 Web应用程序容器(运行apache),访客端口80到主机8081 Apache服务很好,Apache的信息页面显示在mydomain.com和Web应用程序显示在mydomain.com:8081 问题是试图ProxyPass sub.mydomain.com服务于mydomain.com:8081 我在Apache容器中devise了以下站点 – available / sub.mydomain.com.conf。 <VirtualHost *:80> ServerName sub.mydomain.com ProxyPreserveHost on ProxyRequests off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass "/" "http://localhost:8081/" retry=0 ProxyPassReverse "/" "http://localhost:8081/" 但是,sub.mydomain.com返回503错误。 我还用digitalOcean添加了以下DNSlogging: – CNAME:* .mydomain.com是mydomain.com的别名 – A:sub.mydomain.com指向[DROPLET IP] 我也尝试过:取代'localhost': ProxyPass "/" "http://localhost:8081/" retry=0 ProxyPassReverse "/" "http://localhost:8081/" 与mydomain.com和DROPLET […]
我有一个运行Apache Tomcat的Windows服务器上托pipe的Angular.js网站。 但是,即使我想继续使用Apache来提供这些文件,我还想要一个Node.js API,它将接收一些请求,以便将MongoDB数据库与Mongoose集成在一起。 尽pipe我已经设法在网站文件夹的服务器上运行Node.js,但请求仍然是针对Apache的。 任何想法如何configuration的东西,使两台服务器(运行在同一台机器上)可以接收请求?
所以我在Apache 2.4中捣蛋,我发现了这一点 info.php表示Hostname:Port是www.example.com:80 ,在“apache2handler”部分。 然后它说“ SERVER_NAME是“Apache环境”部分中的localhost 。 但是, httpd.conf ServerName是www.example.com:80 。 那么服务器名称和主机名是什么? 他们为什么不同? 另外,为什么使用www.example.com ? 这是一个真正的网站,你可以访问,但仍然Apache到本地主机。 为什么不使用localhost ? 谢谢
在工作中,我们使用Win7框来运行我们的网站。 我知道不是一个合适的服务器操作系统,但是直到我们从PHP 5.2和Apache 2.2升级到PHP 7.1和Apache 2.4之后,它才工作得很好。 现在看起来随机的,所有的PHP会话都会中断,并且不会创build新的会话。 基本上每个人都注销,不能重新login,直到我们重新启动Apache。 平均每周发生一次。 不用说这是非常烦人的。 没有错误日志条目来帮助识别问题。 到目前为止我唯一能够检测到的是php $ _COOKIEvariables变成了NULL而不是包含PHPSESSID的数组。 我试过改变默认的会话目录。 我改变了session.gc_probability。 似乎没有任何帮助。 任何帮助都将非常感激。 顺便说一句,我有我的个人Ubuntu服务器上完全相同的版本的Apache和PHP,我没有问题。 而PHP.ini(Session) [Session] ; Handler used to store/retrieve data. ; http://php.net/session.save-handler session.save_handler = files ; Argument passed to save_handler. In the case of files, this is the path ; where data files are stored. Note: Windows users […]
更新于2017年8月23日,请参见下文 在Apache访问声明的目录之前,我想让RedHat 7中的URL不区分大小写。 我试着用mod_rewrite和mod_speling。 他们中没有人工作。 我知道Linux是一个区分大小写的操作系统。 我的目标是让我的API案例的URL不知情。 我已经宣布了一个httpd的最低设置,只是它甚至运行。 我还为特定的任务或设置添加了所需的模块。 我该怎么办? 或者更好:请向我解释怎么可能或为什么不起作用? 在23-08-2017更新 我得到了一个403(禁止)的错误消息,我没有权限访问服务器上的API / v1 /当我打电话给我这样的API: https://servername/API/v1 以下是Apache(httpd)设置的摘录: ## Rewriting URLs # The URL rewrite engine switch RewriteEngine On # The rewrite map for certain parameters like function() RewriteMap lowercase int:tolower # Make all HTTP request to lowercase <If "%{REQUEST_URI} =~ m#[AZ]#"> RewriteCond %{REQUEST_URI} [AZ] […]
我正在我自己的服务器上为一个虚拟主机安装一个letsencrypt服务器。 成功创build证书后,我收到如下消息: Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/example.net/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/example.net/privkey.pem (我实际上已经改变了域名来保护这个,没有任何理由)。 当我查看目录时,我发现以下内容 ls /etc/letsencrypt/live/example.net cert.pem@ chain.pem@ fullchain.pem@ privkey.pem@ README 所以,我有四个链接指向四个真实的文件。 在我的.conf文件中,我有这样的东西(使用版本1): <VirtualHost *:443> ServerName example.net:443 ServerAlias *.example.net ServerAdmin [email protected] VirtualDocumentRoot /data/httpd/html/example.net/%-3 SSLEngine on # Version 1 SSLCertificateFile /etc/letsencrypt/live/example.net/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.net/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/example.net/chain.pem # Version 2 […]
我们已经build立了一个Apache反向代理服务器,用于在SSH隧道末端从ovpn客户端提供网页。 我们在核心(服务器版本:Apache / 2.4.18(Ubuntu))和运行debian(服务器版本:Apache / 2.2.22(Debian))的硬件vpnterminal设备上安装Ubuntu VM。 我们使用的子域名的url和最初的代理工作得很好。 我们使用基于名字的虚拟主机,第一级的站点可用configuration文件如下所示。 <VirtualHost *:80> ServerAdmin [email protected] ProxyRequests on DocumentRoot /var/www ProxyPreserveHost On ServerName subdomain.domain.co.uk ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel error <Location /> ProxyPass "http://10.8.0.10/" ProxyPassReverse "http://10.8.0.10/" Order allow,deny Allow from all </Location> </VirtualHost> 所以现在我们试图访问隧道端接主机后面的设备的Web界面。 […]
我在使用sslencryption时遇到了Apache 2.4.18服务器的问题。 我的服务器设置是:apache服务器将端口80(http)上的所有内容redirect到端口443(ssl),这是通过不同的站点configuration实现的。 现在我的问题是:如果我打开链接https://www.example.com ,我得到我想要的网站。 但是,如果我打开https://example.com ,我得到错误: ERR_CONNECTION_REFUSED 为什么这样,我该如何解决呢? 虚拟主机文件的SSL: <IfModule mod_ssl.c> <VirtualHost *:443> ServerAdmin [email protected] DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # SSLCertificateFile directive is needed. SSLCertificateFile /etc/letsencrypt/live/footprintgaming.de/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/footprintgaming.de/privkey.pem #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> </VirtualHost> </IfModule> # vim: syntax=apache ts=4 sw=4 sts=4