我无法find任何文档中如何使用letsencrypt为同一个主机名服务不同的站点,具体取决于请求处理的接口。 我有例如这个简单的configuration: <VirtualHost 10.0.0.3:80> ServerName internalwebsite.example.com ServerAdmin [email protected] DocumentRoot /var/www/internalwebsite.example.com/reachable_from_wan/ ErrorLog ${APACHE_LOG_DIR}/internalwebsite.example.com_error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/internalwebsite.example.com_access.log combined </VirtualHost> 10.3是可从WAN访问的接口,但是我有另一个只能从Intranet访问的接口(10.4),但我希望它具有相同的域名internalwebsite.example.com ,如下所示: <VirtualHost 10.0.0.3:80> ServerName internalwebsite.example.com ServerAdmin [email protected] DocumentRoot /var/www/internalwebsite.example.com/reachable_from_wan/ ErrorLog ${APACHE_LOG_DIR}/internalwebsite.example.com_error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/internalwebsite.example.com_access.log combined </VirtualHost> <VirtualHost 10.0.0.4:80> ServerName internalwebsite.example.com ServerAdmin [email protected] DocumentRoot /var/www/internalwebsite.example.com/reachable_from_intranet/ ErrorLog ${APACHE_LOG_DIR}/internalwebsite.example.com_error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/internalwebsite.example.com_access.log combined </VirtualHost> 这工作和Apache服务器不同的内容取决于所达到的接口,但: 在我希望生成HTTPS证书的域的certbos列表中(在debian机器上运行letsencrypt命令时), letsencrypt用。 […]
尝试在Apache 2.4中使用ErrorDocument指令 – 特别是403.简而言之,该指令对浏览器请求具有预期的效果,该请求在服务器的FQDN(完全限定的域名)之后有一个path,但在仅使用FQDN。 更多细节: 对于这个问题,我保护服务器的名称,并使用www.foo.com和www.bar.com。 Apache 2.4,带有典型的LAMP和各种虚拟服务器。 我已经用find / grep进行了validation,其他[base / parent]configuration文件中没有其他ErrorDocument指令。 虚拟服务器(root)受复杂的RequireAny保护,工作正常 – 需要某个IP集或Referer(是的,我知道 – 客户端坚持)。 在我的虚拟服务器configuration文件中,我有以下内容: ErrorDocument 403 https://www.bar.com/something-went-wrong/ 虚拟主机运行wordpress,所以有一个.htaccess(没有ErrorDocument指令,但可能是一个插件),但我相信无论如何,无论如何,无论如何,无论如何,无论如何,无论如何,无论如何,无论如何vserverconfiguration优先。 testing: 为了testing,我修改了RequireAny来排除我的IP(所以我得到了403)。 当我尝试这样的事情时,ErrorDocument指令很好(带我到bar.com/something-went-wrong): www.foo.com/nosuchfile www.foo.com/direxists/file.exists 但是,使用基本的FQDN,有或没有结尾/: www.foo.com www.foo.com/ 导致可怕的 被禁止 您无权访问/在此服务器上。 此外,尝试使用ErrorDocument处理请求时遇到403禁止错误。 是否有一个已知的原因ErrorDocument可能无法处理基本的FQDN情况? 这似乎是ErrorDocument指令工程,除了这些情况下(我需要它)。 感谢您的帮助!
我有一个无法访问mod-security日志的Apache2服务器: prim@xxxx:~$ apachectl -V AH00526: Syntax error on line 196 of /etc/modsecurity/modsecurity.conf: ModSecurity: Failed to open the audit log file: /var/log/apache2/modsec_audit.log Action '-V' failed. The Apache error log may have more information. prim@xxxx:~$ sudo ls -la /var/log/apache2/modsec_audit.log -rw-rwxrwx 1 root www-data 101792 Oct 22 16:37 /var/log/apache2/modsec_audit.log 我有点困惑,因为每个人(所有者,团体,其他人)都有权打开日志文件。 编辑: prim@xxx:/var/log/unattended-upgrades$ sudo -u www-data touch /var/log/apache2/modsec_audit.log touch: […]
Server version: Apache/2.4.29 (Ubuntu) Linux pinf-vps 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 x86_64 PHP Version 7.1.10-1+ubuntu16.04.1+deb.sury.org+1 (php-fpm) Ubuntu 16.04.1 8GB RAM, 4 cores (Azure A4_V2) networking(24小时): https : //cdn.pbrd.co/images/GQsi2j6.png CPU(24小时): https : //cdn.pbrd.co/images/GQsiB6z.png Apache有时候没有反应。 我在那里举办了几个网站,但他们没有得到超大stream量。 我以为这可能是由MySQL引起的,但有时会影响到不使用它的网站。 我不知道是什么原因导致了这个问题。 networking会挂起5到120秒,这太长了。 有时20分钟没有响应。 有时只有基于MySQL的网站(与Wordpress,顺便说一句:相同的WP页面在其他主机上运行速度很快) ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, […]
我正在使用Apereo CAS for Enterprise SSO。 我试图用下面的Apache httpdconfiguration来设置一个简单的反向代理: <VirtualHost *:80> ServerName mydomain SSLProxyEngine on SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off SSLProxyCheckPeerExpire off ProxyRequests off ProxyPreserveHost off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /cas https://172.17.0.2:8443/cas ProxyPassReverse /cas https://172.17.0.2:8443/cas </VirtualHost> 我也启用了所有必要的httpd模块: LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule socache_shmcb_module modules/mod_socache_shmcb.so LoadModule session_module […]
我正在使用Amazon EC2,CentOS 7 x64_86,1GB内存。 (1)运行命令 php -v 结果 PHP 7.0.24 (cli) (built: Sep 30 2017 10:10:28) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies (2)运行命令 httpd -v 结果 Server version: Apache/2.4.6 (CentOS) Server built: Oct 19 2017 20:39:16 (3)运行命令 vi /etc/httpd/conf.d/welcome.conf 结果 # # This configuration […]
我正在使用数字海洋,我已经build立了另一个实例只为MySQL服务器,另一个为networking。 这就是我为安装MySQL的远程访问所做的总体工作: 0. SSH到mysql服务器实例 1.configuration vi /etc/my.cnf [mysqld] bind-address=SQL-SERVER-IP # skip-networking /etc/init.d/mysql restart 2.允许防火墙端口 sudo ufw allow 3306/tcp sudo ufw allow 3306 sudo ufw allow 8080/tcp sudo ufw allow 8080 sudo service ufw restart 3.授予对远程IP地址的访问权限 mysql -u root -p mysql GRANT ALL ON foo.* TO root@'SECOND-INSTANCE-SERVER-IP' IDENTIFIED BY 'PASSWORD'; Query OK, 0 rows affected, 1 […]
我在我的linux本地主机上testing这个。 这就是我想要的: balter@spectre:/var/www/html$ cat .htaccess Action cgi-node "/usr/bin/env node" AddHandler cgi-node .js balter@spectre:/var/www/html$ ls -al hello.js -rwxr-xr-x 1 balter balter 99 Oct 31 13:17 hello.js balter@spectre:/var/www/html$ cat hello.js #!/usr/bin/env node console.log("Content-Type: text/html"); console.log("hello from javascript"); balter@spectre:/var/www/html$ node hello.js Content-Type: text/html hello from javascript 当我访问localhost/hello.js所有我看到的是hello.js的内容 另外我想知道我是否真的打开了cgi。 我想我做了,因为PHP的工作。 但是我没有启用cgi模块,或者在apache.conf打开。 所以我添加了cgi.load并添加到我的apache.conf ################################################################### ######### Adding capaility to run CGI-scripts […]
我正在尝试从apache 2.2迁移一些软件到2.4。 我有它的工作 – 差不多。 当通过地址localhost访问服务器的东西的工作,但是当试图通过127.0.0.1访问一些事情不。 例如, http:// localhost / cgi-bin / WI_facility显示正确的页面,但是http://127.0.0.1/cgi-bin/WI_facility问我是否要save the file WI_facility which is BIN file (164KB) 。 下面是apache2.conf的关键部分: <VirtualHost *:80> DocumentRoot /var/www/html <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/html> Options -Indexes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> ScriptAlias /cgi-bin/ /var/www/cgi-bin/ <Directory /var/www/cgi-bin> AllowOverride All Options +ExecCGI SetHandler […]
我试图使用apache2的虚拟主机添加一个新的域到我的服务器。 我有的主要网站是https://AAAA.net (这是SSL),我添加了一个新的域名是http://BBBB.net (非SSL现在,我只想让它工作第一)。 然而BBBB.net似乎显示AAAA.net内容,我想我已经正确地configuration了一切,以我所知。 两者都通过a2ensite启用。 在网站上可用: AAAA.net.conf <VirtualHost AAAA.net:80> DocumentRoot "/home/www/AAAA.net/public_html" ServerName AAAA.net <Directory "/home/www/AAAA.net/public_html"> allow from all Options None Require all granted </Directory> ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/home/www/AAAA.net/public_html/wiki/$1 RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] ProxyPassMatch ^/?w(/.*)?$ fcgi://127.0.0.1:9000/home/www/AAAA.net/public_html/wiki/index.php ProxyPassMatch ^/?$ fcgi://127.0.0.1:9000/home/www/AAAA.net/public_html/wiki/index.php <Directory "/home/www/AAAA.net/public_html/wiki/images"> # Ignore .htaccess files AllowOverride None # Serve HTML as […]