我是 Ubuntu 操作系统的新手,但需要学习。我有一个网站位于基于 Ubuntu 20.04 的旧 VPS 上,需要将所有项目迁移到基于相同操作系统的新 VPS:
- 首先,我将整个网站从旧 VPS 推送到 GITHUB
- 第二,我将网站从 GITHUB 拉到新的 VPS
- 我从旧 VPS 备份数据库,然后将其还原到新服务器
- 我配置了 apache2 虚拟主机
- 我停用默认主机并激活新域名
但是,即使停用默认域后,我也无法再访问新域。请注意,在旧 VPS 中,有主域和子域。为了不让旧域瘫痪,我决定先将子域迁移到新 VPS,这样做有意义吗?
来自新 VPS 的日志:
ubuntu@ns3207232:/etc/apache2/sites-enabled$ ls -la
total 8
drwxr-xr-x 2 ubuntu root 4096 Apr 4 16:15 .
drwxr-xr-x 8 ubuntu root 4096 Mar 31 07:34 ..
lrwxrwxrwx 1 root root 48 Apr 4 08:01 preprod.ileodiamants.com.conf -> ../sites-available/preprod.ileodiamants.com.conf
ubuntu@ns3207232:/etc/apache2/sites-enabled$
ubuntu@ns3207232:/var/www/ileodiamants$ ls
preprod prod
ubuntu@ns3207232:/var/www/ileodiamants$
可用站点
ubuntu@ns3207232:/etc/apache2/sites-available$ ls
000-default.conf default-ssl.conf preprod.ileodiamants.com.conf
ubuntu@ns3207232:/etc/apache2/sites-available$
ServerName preprod.ileodiamants.com
ServerAlias preprod.mweziuwalia.com
DocumentRoot /var/www/ileodiamants/preprod
<Directory /var/www/ileodiamants/preprod/>
Require all granted
AllowOverride All
Order deny,allow
Allow from all
</Directory>
来自旧 VPS 的日志:
ubuntu@vps-e4382155:/etc/apache2/sites-enabled$ ls -la
total 8
drwxr-xr-x 2 root root 4096 Apr 6 06:11 .
drwxr-xr-x 8 root root 4096 Mar 29 12:13 ..
lrwxrwxrwx 1 root root 40 Oct 3 2020 ileodiamants.com.conf -> ../sites-available/ileodiamants.com.conf
ubuntu@vps-e4382155:/etc/apache2/sites-enabled$
域名 WWWW
ubuntu@vps-e4382155:/var/www$ cd ileodiamants
ubuntu@vps-e4382155:/var/www/ileodiamants$ ls
preprod prod
ubuntu@vps-e4382155:/var/www/ileodiamants$
可用站点
ubuntu@vps-e4382155:/etc/apache2/sites-available$ ls
000-default.conf default-ssl.conf ileodiamants.com.conf preprod.ileodiamants.com.conf
ubuntu@vps-e4382155:/etc/apache2/sites-available$
ServerName preprod.ileodiamants.com
ServerAlias preprod.mweziuwalia.com
DocumentRoot /var/www/ileodiamants/preprod
<Directory /var/www/ileodiamants/preprod/>
Require all granted
AllowOverride All
Order deny,allow
Allow from all
</Directory>
<Directory /var/www/ileodiamants/preprod/>
Require all granted
AllowOverride All
Order deny,allow
Allow from all
</Directory>