Articles of 虚拟主机

虚拟服务器不工作,如果我使用www而不是只是域

我有两个域名 Domain1使用IP1 ,而Domain2使用IP2 ,但它们都指向相同的VPS。 如果我去domain1.com ,我得到它的工作,但是去www.domain1.com卡在加载屏幕上,最终说Oops! Google Chrome could not find www.domain1.com! Oops! Google Chrome could not find www.domain1.com! 。 它在Firefox和IE中也是如此。 当它加载时,它说在我的屏幕底部的Resolving Host (在Firefox中,它说Looking Up www.Domain1.com )。 我遵循这个教程的信。 基本上: 1)制作一个public_html目录 2)运行chmod给755 perms 3)创build一个索引文件 4)运行命令cp /etc/apache2/sites-available/default /etc/apache2/sites-available/domain1.com 5)使用nano编辑所述文件 6)制作这个文件: <VirtualHost *:80> ServerAdmin [email protected] ServerName domain1.com ServerAlias www.domain1.com DocumentRoot /var/www/domain1.com/public_html </VirtualHost> 7)运行a2ensite domain1.com 8)重新启动apache

Apache限制/ var / www子目录访问

我有2个虚拟主机,它们正在查看/var/www/site1 (ServerName site1 )和/var/www/site2 (ServerName site2 )。 我想通过在默认configuration( 000-default.conf )中设置一个重写规则来使我的站点不能被http://1.2.3.4/site1或http://1.2.3.4/site2使用: RewriteEngine On RewriteCond %{HTTP_HOST} ^1\.2\.3\.4 RewriteRule (.*) http://test.com/$1 [R=301,L] 但网站仍然可以在http://1.2.3.4/site1和http://1.2.3.4/site1 (虽然redirect工程http://1.2.3.4/ )。 我究竟做错了什么?

虚拟化的Fedora 20性能不佳20

我有一个Fedora 20操作系统在多台虚拟机共享的主机上运行的性能不佳的问题。 所有的操作,如打字,打开菜单等有3秒或更长的延迟。 它看起来像操作系统没有足够的内存,但我可以看到没有区别在512MB – 4GB的RAM大小设置的差异。 我已经安装了VMware工具。 其他虚拟机运行平稳(1x Win7,2x Ubuntu),主机上剩余大量可用RAM(5GB +)。 在将我的PC转换到vSphere客户端之前,Fedora VM运行良好。 我在Debian 7上做了相同的过程,在Fedora 20被replace之前,它运行的很顺利,所以我想这个问题是在Fedora OS本身。 我试图增加video内存,并将Gnome3更改为Gnome classic和KDE,但取得了一些成功。 哪里可以解决问题?

apacheconfiguration – 列出的虚拟主机项目,但无法find

我使用Ubuntu 14.04,由tasksel安装Apache。 apache2ctl -S表示www.ijiameng.com存在于不同的conf文件中,默认的优先级较高,如下所示: sunjizu@HP-Pavilion-g4-Notebook-PC:~$ apache2ctl -S VirtualHost configuration: *:80 is a NameVirtualHost default server www.ijiameng.net (/etc/apache2/sites-enabled/000-default.conf:1) port 80 namevhost www.ijiameng.net (/etc/apache2/sites-enabled/000-default.conf:1) port 80 namevhost foo.my (/etc/apache2/sites-enabled/foo.my.conf:1) port 80 namevhost www.ijiameng.net (/etc/apache2/sites-enabled/ijiameng.net.conf:1) alias ijiameng.net ServerRoot: "/etc/apache2" Main DocumentRoot: "/var/www" 但是/etc/apache2/sites-enabled/000-default.conf不包含与www.ijiameng.com相关的任何内容,如下所示: sunjizu@HP-Pavilion-g4-Notebook-PC:/etc/apache2/sites-enabled$ cat 000-default.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # […]

Apache服务器:IP地址路由到域而不是DocumentRoot

