简体   繁体   English

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

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

I set up a completely LAMP, test with load phpinfo(), it could work well.我设置了一个完整的 LAMP,使用负载 phpinfo() 进行测试,它可以正常工作。 But when i copy source web from XAMPP (htdocs/news) to /var/www/ .但是当我将源网页从 XAMPP (htdocs/news) 复制到 /var/www/ 时。 then I create a new virtual host in Apache2 configuration with name news.conf and enable this site (a2ensite news.conf), I already import database to MySQL already.然后我在 Apache2 配置中创建一个名为 news.conf 的新虚拟主机并启用该站点(a2ensite news.conf),我已经将数据库导入到 MySQL 中。 However, it seems that it could not show the website (plz see my attachment).但是,它似乎无法显示网站(请参阅我的附件)。 Can anybody give me some advice for my case?有人可以就我的情况给我一些建议吗? ps: I'm using Ubuntu 18.04 bionic, and php7.2, PHP ps:我使用的是 Ubuntu 18.04 仿生和 php7.2、PHP

error screen which I got when ran:我在运行时得到的错误屏幕:

错误画面

my configurations as below:我的配置如下:

Apache2 virtual host 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

  • Make sure the server can read and write files (ex: in storage folder if your source code is laravel)确保服务器可以读写文件(例如:如果您的源代码是 laravel,则在存储文件夹中)
  • Check hosts file(/etc/hosts)检查主机文件(/etc/hosts)
  • Read the apache log file.阅读 apache 日志文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM