ubuntuserverlocalhostapache2local-network

Allow Access to Apache 2 Server on local network


I m using ubuntu 18.04.3 LTS

I want to allow access for other devices to my localhost. My IP is 192.168.1.249 and the Apache server is working for those addresses:

localhost/myapp
esolutions/myapp
192.168.1.249/myapp

I updated apache config and hsots file, (+restarting apache) but it is still not working Here is My default config: /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

and my hosts file:

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

Please help.


Solution

  • The Solution is to allow traffic on port 80:

    sudo ufw allow 'Apache'
    

    You can verify the change by typing:

    sudo ufw status