虚拟主机问题。有两个虚拟主机文件,但结果出乎意料,第二个站点未正确加载
Virtualhost problems. Have two vhost files but results are unexpected 2nd site does not load properly
我有 1 个来自 DO 的 ubuntu 14.04 服务器和两个独立的 WordPress 安装 我正在尝试 运行 关闭同一台服务器
有两个 apache vhost 配置文件:
000-default.conf and 001-default.conf
现在导航到 domain1.com
时一切正常。整个网站都按预期工作。但是转到 domain2.com
会出现问题,它会自动重定向到 domain1.com
。基本上问题是我无法在 domain2.com
进入 WordPress 安装屏幕
这是 domain1.com (000-default.conf) 可用站点下的 conf 文件:
<VirtualHost *:80>
ServerAdmin email@gmail.com
ServerName domain1.com
ServerAlias www.domain1.com
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
domain2.com(001-default.conf)的配置文件:
<VirtualHost *:80>
ServerAdmin email@gmail.com
ServerName domain2.com
ServerAlias www.domain2.com
DocumentRoot /var/www/htmlposts
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/htmlposts>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
附加信息:
在 /var/www/html 中,我有 domain1.com 的 WordPress 文件,一切正常。
在 /var/www/htmlposts/ 我已经提取了 domain2.com 的 WordPress 文件
它看起来像这样:http://prntscr.com/d4h9gu
我在 /var/ww/htmlposts
中创建了一个 index.html 文件,这是 domain2.com
的目录,当我导航到 domain2.com/index.html
时,文件 displays as expected but when I navigate to domain2.com/wp-admin/install.php
which should start the wp installation process for instance #2 "domain2.com" it shows an already installed error which looks like this: http://prntscr.com/d4hhav
服务器上有两个数据库。一个用于 domain1.com,另一个数据库是我为 domain2.com 创建的空数据库。两者都正确指向各自的 wp-config.php 文件。
你能比较一下这两个网站的 config.php 吗?确保两个 config.php 文件中的数据库名称不同。
我有 1 个来自 DO 的 ubuntu 14.04 服务器和两个独立的 WordPress 安装 我正在尝试 运行 关闭同一台服务器
有两个 apache vhost 配置文件:
000-default.conf and 001-default.conf
现在导航到 domain1.com
时一切正常。整个网站都按预期工作。但是转到 domain2.com
会出现问题,它会自动重定向到 domain1.com
。基本上问题是我无法在 domain2.com
这是 domain1.com (000-default.conf) 可用站点下的 conf 文件:
<VirtualHost *:80>
ServerAdmin email@gmail.com
ServerName domain1.com
ServerAlias www.domain1.com
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
domain2.com(001-default.conf)的配置文件:
<VirtualHost *:80>
ServerAdmin email@gmail.com
ServerName domain2.com
ServerAlias www.domain2.com
DocumentRoot /var/www/htmlposts
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/htmlposts>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
附加信息: 在 /var/www/html 中,我有 domain1.com 的 WordPress 文件,一切正常。
在 /var/www/htmlposts/ 我已经提取了 domain2.com 的 WordPress 文件 它看起来像这样:http://prntscr.com/d4h9gu
我在 /var/ww/htmlposts
中创建了一个 index.html 文件,这是 domain2.com
的目录,当我导航到 domain2.com/index.html
时,文件 displays as expected but when I navigate to domain2.com/wp-admin/install.php
which should start the wp installation process for instance #2 "domain2.com" it shows an already installed error which looks like this: http://prntscr.com/d4hhav
服务器上有两个数据库。一个用于 domain1.com,另一个数据库是我为 domain2.com 创建的空数据库。两者都正确指向各自的 wp-config.php 文件。
你能比较一下这两个网站的 config.php 吗?确保两个 config.php 文件中的数据库名称不同。