以下是我目前的sites-available.conf: <VirtualHost *:80> ServerAdmin heuyie@localhost DocumentRoot /var/www/html/wordpress ServerName heuyie.com ServerAlias www.heuyie.com <Directory /var/www/html/wordpress> Options FollowSymLinks AllowOverride All </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 我想在此服务器上托pipe另一个域,所以我想为此虚拟主机指定IP。 所以,我重写了第一行: <VirtualHost 172.20.30.40:80> 然后,事情停止工作。 为什么? 目前,这是该服务器上唯一的域名。 谢谢!
所以最近,我不得不重置我的服务器,因为一些问题和东西。 而现在,我一直在试图重新设置它,而这只是对我而言没有帮助。 我已经成功安装了httpd ,它可以与我的网站一起工作。 但是当我尝试添加一个SSL证书时,CentOS敢于骗我,它不存在。 这里是journalctl -xe的输出。 Sep 26 17:00:11 localhost systemd[1]: Starting The Apache HTTP Server… — Subject: Unit httpd.service has begun start-up — Defined-By: systemd — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel — — Unit httpd.service has begun starting up. Sep 26 17:00:11 localhost httpd[5579]: AH00526: Syntax error on line 15 of /etc/httpd/enabled/msdfw.conf: Sep 26 17:00:11 localhost […]
我在httpd-ssl.conf中有以下configuration NameVirtualHost *:8443 <VirtualHost _default_:8443> ServerName sub.domain1.com ServerAlias sub2.domain1.com SSLEngine on SSLCertificateFile "/path/to/file.crt" SSLCertificateKeyFile "/path/to/file.key" SSLCertificateChainFile "/path/to/chainFile.crt" # some other settings… </VirtualHost> <VirtualHost _default_:8443> ServerName www.domain1.com ServerAlias domain1.com SSLEngine on SSLCertificateFile "/path/to/file.crt" SSLCertificateKeyFile "/path/to/file.key" SSLCertificateChainFile "/path/to/chainFile.crt" Redirect permanent / http://www.domain1.com/ </VirtualHost> <VirtualHost _default_:8443> ServerName www.domain2.com ServerAlias domain2.com SSLEngine on SSLCertificateFile "/path/to/file.crt" SSLCertificateKeyFile "/path/to/file.key" SSLCertificateChainFile "/path/to/chainFile.crt" […]
我正在使用Nginx的Apache反向代理,我有多个VHOSTS,我想在一个单一的nginx虚拟主机文件中提供全部支持SSL。 我的服务器块是 server { listen 80; server_name _; root /var/www/$host/web; access_log /var/log/mylogs/httpd/$host/access.log; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { proxy_pass http://SERVERIP:8090; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location ~ /\. { deny all; } } 这对于所有站点没有SSL都能正常工作,但是当我为以下SSL支持做同样的工作时: server { listen 80; server_name _; ssl […]
我正在尝试在同一IP上的多个虚拟主机和域上安装ssl。 我为此使用了多个.conf文件。 已经有三个在这个IP与SSL的工作领域。 但是,当尝试使用命令在另一个域上安装ssl时: certbot-auto –apache -d mydomain.com -d www.mydomain.com 得到这个错误: 所选的虚拟主机将与Apache中的其他HTTPS虚拟主机发生冲突。 请select另一个虚拟主机或将ServerNames添加到您的configuration。 VirtualHost无法被选中。 这里是我在mydomain.conf的configuration <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/mydomain/ ServerName mydomain.com ServerAlias www.mydomain.com <Directory /var/www/mydomain/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> RewriteEngine on RewriteCond %{SERVER_NAME} =www.mydomain.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
我在Ubuntu 14.04上安装了Apache(2.4.7),然后将我的虚拟主机configuration复制到sites-available目录中,然后将SSLconfiguration文件重写到conf-available目录中,然后使用a2ensite和a2enconf启用它们。 我知道他们被parsing了,因为由于SSLconfiguration,在那里指定的头文件被添加到响应中,并且当(后来出于debugging的目的)禁用mod_rewrite时,Apache抱怨不了解RewriteEngine on指令。 当我开始testing时,Apache拒绝重写最简单的规则: RewriteEngine on # Rewrite https://localhost/test to https://localhost/test.html RewriteRule ^(.*)$ $1.html [L] 当我直接尝试https://localhost/test.html ,它工作。 当我明确地在我的虚拟主机标签中包含configuration文件,重写开始工作: <IfModule mod_ssl.c> <VirtualHost *:443> Include conf-enabled/rewrites.conf … 为什么当它被包含在全局的时候,它的工作方式是缺省的/etc/apache2/apache2.conf ? 关于这种行为有更多的信息吗?
我试图使用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 […]
我在一个IP上有两个虚拟主机,www.example.com和www.example2.com。 默认的example.com有一个子域docs.example.com,它工作正常,它也有一个SSL证书,它在example.com上强制使用https。 当我尝试在第二个域(即blog.example2.com(wordpress))上设置子域时,它会redirect到第一个域https://www.example.com 。 www.example2.com虽然工作正常。 一个IP上的两个站点可以有子域名吗? 或者你可以只有默认的子域名? 有没有办法让example2上的子域工作? configuration文件: 000-default.conf <VirtualHost *:80> ServerName www.example.com ServerAlias example.com … DocumentRoot /var/www/example.com/public_html </VirtualHost> example.com.conf <VirtualHost *:80> ServerName www.example.com ServerAlias example.com … DocumentRoot /var/www/example.com/public_html </VirtualHost> <IfModule mod_ssl.c> … certificates set up etc. </IfModule> docs.example.com.conf <VirtualHost *:80> ServerName docs.example.com … DocumentRoot /var/www/docs.example.com/public_html </VirtualHost> example2.com.conf <VirtualHost *:80> ServerName www.example2.com ServerAlias example2.com […]
我昨天在我的Win 7机器上重新安装了XAMPP。 我正在做一个Laravel项目。 我安装了当前版本的Laravel,然后在本地机器上设置了虚拟主机。 当我去到我设置的url(jrd_dnd_tools.localhost),我得到一个坏的网关消息如果我去本地主机,我得到该网站的url应该去。 我之前设置了虚拟主机,但不知道为什么会发生这种情况。 我敢肯定,我错过了一些愚蠢的东西,但不知道是什么。 的httpd-vhosts.conf <VirtualHost *:80> ServerAdmin webmaster@jrd_dnd_tools.localhost DocumentRoot "C:\Users\Joey\Web\jrd_dnd_tools/public" ServerName jrd_dnd_tools.localhost ServerAlias www.jrd_dnd_tools.localhost ErrorLog "logs/jrd_dnd_tools.localhost.log" CustomLog "logs/jrd_dnd_tools.localhost.log" common <Directory "C:\Users\Joey\Web\jrd_dnd_tools/public"> AllowOverride All Order Allow,Deny Allow from all ## –New way of doing it Require all granted </Directory> </VirtualHost> .hosts 127.0.0.1 localhost ::1 localhost ::1 database.localhost 127.0.0.1 jrd_dnd_tools.localhost
我有一台运行Apache 2的CentOS 7服务器,并试图托pipe2个站点。 我的两个域名被指向IP 70.61.231.8的服务器。 verizondecom.com windstreamdecom.com 在服务器上,我为每个站点设置了一个虚拟主机。 NameVirtualHost *:80 <VirtualHost *:80> ServerName windstreamdecom.com ServerAlias www.windstreamdecom.com ErrorLog /var/log/httpd/windstreamdecom.err CustomLog /var/log/httpd/windstreamdecom.log combined DocumentRoot /var/www/windstreamdecom/public SetEnv ENVIRONMENT "production" <Directory "/var/www/windstreamdecom/public"> AllowOverride ALL Order allow,deny Allow from all Require all granted </Directory> </VirtualHost> <VirtualHost *:80> ServerName verizondecom.com ServerAlias www.verizondecom.com ErrorLog /var/log/httpd/verizondecom.err CustomLog /var/log/httpd/verizondecom.log combined DocumentRoot /var/www/www.verizondecom.com/public SetEnv ENVIRONMENT […]