您可以访问此 IP 地址2.186.116.46(如果我的计算机在线)。我想为它分配一个域,所以我想知道当我没有 DNS 时怎么可能?我确实拥有我的域名“.com”。我的IP是静态的。
谢谢
我有一个 URL,要在我的 Ubuntu 16.04 机器上映射到本地文件夹。
例如,我需要https://domainxxx.xxx指向/home/user/folder.
我的具体需要domainxxx.xxx/file.js不是在远程服务器上包含真正的“file.js”,而是/home/user/folder/file.js包含在我的机器上。
我读过这是不可能的,在/etc/hosts. 我怎样才能做到这一点?
当我尝试以下命令/etc/hostnames和时/etc/hosts,它说:
bash: permission denied.
Run Code Online (Sandbox Code Playgroud) 我正在设置 PHP 环境。现在,当我开始从 windows/xampp 备份添加我的站点时(提及以防任何与路径相关的问题)
我创建了新项目 (netbeans) 并创建了测试 inedx.php 并且我可以访问它。但是,当我尝试访问该站点时,它正在为该站点提供403 Forbidden消息。
我从昨晚开始就试图解决这个问题
我正在尝试设置 Apache2 服务器。安装和配置似乎进行得很顺利,但是当我尝试访问我的自定义 Web URL 时,出现“无法访问此站点”错误。我已尝试通过此答案设置配置文件 -尝试在浏览器中访问 Apache 2.4.7 Web 服务器时出现 Forbidden 403 错误。
我的主机文件如下所示:
127.0.0.1 localhost
127.0.0.1 justtestingthis
127.0.1.1 Hacker
# The following lines are desirable for IPv6 capable hosts
...
Run Code Online (Sandbox Code Playgroud)
我的apache2/sites-available/http.justtestingthis.conf文件看起来像这样:
<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@example.com
ServerName justtestingthis.com
ServerAlias www.justtestingthis.com
DocumentRoot /home/donatas/Desktop/Projects/justtestingthis/dist/src
DirectoryIndex index.php
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/donatas/Desktop/Projects/justtestingthis/dist/src>
# Allow .htaccess
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
我还在apache2/sites-enabled使用sudo a2ensite http.justtestingthis.conf.
当我通过输入http://localhost访问该网站时,我的网站被成功找到,但是当我尝试通过 justtestingthis.com 或 www.justtestingthis.com 访问它时,我得到“这个网站无法到达错误”... …
apache2 ×2
networking ×2
apache2.4 ×1
command-line ×1
dns ×1
permissions ×1
redirect ×1
server ×1