【发布时间】:2023-04-05 12:56:02
【问题描述】:
我需要将我的网站的网址设置为 mydomain.com/ 并让 apache 将其识别为 webroot。
目前我的网址如下所示:
###.###.##.##/laravel/public
我希望它变成:
mydomain.com/
这是我从头开始开发的第一个网站,所以我不完全确定我应该在此处包含哪些信息。
当前 apache httpd.conf:
NameVirtualHost *:80
NOTE: NameVirtualHost cannot be used without a port specifier
(e.g. :80) if mod_ssl is being used, due to the nature of the
SSL protocol.
VirtualHost example:
Almost any Apache directive may go into a VirtualHost container.
The first VirtualHost section is used for requests without a known
server name.
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/html/foo_bar/public
ServerName foo.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
<Directory /var/www/html/foo/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>
</VirtualHost>
【问题讨论】:
-
Google 'apache httpd.conf' 或 'apache server configuration' -- 您应该能够找到大量示例文件和如何设置服务器的演练。