Articles of apache2

使别名免受重写规则

我有以下的Apacheconfiguration: <VirtualHost *:80> Alias "/.well-known" "/var/www/example.com/.well-known" RewriteEngine On <If "%{HTTP_HOST} == 'example.com'"> RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </If> <ElseIf "%{HTTPS} != 'on'"> RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </ElseIf> </VirtualHost> 我希望Alias免于HTTPSredirect,即http://example.com/.well-known/x应该返回/var/www/example.com/.well-known/x文件。 目前,它正在通过下面的RewriteRulesredirect到HTTPS。 我怎样才能使Alias免受redirect?

当我使用ErrorDocument时,404 Not Found错误

我知道这个线程已经在networking上和这里讨论了很多,我尝试了几乎所有的方法,但是我仍然遇到同样的问题。 我的conf文件: <Proxy balancer://balancer-applitutoriel> BalancerMember http://localhost:8888 route=js1 retry=30 keepalive=on ttl=10 loadfactor=3 flushpackets=auto timeout=300 Require all granted </Proxy> AliasMatch ^/myApp/static-([^/]+)/(.*)$ /var/www/html/myApp/static-$1/$2 ProxyPassMatch ^/myApp/static ! ProxyPass /myApp balancer://balancer-applitutoriel/myApp stickysession=NODESESSIONID nofailover=on ProxyErrorOverride On ErrorDocument 404 /custom_404.html 在文件夹/var/www/html我有这样的: myApp │ └── static-1.0.0-20170512094719 │ ├── config-spa.json │ ├── css │ │ ├── auth.css │ │ └── theme.css │ ├── custom_404.html […]

如何解决后请求ddos