我的服务器只有一个网站。 我的愿望是打开不同的目录时,IP地址被用作网页浏览器的URL。 但是,即使将DocumentRoot设置为不同的目录,IP地址也会打开我的domain.com。 如果我删除该domain.com的.conf文件,则IP地址按预期打开DocumentRoot。 这是我的configuration: conf.d / domain.com.conf文件 <VirtualHost *:80> DocumentRoot /var/www/html/domaincom ServerName domain.com ServerAlias www.domain.com <Directory "/var/www/html/domaincom"> AllowOverride All </Directory> </VirtualHost> conf / httpd.conf文件 ServerTokens OS ServerRoot "/etc/httpd" PidFile run/httpd.pid Timeout 60 KeepAlive Off MaxKeepAliveRequests 100 KeepAliveTimeout 15 <IfModule prefork.c> StartServers 8 MinSpareServers 5 MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 4000 </IfModule> <IfModule […]

用virtfs过度使用磁盘

我正在运行启用了virtfs的服务器,并且与每个用户实际上传/创build的数据量相比,磁盘使用量非常高。 我得到DISKWARN电子邮件告诉我,我几乎所有的可用空间,但我不明白为什么。 我跑了du -h / | grep "[0-9][MG]" | sort -n -r du -h / | grep "[0-9][MG]" | sort -n -r du -h / | grep "[0-9][MG]" | sort -n -r生成使用最多空间的path列表。 这是输出: 68G / 44G /home 43G /home/virtfs 11G /home/virtfs/john 11G /home/virtfs/paul 11G /home/virtfs/george 11G /home/virtfs/ringo 11G /backup 5.3G /usr 5.3G /home/virtfs/john/usr 5.3G /home/virtfs/paul/usr […]

在apache虚拟主机文件中的通配符替代

我正在尝试设置一个将xyz.mycompany.com路由到/ var / www / html / development / xyz / public的apache虚拟主机文件 这是我的硬编码版本。 有没有办法用variables交换“xyz”? <VirtualHost *:80> ServerName xyz.mycompany.com ServerAlias xyz.mycompany.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html/development/xyz/public ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory /var/www/html/development/xyz> AllowOverride All Options -Indexes +FollowSymLinks +MultiViews Order allow,deny Allow from all </Directory> </VirtualHost>

基于特定IP地址的基于名称的虚拟主机

Apache虚拟主机文档说: You can alternatively specify an explicit IP address in place of the * in <VirtualHost *:80> directives. For example, you might want to do this in order to run some name-based virtual hosts on one IP address, and either IP-based, or another set of name-based virtual hosts on another address. 这些虚拟主机块在明显有1个IP地址的服务器上执行。 为什么有必要在这些VirtualHost指令中提及不同的IP地址? 谢谢

Arch-linux Apache 404 mod_rewrite带有url后缀的VirtualHost

Arch-Linux上的Apache有问题。 我认为这是相关的mod_rewrite,但我不知道。 过去我一直使用基于Debian的系统。 拱似乎有点不同。 我有一个这样的虚拟主机,并在各自的目录index.php。 我尝试了和没有.htaccess。 <VirtualHost *:80> ServerName test.localhost DocumentRoot /home/me/sites/test <Directory /home/me/sites/test> Options FollowSymLinks AllowOverride All </Directory> </VirtualHost> 当我访问http://test.localhost/或http://test.localhost/index.php ,它工作正常。 当我访问http://test.localhost/foo ,它找不到404。 我可以用ErrorDocument 404 /index.php添加一个.htaccess,所以Apache会打开index.php并正确的遵循.htaccess的mod_rewrite指令,但是它仍然有404头文件。 任何想法要寻找什么?

NGINX与“serverpool”作为不同的域在相同的Apache服务器的LB?

我有nginx作为LB. 而2阿帕奇作为networking服务器。 比方说,我有不同的领域: www.example.com checkout.example.com 两个域将在同一个Apache服务器上。 但是在不同的目录下。 以及Apache vhost文件上的不同VHost文件。 像下面这样的devise: Nginx | ————- | | Apache Apache 下面是我现有的Nginx .conf文件,它不适用于第二个域(checkout.example.com)。 来自NGINX(mysites.conf): upstream serverpool { server 1.2.3.101:80 weight=1; server 1.2.3.102:80 weight=1; } server { listen 80; server_name www.example.com checkout.example.com; location / { proxy_pass http://serverpool; } } 从两个Apache服务器的相同的 Vhost文件(httpd.conf): <VirtualHost *:80> ServerName www.example.com DocumentRoot /var/www/html/www.example.com/ </VirtualHost> <VirtualHost *:80> […]