我开始拉出我的头发。 使用Redhat / Apache,我们有三台虚拟主机设置为服务三个基于Drupal的域,另一台虚拟主机设置为通过一台机器通过乘客服务于Redmine。 这个设置对于所有的stream量来说都很好,所有的networking地址都可以parsing全部四个域名。 由于networking基础设施,有问题的盒子使用代理来查看外部世界。 我试图从本地机器上的脚本访问Redmine API,并且响应是错误的: While trying to retrieve the URL: http://projects/users.xml The following error was encountered: Unable to determine IP address from host name for projects The dnsserver returned: Name Error: The domain name does not exist. This means that: The cache was not able to resolve the hostname presented in […]
我想用一个相同的主机名将一个子域名反向注册到另一个域名。 例: fitzefatze.sourcedomain.com应该得到的内容: fitzefatze.targetdomain.com 这应该是dynamic的,以便每个主机名将被转换为目标域名。 我想这可以通过ProxyPass指令来完成,但我不知道如何获取目标的主机名: 像这样的ServerName * .sourcedomain.com ProxyRequests Off <Proxy *> AddDefaultCharset off Order deny,allow Allow from all # </Proxy> ProxyPass / $1.targetserver.com
目前,我的apacheconfiguration包含一个 SSL证书(所有的域列为备用主题名称)。 此外,我还为每个域提供一个虚拟主机configuration,以同时处理SSL和非SSL请求。 所有这些都发生在一个公共IP上。 我想切换到多个SSL证书,每个域使用主题名称指示。 我知道,如果我复制所有的虚拟主机configuration条目,一个端口80和一个端口443 SSL(如已经在SF上讨论)是可能的。 但我宁愿有一些类似于我目前的设置,这些function: 所有SSL相关configuration在一个地方。 在最好的情况下,告诉apache“在这个目录中使用所有SSL证书,并且为每个HTTP请求,根据SNI信息select正确的证书” 虚拟主机configuration不重复,完全没有提及SSL。 可以使用一个虚拟主机configuration来服务许多域名,同时仍然有单独的证书。 那可能吗?
127.0.0.1 developmentsite.com 127.0.0.1 blockeddomain1.com 127.0.0.1 blockeddomain2.com 我想阻止最后2个域名(和其他一些域名)。 为此,我添加了以下的vhost条目: <VirtualHost *:80> DocumentRoot "/sites/blocked" <Directory /sites/blocked> Options Indexes FollowSymLinks Multiviews AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost> 这工作正常。 但是现在我想让第一个域名路由到我正在服务的网站(运行XAMPP)。 这适用于将所有域路由到我的开发站点: <VirtualHost *:80> DocumentRoot "/sites/developmentsite.com" ServerName developmentsite.com ServerAlias developmentsite.com <Directory /sites/developmentsite.com> Options Indexes FollowSymLinks Multiviews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog "/sites/logs/developmentsite.com/error_log" CustomLog […]
在Apache 2.2.22中,我尝试运行两个具有两个IP地址和两个SSL证书的虚拟主机。 在configuration虚拟主机的文件以外的任何其他configuration文件中,我没有关于监听端口或NameVirtualHost的信息。 在这个工作的过程中,我希望有最less量的代码。 在site-available目录中,我有site1.com的configuration文件: NameVirtualHost 1.1.1.1:80 Listen 1.1.1.1:80 Listen 1.1.1.1:443 <VirtualHost 1.1.1.1:80> ServerAdmin [email protected] ServerName site1.com ServerAlias www.site1.com RewriteEngine On RewriteCond %{SERVER_PORT} !443 RewriteRule (.*) https://www.site1.com/ [R] </VirtualHost> <VirtualHost 1.1.1.1:443> ServerName site1.com ServerAlias www.site1.com DocumentRoot /home/j/site1/public SSLEngine On SSLCertificateFile /etc/apache2/ssl/site1.com.crt SSLCertificateKeyFile /etc/apache2/ssl/site1.com.key SSLCertificateChainFile /etc/apache2/ssl/gd_bundle_site1.crt LogLevel warn ErrorLog /home/j/site1/log/error.log CustomLog /home/j/site1/log/access.log combined </VirtualHost> 如果site1.com是唯一启用的站点,则服务器启动正常。 当我启用site2.com时,我遇到了麻烦。 […]
我的电脑上安装了LAMP,没有任何问题。 我可以去http://localhost ,它会默认显示/var/www的内容。 有没有办法添加新的“域”参考本地主机? 例如,我可以做一个http://johndesktop ,并指向/home/john/Desktop文件夹? 我只想使用“localhost”这个词。
我正在用Apache2,MySQL,PHPconfiguration一个VPS。 主要网站工作正常。 然后我去创build一个带有子域名的networking邮件。 每当有人浏览webmail.mydomain.com,他或她应该有Webmaillogin屏幕。 我创build了另一个虚拟主机,并通过a2ensite启用它。 然后重新加载Apache。 同时,我认为这将是很好的重新启动Apache,所以我重新启动它,但它不重新启动。 然后我禁用了webmail虚拟主机,一切正常! 这是我的主要网站的原始虚拟主机文件, <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName www.mydomain.com ServerAlias mydomain.com www.mydomain.com DirectoryIndex index.html, index.php DocumentRoot /sites/bswapit LogLevel warn ErrorLog /sites/bswapit/log/error.log CustomLog /sites/bswapit/log/access.log combined <Directory /> Options FollowSymLinks AllowOverride ALL </Directory> <Directory /sites/bswapit/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> AccessFileName .htaccess ScriptAlias /cgi-bin/ […]
我有两个应用程序:HTML + JS前端和PHP后端。 我想设置Nginx,以便两者都从同一个域中提供。 对后端的请求使用以/api开头的URL。 我的尝试是这样的: server { root /path/to/frontend; index index.html; server_name example.com; location / { try_files $uri $uri/ /index.html; } location /api { alias /path/to/backend; index index.php; try_files $uri $uri/ /index.php; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } } 但是,对于后端的所有请求,我最终得到一个404:主脚本未知。 有没有办法实现我在这里要做的事情? 怎么样?
我正在学习如何设置自己的networking和邮件服务器,而且我几天来一直对这个问题感到困惑,而在线文章(包括服务器故障)似乎与他们对“子域名”和“主机名'。 从我的理解: 主机名称唯一标识networking中的计算机 域和子域必须具有指向一个或多个主机的DNS Alogging 假设我的web服务器是1.2.3.4 ,我的主机名设置为development (通过在bash shell中运行hostname来确认),并且我正在设置Alogging,如下所示: @ -> 1.2.3.4 www -> 1.2.3.4 mx -> 1.2.3.4 mx -> 9.8.7.6 然后我有www和mx子域指向我的web服务器的主机名是development 。 mx子目录也指向两个主机(为了冗余)。 为什么我需要一个主机名? 我的机器已经可以使用其IP地址来识别。 我读的地方说,主机名是重要的,因为它被发送到一些消息。 但是,如果我的服务器既是邮件服务器,文件服务器,数据库服务器等,我应该设置我的主机名是什么? 我当然不希望有人收到我的邮件看到development地址。 一台机器只能有一个主机名? 我应该将电脑的hostname设置为abc.example.com还是abc ? 主要问题 如果在同一台机器上托pipe多个服务器,如何设置主机名?
我试图全局禁用access_log和log_not_found所有静态内容和所有运行在同一个nginx实例上的虚拟主机。 为了pipe理服务器块中的全局设置,我在每个虚拟主机的服务器块中都包含一个global/restrictions.conf 。 虚拟主机的configuration如下所示: server { listen 1.2.3.4:80; server_name domain.com *.domain.com; access_log /var/domains/domain.com-access.log combined; error_log /var/domains/domain.com-error.log error; root /var/www/domain.com/; location / { index index.php index.html index.htm; try_files $uri $uri/ @rewrites; } location @rewrites { rewrite ^ /index.php last; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/domain.com-php-fpm.socket; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; […]