04.3 长期。
我想允许其他设备访问我的本地主机。我的 IP 是 192.168.1.249,Apache 服务器正在为这些地址工作:
localhost/myapp
esolutions/myapp
192.168.1.249/myapp
这是我的默认配置:/etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerName esolutions
ServerAdmin iheb@localhost
DocumentRoot /var/www/html
<Directory /var/www/html>
Options FollowSymLinks
Order deny,allow
AllowOverride All
allow from all
Require all granted
</Directory>
<Directory />
Options FollowSymLinks
AllowOverride None
allow from all
Order deny,allow
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
和我的主机文件:
127.0.0.1 localhost
127.0.1.1 najda-PowerEdge-R430
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.1.249 esolutions
请帮忙。
答案1
解决方案是允许端口 80 上的流量:
sudo ufw allow 'Apache'
您可以通过输入以下内容来验证更改:
sudo ufw status