- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在将一个 laravel 应用程序部署到一个 ubuntu 虚拟机,经过一番头疼后它终于工作了,我可以在运行 php artisan serve
后看到 127.0.0.1:8000 中的网站! :)
但是,我尝试将地址从 localhost 更改为服务器的 IP。
我的 ´/etc/hosts` 文件如下所示:
127.0.0.1 localhost
132.231.36.101 laravel.dev
127.0.1.1 lehner-grund01
我还尝试将 127... 地址作为一个整体删除,但它并没有改变任何东西。
.env
文件我有这个:
APP_NAME=Laravel
APP_ENV=local
APP_KEY=<my_key>
APP_DEBUG=true
APP_URL=http://132.231.36.101
我尝试更改
ServeCommand.php
中的 IP文件以及 - 也没有工作。
conf
文件在
/etc/apache2/sites-available/
看起来像这样:
<VirtualHost *:8080>
ServerAdmin admin@example.com
ServerName laravel.dev
ServerAlias www.laravel.dev
DocumentRoot grup1/project/tose-gruppe-1/public
<Directory /home/user/projects/laravel_project/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
我尝试在运行
php artisan serve
时“手动”执行此操作像这样添加主机:
php artisan serve --host=<my_ip> --port
这是我第一次在 ubuntu 机器上部署一些东西,我已经完成了哈哈。现在尝试了七个小时,任何帮助表示赞赏!
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2022-01-05 21:43:04 UTC; 1h 59min ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 47274 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Process: 48577 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Main PID: 47278 (apache2)
Tasks: 8 (limit: 4575)
Memory: 17.2M
CGroup: /system.slice/apache2.service
├─47278 /usr/sbin/apache2 -k start
├─48581 /usr/sbin/apache2 -k start
├─48582 /usr/sbin/apache2 -k start
├─48583 /usr/sbin/apache2 -k start
├─48584 /usr/sbin/apache2 -k start
├─48585 /usr/sbin/apache2 -k start
├─48820 /usr/sbin/apache2 -k start
└─48826 /usr/sbin/apache2 -k start
Jan 05 21:43:04 lehner-tse01 systemd[1]: Starting The Apache HTTP Server...
Jan 05 21:43:04 lehner-tse01 apachectl[47277]: AH00112: Warning: DocumentRoot [/var/www/html/tose-gruppe-1/public] does not exist
Jan 05 21:43:04 lehner-tse01 systemd[1]: Started The Apache HTTP Server.
Jan 05 22:03:58 lehner-tse01 systemd[1]: Reloading The Apache HTTP Server.
Jan 05 22:03:58 lehner-tse01 apachectl[48580]: AH00112: Warning: DocumentRoot [/var/www/html/tose-gruppe-1/public] does not exist
Jan 05 22:03:58 lehner-tse01 apachectl[48580]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabl>
Jan 05 22:03:58 lehner-tse01 apachectl[48580]: AH00112: Warning: DocumentRoot [/etc/apache2/grup1/project/tose-gruppe-1/public] does not exist
Jan 05 22:03:58 lehner-tse01 systemd[1]: Reloaded The Apache HTTP Server.
我不明白为什么文档根目录是错误的,应该是正确的
最佳答案
APP_URL=http://132.231.36.101 不必更改为公共(public)地址,因为当您将端口 80 转发到您的服务器时,它会自动重定向到您的服务器。意思是它去本地主机。不需要公共(public)地址
关于php - 从 localhost 更改为服务器 IP 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70600741/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!