LAMP stack (Ubuntu1804) 无法从 XAMPP 执行 Source web (Windows 10)

LAMP stack (Ubuntu1804) can not execute Source web from XAMPP (Windows 10)

我设置了一个完整的LAMP,用加载phpinfo()测试,它可以正常工作。但是当我将源网站从 XAMPP (htdocs/news) 复制到 /var/www/ 时。然后我在 Apache2 配置中创建一个新的虚拟主机,名称为 news.conf 并启用该站点 (a2ensite news.conf),我已经将数据库导入到 MySQL。但是,它似乎无法显示该网站(请参阅我的附件)。 有人可以给我一些建议吗? ps:我正在使用 Ubuntu 18.04 bionic,以及 php7.2,PHP

我在 运行 时得到的错误屏幕:

我的配置如下:

Apache2 虚拟主机

<VirtualHost *:8080>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/news
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

/etc/apache2/apache2.conf
DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
 Options FollowSymLinks
 AllowOverride All
 Require all denied
</Directory>
<Directory /usr/share>
 AllowOverride All
 Require all granted
</Directory>
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
 Require all denied
</FilesMatch>
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf

  • 确保服务器可以读取和写入文件(例如:如果您的源代码是 laravel,则在存储文件夹中)
  • 检查主机文件(/etc/hosts)
  • 读取 apache 日志文件。