我有一个Apache 2.2服务器(运行Debian Squeeze),有4个站点在那里运行。 我使用基于名称的虚拟主机,因为我有一个IP。 Webmin已经完成了初始configuration,可能有些东西已经搞乱了。 firstdomain.com是我的默认域,并正常工作,seconddomain.com是另一个正在工作的网站。 现在我想添加lastdomain.tk作为一个新的网站,所以我做了这个configuration文件: root@webamp:/etc/apache2# cat sites-available/lastdomain.tk.conf <VirtualHost *:80> DocumentRoot /home/server/Condivisione/RAID/lastdomain.tk ServerName www.alazanes.tk ServerAlias alazanes.tk </VirtualHost> 我已经添加到启用网站,并重新启动Apache。 问题是,如果我去lastdomain.tk(或www.lastdomain.tk)我redirect到firstdomain.com 301redirect。 lastdomain.tk和www.lastdomain.tk都是指向我的IP地址的DNSlogging。 奇怪的是,如果更改了lastdomain.tk的DocumentRoot DocumentRoot /home/server/Condivisione/RAID/Sito_SecondDomain 我正确地看到seconddomain.com内容没有被redirect(lastdomain.tk显示在地址栏上) 这些是我正在使用的其他configuration。 root@webamp:/root# source /etc/apache2/envvars ; /usr/sbin/apache2 -S VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:443 webamp.firstdomain.com (/etc/apache2/sites-enabled/ssl.bbteam:1) *:80 is a NameVirtualHost default server firstdomain.com (/etc/apache2/sites-enabled/000-default:7) port 80 namevhost […]
我为每个域/虚拟主机configuration了一个CacheRoot目录的Apache: <VirtualHost> ServerName domain1.tld … CacheRoot /var/www/vhosts/domain1.tld/httpdocs/cache … </VirtualHost> <VirtualHost> ServerName domain2.tld … CacheRoot /var/www/vhosts/domain2.tld/httpdocs/cache … </VirtualHost> 我有这个运行了一段时间,所以票价工作得很好,除了我必须经常手动清空caching,因为htcacheclean不知道不同的目录。 现在我想设置htcacheclean来监视caching目录,但作为我知道手册的票价,我只能将其设置为一个caching目录。 我想要做这样的事情,但这是行不通的: <VirtualHost> ServerName domain1.tld … CacheRoot /var/www/vhosts/domain1.tld/httpdocs/cache htcacheclean -n -t -p/var/www/vhosts/domain1.tld/httpdocs/cache -l1024M … </VirtualHost> 拥有多个caching导航器还是应该使用所有域的一个caching目录?
我正在尝试使用mod_proxy_ajp将来自tocat.example.com的所有请求转发到example.com:8080这里是tomcat server.xml的样子: <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> 这里是apache.confconfiguration: <VirtualHost *:80> ServerName tomcat.example.com ServerAdmin [email protected] ErrorLog logs/tomcat.example.com-error_log CustomLog logs/tomcat.example.com-access_log common <Proxy *> AddDefaultCharset Off Order deny,allow Allow from all </Proxy> ProxyPass / ajp://example:8009/ ProxyPassReverse / ajp://example:8009/ </VirtualHost> 但它不工作,有什么想法?
我有一个运行VirtualBox的Ubuntu 12.04系统。 我安装了Windows XP作为一个虚拟机,它的工作完美。 我configuration文件共享,这工作正常。 我也可以在主机上的Internet Explorer中键入我的主机的IP,并在主机上的Apache提供默认的“It Works”默认页面的响应。 默认情况下,当我在浏览器中键入IP地址时,如http://10.10.10.10 ,主机Apache服务器将使用/ var / www来处理请求。 如果我input: http : //10.10.10.10/dev它会得到/ var / www / dev这是我所期望的。 现在的棘手的部分,我无法find解决scheme。 我试图能够做的是,而不是键入: http : //10.10.10.10/dev/mysite/httpdocs/我可以只键入http://mysite.dev ,它将路由就像一个虚拟主机。 我目前在我的Ubuntu主机上有一个像这样的虚拟主机设置,它可以在主机上的浏览器中正常工作,但是在客户操作系统(Windows XP)中不能正常工作。 如果我在虚拟机/访客浏览器中键入虚拟主机URL,它将只返回默认的/ var / www / 。 [新增信息]我需要这个function,所以我可以在IE浏览器中testingweb应用程序。 应用程序通常使用相对链接来进行资源和URL重写,而这些链接无法用完整的文件path正确parsing,而需要使用域名 root。 任何帮助,将不胜感激。 [请求的文件] 主机操作系统(Ubuntu 12.04) httpd.conf: NameVirtualHost *:80 /etc/apache2/sites-enabled/webapp.dev:http://pastebin.com/dtfXmM4i / etc / hosts: http : //pastebin.com/8G3ULbGs .htaccess: […]
Apache的NameVirtualHost已经在httpd.conf中configuration好了: NameVirtualHost *:80 然而,尽pipeVHconfiguration看起来正确,但这些站点仍然默认为第一个虚拟主机。 他们都遵循以下模板(其中“site1”是网站的名称): <VirtualHost *:80> ServerName site1.domain.com DocumentRoot /var/www/site1/public <Location /> AuthName "Login Required" AuthType Basic AuthUserFile /var/www/site1/private/htpasswd Require valid-user </Location> </VirtualHost> Conf检查显示没有语法错误,并重新启动Apache不会产生任何错误。 坦率地说,我有点难住。 configuration设置是一样的其他服务器,但只有这一个有这个问题。 还有什么我可以检查?
我正在尝试向nginx添加第二个域。 可以访问domain2.com中的css这样的静态文件,但访问php脚本(例如domain2.com/index.php)将302redirect到domain1.com(例如domain1.com/index.php),所以我认为中断点必须在location ~ \.php$部分,但我不能确定它在哪里。 我被困在这里很长一段时间,我在哪里做错了? [操作系统:Windows 2008; Nginx的:1.0.12] nginx.conf worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; client_max_body_size 50m; gzip on; server { listen 80; server_name _; server_name_in_redirect off; location / { root F:/Web/nginx/html/; index index.html; } } include F:/Web/nginx/vhosts/*.conf; } F:/Web/nginx/vhosts/domain1.com.conf server { listen 80; […]
使用yum我想安装php-gd库,但是有一个与php-common相关的问题阻止我安装php-gd 。 所以经过一些挖掘,我发现这篇文章 。 我遵循指示,并删除了php-common 。 然后我重新安装了php-common 。 之后,我可以毫无问题地安装php-gd 。 但是,我试图加载我的网站,我发现虚拟主机文件不被parsing,只有默认网站出现。 即使我呱呱叫PHP安装,我不认为这会搞砸虚拟主机。 还是会呢? 谢谢。
现在我已经挣扎了5个多小时了,我似乎无法find解决问题的方法。 基本上,我在Fedora Core服务器上(在自定义端口55555上)设置了虚拟主机。 任何时候我尝试通过input浏览器访问php文件例如111.111.111.111:55555/somefile.php浏览器强制此文件下载。 我想要parsingphp文件。 以下是我的httpd.conf附加部分: Listen 55555 <VirtualHost *:55555> DocumentRoot "/var/www/vhosts/example.com/httpdocs/app/" ServerName 111.111.111.111:55555 CustomLog "/var/log/app/access.log" combined ErrorLog "/var/log/app/error.log" <Directory "/var/www/vhosts/example.com/httpdocs/app/"> Options Indexes MultiViews FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> 任何人都知道为什么PHP文件被迫下载和如何parsing它们? 那么,关键是,当我build立在plesk下的PHP文件parsing没有任何问题。 在httpd.conf中,只有3行提到phpconfiguration: DirectoryIndex at_domains_index.html index.html index.html.var index.shtml index.cfm index.php index.htm index AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps 在php.conf文件的conf.d文件夹中,我有以下内容: # # […]
我正在LAM开发一个项目,并使用Symfony框架。 我有一个静态IP,如99.99.99.99:8000 ,它指向我的Linux服务器机器。 这个静态IP已经有8000端口号。 这个Linux服务器机器上有多个托pipe的项目,我们使用abc:81,pqr:82,xyz:83等不同的端口号访问局域网中的每个项目。 通过这个静态IP可以访问同一台Linux机器上的每个项目吗? 如果是,那么请让我知道如何使用这个IP地址来configuration和调用每个项目。
我正在尝试在Apache中设置2个虚拟主机条目,但是我不知道如何完成我想要做的事情。 我有两个域名,都指向相同的IP地址。 我需要DirectoryIndex是不同的,这几乎是条目中的唯一区别。 我有以下设置: <VirtualHost *:80> ServerName firstdomain.com ServerAdmin [email protected] DocumentRoot "/srv/www" DirectoryIndex /portals/site/index.html </VirtualHost> <VirtualHost *:80> ServerName seconddomain.com ServerAdmin [email protected] DocumentRoot "/srv/www" DirectoryIndex /portals/site/index_fr.html </VirtualHost> 不知道我需要做什么不同,但第二项不起作用。 唯一真正的区别是我需要第二个域指向一个不同的DirectoryIndex 。 如果有更好的方法来实现这一点,将不胜感激。