我在我的笔记本电脑上使用Ubuntu 10.10。 我将以下内容添加到/etc/apache2/httpd.conf NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot "/var/www/square/public" ServerName square.localhost </VirtualHost> 并重新启动Apache。 我去http://square.localhost/ ,它提供了一个错误,告诉服务器没有find。 有谁能告诉我如何在Ubuntu上定义虚拟主机设置吗? 提前致谢。
我有一个Web服务器和一个应用程序服务器。 Webserver1有FreeBSD 8.1,Apache,MySQL和PHP。 Application1服务器有Centos 5.5,Apache,Mysql和PHP。 两台服务器独立运行良好。 我的webserver1正在托pipe我的公司网站www.azrim.com,运行良好。 此外,我有2个在线应用程序,这需要我作为一个子域名托pipe他们。 我的问题是我想要使子域名,如abc.azrim.com和xyz.azrim.com可从Application1服务器访问。 任何人都可以帮助我这个。 我应该如何在webserver1和Apps1服务器上configurationapachesconfiguration。 我的Apps1服务器上只有1个NIC卡。 非常感谢任何获得解决scheme的人。 感谢Azrim
我有许多Apache VirtualHosts,我使用专用的SSLCertificateFile。 这是一个VirtualHost的configuration示例: <VirtualHost *:443> ServerName subdomain.domain.localhost DocumentRoot "/Users/<my_user_name>/Sites/users/public" RackEnv development <Directory "/Users/<my_user_name>/Sites/users/publ`enter code here`ic"> Order allow,deny Allow from all </Directory> # SSL Configuration SSLEngine on #Self Signed certificates SSLCertificateFile /private/etc/apache2/ssl/server.crt SSLCertificateKeyFile /private/etc/apache2/ssl/server.key SSLCertificateChainFile /private/etc/apache2/ssl/ca.crt </VirtualHost> 由于我使用Passenger Preference Pane维护了更多的Ruby on Rails应用程序,因此这是apache2 httpd.conf文件的一部分: <IfModule passenger_module> NameVirtualHost *:80 <VirtualHost *:80> ServerName _default_ </VirtualHost> Include /private/etc/apache2/passenger_pane_vhosts/*.conf </IfModule> 我可以为所有的VirtualHost使用单一的SSLCertificateFile(我听说过通配符),而不是为每个VirtualHost创build一个? […]
背景 我有一个由CakePHP安装和Magento安装组成的客户端站点: /web/example.com/ /web/example.com/app/ <== CakePHP /web/example.com/app/webroot/ <== DocumentRoot /web/example.com/app/webroot/store/ <== Magento /web/example.com/config/ <== Site-wide config /web/example.com/vendors/ <== Site-wide libraries 服务器运行Apache 2.2.3。 问题 整个公司都有FTP访问权限,并习惯于阻塞/web/example.com/app/webroot/和/web/example.com/app/webroot/store/目录自己的文件。 有时这些文件需要HTTP访问,有时候不需要。 无论如何,这种混乱让我的工作更难维护网站。 代码合并,tar实时代码等,是非常复杂的,通常需要一堆filter。 被遗弃的解决scheme 起初,我以为我会在同一台服务器上build立一个新的子域名,将其所有文件移动到那里,然后更改他们的FTP chroot。 但是,这不会因为这些原因: 首先,我不知道(他们也不记得)他们发送的哪些营销材料包含URL,这些材料包含他们上传到服务器的某些资源,使用主域,还使用了使用主要虚拟的抽象子域主机,因为它具有ServerAlias *.example.com 。 所以突然让他们只使用static.example.com是不可行的。 其次,他们的项目中的PHP脚本可能是非常不便携的。 我希望他们的文件保持在与我所能build立的环境类似的环境中。 此外,我不想debugging他们的代码,使其便携式。 一半的解决scheme 经过一番思考,我决定find一种方法,把实际的网站文件分割成另一个他们不会碰到的目录。 公司上传的文件将保持在原来的位置。 这将确保我没有破坏任何需要HTTP访问的项目。 它看起来像这样: /web/example.com/ <== A bunch of their files are in here /web/example.com/app/webroot/ <== […]
我一直在使用munin和monit来监视我的web服务器的总体细节,但是因为它托pipe了多个站点,所以我想知道如何监视每域托pipe的或类似的东西。 我希望看到的主要统计数据是每个域/虚拟主机的带宽,内存和磁盘使用情况。
我在我自己的服务器上运行OSX 10.6.6托pipe我的网站。 www2.chrislrobinson.co.uk指向我的IP地址(因此/ Library / WebServer / Documents /目录),我有主站点一切正常。 我的博客位于www2.chrislrobinson.co.uk/blog,但我想补充通过blog.chrislrobinson.co.uk访问它。 我的理解是,我需要启用虚拟主机,但我似乎无法让它正常工作。 到目前为止,我已经在/private/etc/apache2/httpd.conf启用了虚拟主机位。 我已经添加 <VirtualHost *:80> DocumentRoot "Library/WebServer/Documents/blog" ServerName blog.chrislrobinson.co.uk </VirtualHost> 到/private/etc/apache2/extra/httpd-vhosts.conf和 127.0.0.1 blog.chrislrobinson.co.uk 到/private/etc/hosts 。 重新启动apache后,不仅blog.chrislrobinson.co.uk不工作,但我得到的消息 禁止您没有权限访问/博客/在这台服务器上。 我会很感激任何帮助,你们可以给。 谢谢Chris
在运行Drupal的域名上,我需要将旧版urlhttp://www.example.com/?group=exampleredirect到http://www.example.com/support-request 。 我尝试使用Drupal的全局redirect模块,但它似乎并没有工作; 我猜是因为/?group = example不是Drupal期望的格式。 有没有一个Drupal模块来处理这种redirect? 或者我该如何处理Apache vhost文件中的redirect呢?
Windows 7主机文件… 127.0.0.1 www.test.com httpd-vhosts文件… MY-IP-IS-HERE是我的实际IP … NameVirtualHost MY-IP-IS-HERE <VirtualHost MY-IP-IS-HERE> ServerName test.com DocumentRoot "E:/Web Server/xampp/htdocs/test/ajaxblog" DirectoryIndex index.php index.html index.html index.htm index.shtml </VirtualHost> 由于某种原因,当我去test.com或www.test.com它加载E:/ Web服务器/ xampp / htdocs /而不是加载E:/ Web服务器/ xampp / htdocs /testing/ ajaxblog ,我无法弄清楚如何让虚拟主机加载任何更深,然后我的根目录。 难道我做错了什么? 我在Windows 7上使用Apache或Xampp
好,所以我有一个服务器,我想把几个应用程序,我有虚拟主机configuration问题。 这是我有什么,我想要什么我做错了一些方向…好,所以第一个文件是/etc/apache2/ports.conf NameVirtualHost 184.106.111.142:80 Listen 80 <IfModule mod_ssl.c> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> 那么我有/etc/apache2/sites-available/somesite.com <VirtualHost 184.106.111.142:80> ServerAdmin [email protected] ServerName somesite.com ServerAlias www.somesite.com DocumentRoot /srv/www/somesite.com/ ErrorLog /srv/www/somesite.com/logs/error.log CustomLog /srv/www/somesite.com/logs/access.log combined <Directory "/srv/www/somesite.com/"> AllowOverride all Options -MultiViews </Directory> </VirtualHost> 当我访问somesite.com一切都很好,但是当我添加另一个虚拟主机,并可以说这就是那个叫anothersite.com。 所以我有/etc/apache2/sites-available/anothersite.com <VirtualHost 184.106.111.142:80> ServerAdmin [email protected] ServerName anothersite.com ServerAlias www.anothersite.com DocumentRoot /srv/www/anothersite.com/ ErrorLog /srv/www/anothersite.com/logs/error.log CustomLog […]
我只是在这里教程。 它在那里说: 这将在sites-available目录中为Nginx创build虚拟主机文件。 只需将以下内容粘贴到文件中,并将“example.com”的每个实例更改为您网站的域名: server { listen 80; server_name www.example.com; rewrite ^/(.*) http://example.com/$1 permanent; } server { listen 80; server_name example.com; access_log /var/www/example.com/logs/access.log; error_log /var/www/example.com/logs/error.log; location / { root /var/www/example.com/public/; index index.html; } } 问题是,我没有域名,我有一个IP地址…所以我应该怎么改变example.com? 我试图将其更改为我的IP地址,但它不起作用