在Ubuntu Stream 8上搭建Web服务器,可选择Apache或Nginx,以下是具体步骤:
sudo apt update更新软件包列表,再执行sudo apt install apache2安装Apache。sudo systemctl start apache2启动服务。sudo ufw allow 'Apache'。/var/www/html目录下。/etc/apache2/sites-available目录下创建配置文件,如example.com.conf,添加相关配置后,执行sudo a2ensite example.com.conf启用该配置,再执行sudo systemctl reload apache2重新加载配置。sudo apt update和sudo apt install nginx。sudo systemctl start nginx启动Nginx服务。sudo ufw allow 'Nginx'。/var/www/html目录。/etc/nginx/sites-available目录下创建如example.com.conf的配置文件,添加配置后,执行sudo ln -s /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-enabled/启用,再执行sudo nginx -t测试配置,最后执行sudo systemctl reload nginx重新加载配置。