Articles of apache2

如何构build一个高带宽需求的面向服务器?

我正在devise一个基于networking的科学计算平台的服务,涉及上传大量数据文件(很多GB)。 每个文件还包含标头中的cookie,允许我的服务器对用户进行身份validation。 多个用户可能一次上传这些文件。 这些文件必须使用SSL进行encryption,并且将所有请求发送到我们主要的面向Web的域名(这个域名有一个处理所有请求的Apache服务器)是很好的(但不是绝对必要的)。 我们的服务器托pipe在Google Compute引擎上。 我有多个后端服务器用于实际处理数据文件,目前正在使用mod_proxy将数据请求代理到后端服务器。 但是,即使使用代理,所有的数据在被发送到后端服务器之前仍然stream经面向networking的服务器。 这可能很容易陷入面向networking的服务器和我的网站。 我的问题是:这种情况通常如何处理? (对不起,我不是一个IT人,但必须自己实现) 在这些情况下是使用redirect代替代理吗? 我已经尝试了redirect,但原始头信息丢失,后端服务器无法检索身份validationCookie。

apache2 httpd没有运行

我在Ubuntu 15.10上运行我的web(+ db)服务器。 它工作得很好,突然间,我无法访问我的网站,ping 80端口都没有工作。 命令 service apache2 status 这样说 ● apache2.service – LSB: Apache2 web server Loaded: loaded (/etc/init.d/apache2) Active: active (exited) since 금 2017-09-22 12:08:47 KST; 4h 41min ago Docs: man:systemd-sysv-generator(8) Process: 817 ExecStart=/etc/init.d/apache2 start (code=exited,status=0/SUCCESS) Memory: 0B CPU: 0 9월 22 12:08:46 dev apache2[817]: * Starting web server apache2 9월 22 12:08:47 […]

在虚拟主机之外添加apache2 DirectoryIndex

我有我的服务器上的几个虚拟主机网站,并希望使Apache加载设置文件,如果没有索引文件存在。 我试过了 DirectoryIndex /index.php 但是只加载虚拟主机根目录下的索引。 接下来我尝试了 DirectoryIndex /var/www/index.php 但是这个错误404又回来了,于是我试了一下 DirectoryIndex /../index.php 但是也返回了错误400。 Google的所有结果都是关于如何禁用默认索引,而不是取代它。 我的文件树是 www > index.php (file I wish to load if no index) virtualhostsite1 > pages subdirectories etc. virtualhostsite2 > pages subdirectories etc. virtualhostsite3 > pages subdirectories etc. 简而言之,我想用一个存储在硬盘驱动器其他地方的Apache根之外的自定义索引replace这个屏幕 。 我希望这是有道理的。

从http端口XXXX到https端口XXXY的mod_rewrite

我无法使用以下规则获取mod_rewrite。 RewriteCond "%{SERVER_NAME}" "home.myhome.net" RewriteCond "%{SERVER_PORT}" "^4388$" RewriteRule (.*) https://home.myhome.net:4389%{REQUEST_URI} [QSA,R=301,L] 这个规则是在我的http虚拟主机部分设置的。 问题是,redirect只能在第一次使用。 当我在http端口4388上input不同的URL时,我第二次被redirect到https://home.myhome.net:438 8 / … 例如: 首先我inputhttp://home.myhome.net:4388/pageA我redirect到https://home.myhome.net:4389/pageA 下次我inputhttp://home.myhome.net:4388/pageB并redirect到http://home.myhome.net:4388/pageB 任何想法如何解决这个问题? 我的操作系统细节 root@host:~# dpkg -l|grep apache ii apache2 2.4.18-2ubuntu3.5 amd64 Apache HTTP Server ii apache2-bin 2.4.18-2ubuntu3.5 amd64 Apache HTTP Server (modules and other binary files) ii apache2-data 2.4.18-2ubuntu3.5 all Apache HTTP Server (common files) ii […]

如何为无域请求创buildApache网站?

