This is an explanation of the video content.
 Everything to games
Let's make life more fun, so we convert everything to games.
113

 |   | 

修改 Apache2 的端口

单端口

vi /etc/apache2/ports.conf

修改 Listen 80 到需要的端口

vi /etc/apache2/sites-enabled/000-default.conf

更改<VirtualHost *:80> 为上一步修改的端口

然后重启服务,即可

service apache2 restart

多端口

比起单端口,大差不差,稍微麻烦些

第一步还是一样的,只不过多起一行或者说多行Listen 另一个端口

然后设置新的站点配置文件

cd /etc/apache2/sites-available/
cp 000-default.conf 新配置文件名.conf
vi 新配置文件名.conf

配置端口和新网站的根目录,根目录可如此设置:DocumentRoot /var/www/html2 ,html2 就是新站点根目录,当然你可以自定义

再就是建立软链接

ln -s 新的配置文件名.conf ../sites-enable/新的配置文件名.conf

这里,若不加 -s ,则是建立硬链接。软连接类似快捷方式,硬链接则是生成相同的原文件,但无论软硬链接,修改一方内容,另一方也会随之变化

最后,重启服务即可

systemctl restart apache2

113 ⚙️Backend ↦ Linux __ 58 字
 Linux #7