【发布时间】:2023-04-03 21:04:01
【问题描述】:
我有一个Laravel 应用程序,我正在尝试为其创建一个virtual host。这是.conf 文件:
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName todo-app.test
ServerAlias www.todo-app.test
DocumentRoot /var/www/html/vuejs/todo-laravel/public
<Directory "/var/www/html/vuejs/todo-laravel">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
RewriteEngine On
</Directory>
LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
这是hosts 文件:
127.0.0.1 localhost
127.0.1.1 titan
127.0.0.1 todo-app.test
当我在浏览器中访问应用程序时,我会得到 index.php 文件的内容,而不是启动应用程序。这里出了什么问题?
我在Laravel 8.40 和Ubuntu 18.04。
编辑:
当我做php artisan serve 时,它适用于这个地址,todo-app.test:8000,但我不想要这里的端口。怎么办?
【问题讨论】:
标签: php ubuntu apache2 virtualhost laravel-8