你如何configuration一个Apache站点专门用于请求不包含域名(即他们直接来自IP, http://123.45.67.89/ )? 这个答案build议创build一个虚拟主机,如: <VirtualHost *> DocumentRoot /www/default # … </VirtualHost> 但这在Apache 2.4.18上不适用于我。 我也尝试指定一个没有定义ServerName的default.conf站点,如: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /log/ "/var/log/" <Directory "/var/log/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from all Require all granted </Directory> </VirtualHost> 但是这也行不通。 所有请求到我的服务器的IP超时,而服务器对域名主机的请求立即作出回应。 看着我的apache error.log,我看到了很多行: [Sun Oct […]

如何处理日志条目,指出在我的服务器上的攻击

自从上个星期以来,我运行一个web服务器(Ubuntu上的Apache2,只能通过IP访问),我认为我现在最容易受到攻击,所以我不知道要注意些什么,所以我只会问专家案件。 在查看访问日志时,我可以追溯大部分对自己的访问。 然后有几个天真的单一的GET请求,但也有一些更可疑的访问:wget访问configuration文件,预期的PHP注入攻击,打算访问什么样的数据库服务器等。所有这些请求被拒绝顺便说一句。 除了保持软件更新等,我应该做些什么,如报告或采取额外的安全措施? 我应该继续监视访问日志吗?

HTTPS子域名不会redirect到非通配符证书

如何设置https://example.com正确地redirect到https://example.com ? 我目前的设置是这样的: http://example.com –> https://example.com http://subdomain.example.com –> https://example.com 我有一个CNAMElogging,我的networking主机将* .example.com指向了example.com。 问题是我没有通配符证书,所以当用户尝试访问https://subdomain.example.com时 ,会遇到这个令人愉快的页面 。 这是我的configuration文件: <VirtualHost *:80> ServerName example.com/ Redirect permanent / https://example.com/ </VirtualHost> <VirtualHost *:443> ServerName example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html SSLEngine on SSLCertificateFile /home/ssl.crt SSLCertificateKeyFile /home/ssl.key SSLCACertificateFile /home/intermediate.crt ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order […]

让我们通过nginx-proxy在Docker容器中encryptionSSL证书

目前我正在使用nginx-proxy将我的子域路由到不同的docker容器。 现在,我想添加一个SSL证书到我的个人云容器,但我没有正确设置它。 我做了什么: 通过certbot获得证书 我尝试通过执行./certbot-auto certonly获得SAN证书,我已经进入了每个我想要使用的子域。 证书已成功生成到etc/letsencrypt/live/www.mydomain.com 将证书挂载到owncloud容器并设置nginx-proxy 快速看看我的docker-compose.yml: nginx-proxy: image: jwilder/nginx-proxy ports: – "80:80" – "443:443" volumes: – /var/run/docker.sock:/tmp/docker.sock owncloud: image: owncloud expose: – 80 – 443 environment: – "VIRTUAL_HOST=owncloud.mydomain.com,www.owncloud.mydomain.com" – "VIRTUAL_PROTO=https" – "VIRTUAL_PORT=443" volumes: – "owncloud-data:/var/www/html" – "/etc/letsencrypt/live/www.mydomain.com:/root/ssl" 这里是我的/etc/apache2/sites-available/default-ssl.conf的摘录(当然是从自己云端容器的一个) <IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine […]

SSL卸载到Apache2的WordPress网站

我有一个运行在Google Compute Engine实例上的WordPress网站,并且在Apache里面使用了SSL。 由于SSL和图像大小调整给这个实例带来了很大的压力,我build立了Google Compute Engine负载均衡器,在负载均衡器中设置了SSL并启用了CDN。 在Apache端,我禁用了*:443configuration,只剩下*:80configuration。负载均衡器现在接受端口443上的请求,并指向端口80上的实例。 <VirtualHost *:80> ServerAdmin [email protected] ServerName mysite.com ServerAlias www.mysite.com # Indexes + Directory Root. DirectoryIndex index.php index.html DocumentRoot /var/www/mysite/htdocs/ # Logfiles ErrorLog /var/www/mysite/logs/error.log CustomLog /var/www/mysite/logs/access.log combined </VirtualHost> 这工作,除了我现在得到混合内容错误,因为所有的资源仍然通过HTTP加载。 我现在尝试启用URL重写,以查看是否可以通过https访问所有内容: <VirtualHost *:80> ServerAdmin [email protected] ServerName mysite.com ServerAlias www.mysite.com # Indexes + Directory Root. DirectoryIndex index.php index.html DocumentRoot /var/www/mysite/htdocs/ # Logfiles […]

允许www-data使用另一个用户 – sudo或ssh

我想允许我的PHP脚本(托pipe与Apache2)执行与另一个用户帐户的命令。 我不希望托pipe在服务器上的另一个网站能够连接到另一个用户帐户。 如果我在/ etc / sudoers中添加规则,那么它将允许任何网站使用该用户。 我来的解决scheme是使用ssh,私钥和公钥。 PHP脚本通过所需的用户帐户与其托pipe的服务器build立ssh连接。 有没有比我的解决scheme与ssh的另一种方式? 最好的祝福