今天我们的magento商店受到攻击,我希望有人可以帮助告诉我如何阻止来自100多个不同IP的这些请求: 182.255.44.234 – – [15/May/2017:13:24:14 +0100] "POST /calais-shop/customer/account/createpost/ HTTP/1.1" 503 1916 59.61.38.24 – – [15/May/2017:13:24:14 +0100] "POST /calais-shop/customer/account/createpost/ HTTP/1.1" 503 1916 120.39.95.47 – – [15/May/2017:13:24:13 +0100] "POST /calais-shop/customer/account/createpost/ HTTP/1.1" 503 1916 114.236.17.181 – – [15/May/2017:13:24:14 +0100] "POST /calais-shop/customer/account/createpost/ HTTP/1.1" 503 1916 114.236.17.181 – – [15/May/2017:13:23:47 +0100] "POST /calais-shop/customer/account/createpost/ HTTP/1.1" 503 1916 58.219.222.251 – – [15/May/2017:13:24:15 […]

Web服务器无法访问

在centos-7上,我安装了web服务器,但是我无法通过web浏览器查看testing页面。 # yum list httpd* Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: centos.mirror.iphh.net * epel: mirror.imt-systems.com * extras: mirror.wiuwiu.de * updates: mirror.daniel-jost.net Installed Packages httpd.x86_64 2.4.6-45.el7.centos.4 @updates httpd-manual.noarch 2.4.6-45.el7.centos.4 @updates httpd-tools.x86_64 2.4.6-45.el7.centos.4 @updates Available Packages httpd-devel.x86_64 2.4.6-45.el7.centos.4 updates httpd-itk.x86_64 2.4.7.04-1.el7 epel # ls /etc/init.d/ functions iprdump iprinit iprupdate netconsole network […]

在Apache2中绕过具有别名的位置

我想知道如何使用Apache作为特定path的反向代理和本地服务器的子path。 对于特定的位置,我使用Apache作为反向代理( https://my.server.com/my-tools ): <Location /my-tools> Order allow,deny Allow from all ProxyPass http://10.1.1.11:3101/my-tools ProxyPassReverse http://10.1.1.11:3101/my-tools </Location> 关于它的assests,我想使用本地服务器( https://my.server.com/my-tools/images/ )。 我尝试添加别名没有成功: Alias /my-tools/images/ /home/myself/public/images/ <Directory /home/myself/public/images/> Order allow,deny Allow from all </Directory> 我也试图添加这个,但它也没有工作: <Location /my-tools/images/> SetHandler None </Location> 例如,当我inputhttps://my.server.com/my-tools/images/myimage.png ,它会保持redirect到远程服务器。

服务器别名不工作在Apache,Ubuntu的14.04服务器,亚马逊AWS

我在亚马逊AWS上有一个远程ubuntu服务器,而且我正在启用一个使用a2ensite的站点。 我有一个conf文件在我的/etc/apache2/sites-available/001-mysite.conf我的服务器名称和服务器别名是这样摆放的 ServerName 4techgroups.com #Works ServerAlias www.4techgroups.com #Doesn't work http://4techgroups.com #works <Directory /var/www/html/site1> AllowOverride All </Directory> 我不知道为什么我在4techgroups.com工作时无法访问www.4techgroups.com。 难道是因为它是一个亚马逊AWS服务器。

让encryption和2个虚拟主机

我在Debian上安装了OwnCloud,使用apache。 我已经成功configuration了让encryption证书,这对files.example.com很好。 我想另一个域指向相同,但使用域files.example.net。 我为apache创build了一个新的conf文件,使用a2ensite创build一个链接,重新启动apache。 我改变了conf中的服务器名称来匹配额外的域名,但是当我用-d files.example.net运行cert bot命令时,出现以下错误; Cannot find a cert or key directive in /files/etc/apache2/sites-available/001-default.conf/VirtualHost. VirtualHost was not modified Unable to find cert and/or key directives 下面是Apache的第二个conf文件,第一个与域名不同。 <VirtualHost *:443> ServerName files.extradomain.com ServerAlias files.extradomain.com ServerAdmin webmaster@localhost DocumentRoot /var/www/owncloud ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined #RewriteEngine on #RewriteCond %{SERVER_NAME} =files.extradomain.com #RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent] </VirtualHost>

OpenSSL更新后修复Apache

我通过apt to 1.1.0f在ubuntu服务器(14.04 LTS)上进行了OpenSSL升级。 升级完成后,我尝试(重新)启动apache2。 然后这出现: * Starting Apache httpd web server apache2 * * The apache2 configtest failed. Output of config test was: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/ssl.load: Cannot load /usr/lib/apache2/modules/mod_ssl.so into server: /usr/lib/apache2/modules/mod_ssl.so: symbol X509_getm_notAfter, version OPENSSL_1_1_0 not defined in file libcrypto.so.1.1 with […]

Apache始终服务于第一个虚拟主机

我几次看到这个问题,但令人惊讶的是没有解决scheme为我工作: 是的,我用“sudo a2ensite com.secondwebsite.conf” 是的,我用“sudo /etc/init.d/apache2 reload” 是的,我用“sudo /etc/init.d/apache2 restart” 是的,我已经尝试将两个虚拟主机放入一个文件(/ etc / apache2 / sites-available / default),在其上添加“NameVirtualHost *:80”并从“/etc/apache2/ports.conf” 是的,我用“sudo chmod 777 / var / www / secondwebsite” 无论我做什么,secondwebsite.com不断显示firstwebsite.com。 有没有人有任何想法可能造成这种情况? 这里是我的“/ etc / apache2 / sites-available / default” <VirtualHost *:80> ServerAdmin [email protected] ServerName firstwebsite.com ServerAlias www.firstwebsite.com DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> […]

神秘的阿帕奇在debian伸展

我已经在Debian Stretch系统上安装了Apache。 我没有启用网站,但由于某种原因/var/www/html/index.html仍呈现,如果我去http://hostname 。 加载的网站: root@hostname:/etc/apache2# a2query -s No site matches (disabled by site administrator) 访问日志将在/etc/apache2/conf-enabled/other-vhosts-access-log.conf -> ../conf-available/other-vhosts-access-log.conf设置/var/log/apache2/other_vhosts_access.log /etc/apache2/conf-enabled/other-vhosts-access-log.conf -> ../conf-available/other-vhosts-access-log.conf : root@hostname:/etc/apache2/conf-enabled# more other-vhosts-access-log.conf # Define an access log for VirtualHosts that don't define their own logfile CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 我怎样才能find什么设置是这样做的? 我想禁用VirtualHost ,现在,没有页面被加载/渲染。