-   Linux - Server (
-   -   Access localhost from iPhone (

Dylan_Oscar 02-11-2018 07:28 PM

I have just tried pinging my laptop from the desktop, and it worked. I got 0% packet loss. However the browser on my desktop is unable to visit the server on my laptop. When I enter the laptop's IP address in the URL bar, it is unable to connect.
I ran nmap and it stated that port 80 is open for http.
I do not have a file or directory in /var/log called messages. I have checked the other log files and haven't found any evidence of the pings.
This is the result of

ls /var/log

alternatives.log    apport.log.3.gz  auth.log.1    cups            fsck            kern.log.2.gz          ntpstats            syslog.1    tallylog
alternatives.log.1  apport.log.4.gz  auth.log.2.gz  dmesg          gpu-manager.log  lastlog                php7.0-fpm.log      syslog.2.gz  upstart
apache2            apport.log.5.gz  boot.log      dpkg.log        gufw.log        libvirt                php7.0-fpm.log.1    syslog.3.gz  wtmp
apparmor            apt              bootstrap.log  dpkg.log.1      hp              lightdm                php7.0-fpm.log.2.gz  syslog.4.gz  wtmp.1
apport.log          aptitude        btmp          faillog        installer        mintsystem.log        samba                syslog.5.gz  Xorg.0.log
apport.log.1        aptitude.1.gz    btmp.1        firewalld      kern.log        mintsystem.timestamps  speech-dispatcher    syslog.6.gz  Xorg.0.log.old
apport.log.2.gz    auth.log        ConsoleKit    fontconfig.log  kern.log.1      mysql                  syslog              syslog.7.gz

Is one of these relevant?
I did find the following entry in syslog after disabling apparmor:

Feb 12 11:14:12 dylanuszwei-Satellite-P750 systemd[1]: Stopping LSB: AppArmor initialization...
Feb 12 11:14:12 dylanuszwei-Satellite-P750 apparmor[10500]:  * Clearing AppArmor profiles cache
Feb 12 11:14:12 dylanuszwei-Satellite-P750 apparmor[10500]:    ...done.
Feb 12 11:14:12 dylanuszwei-Satellite-P750 apparmor[10500]: All profile caches have been cleared, but no profiles have been unloaded.
Feb 12 11:14:12 dylanuszwei-Satellite-P750 apparmor[10500]: Unloading profiles will leave already running processes permanently
Feb 12 11:14:12 dylanuszwei-Satellite-P750 apparmor[10500]: unconfined, which can lead to unexpected situations.
Feb 12 11:14:12 dylanuszwei-Satellite-P750 apparmor[10500]: To set a process to complain mode, use the command line tool
Feb 12 11:14:12 dylanuszwei-Satellite-P750 apparmor[10500]: 'aa-complain'. To really tear down all profiles, run the init script
Feb 12 11:14:12 dylanuszwei-Satellite-P750 apparmor[10500]: with the 'teardown' option."
Feb 12 11:14:12 dylanuszwei-Satellite-P750 systemd[1]: Stopped LSB: AppArmor initialization.

Since it is leaving the profiles in place, is it possible that apparmor is still blocking access? From what I understand apparmor functions similarly to SELinux. I would think disabling it would be all I need to do, but perhaps it is still doing something in the background.
Let me know if you need me to post any more information up here.

baldur_1 02-12-2018 05:13 AM

okay, so that could be significant but i dont know enough about apparmor and the logs to say for certain.

first on the laptop run...


netstat -tulpn
then paste the results here. that will tell every program that is running listening for an outside connection and which port it is listening on.

also, i dont know what apparmor does specifically but if that might be the issue then you should use this guide to stop apparmor and make sure it does not start...

stopping apparmor


this one stops it as a current running process

sudo /etc/init.d/apparmor stop
this one removes it from starting up with the pc

sudo update-rc.d -f apparmor remove
both need to be used to stop it from starting & running. you can always re-add it to auto start if you chose but for finding the issue, stop it for now.

Dylan_Oscar 02-12-2018 05:20 AM

I ran netstat -tulpn as root and these are the results. I only see one entry for apache. Is it running on IPv6?


Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address          Foreign Address        State      PID/Program name
tcp        0      0*              LISTEN      2278/mysqld   
tcp        0      0*              LISTEN      3084/dnsmasq   
tcp        0      0  *              LISTEN      2864/dnsmasq   
tcp        0      0    *              LISTEN      1721/sshd     
tcp        0      0*              LISTEN      4786/cupsd     
tcp        0      0*              LISTEN      3521/dropbox   
tcp        0      0*              LISTEN      3521/dropbox   
tcp        0      0*              LISTEN      5924/cli       
tcp        0      0*              LISTEN      3521/dropbox   
tcp        0      0*              LISTEN      5924/cli       
tcp6      0      0 :::80                  :::*                    LISTEN      2132/apache2   
tcp6      0      0 :::22                  :::*                    LISTEN      1721/sshd     
tcp6      0      0 ::1:631                :::*                    LISTEN      4786/cupsd     
tcp6      0      0 :::17500                :::*                    LISTEN      3521/dropbox   
udp        0      0  *                          1277/avahi-daemon:
udp        0      0*                          3084/dnsmasq   
udp        0      0  *                          2864/dnsmasq   
udp        0      0    *                          3084/dnsmasq   
udp        0      0    *                          19533/dhclient 
udp        0      0*                          2005/ntpd     
udp        0      0*                          2005/ntpd     
udp        0      0  *                          2005/ntpd     
udp        0      0*                          1277/avahi-daemon:
udp        0      0  *                          4787/cups-browsed
udp        0      0*                          2864/dnsmasq   
udp        0      0*                          3521/dropbox   
udp6      0      0 :::5353                :::*                                1277/avahi-daemon:
udp6      0      0 :::52404                :::*                                1277/avahi-daemon:
udp6      0      0 fe80::8ebd:9465:e21:123 :::*                                2005/ntpd     
udp6      0      0 ::1:123                :::*                                2005/ntpd     
udp6      0      0 :::123                  :::*                                2005/ntpd

I also ran the command you provided to stop apparmor, but was still unable to access the site from my phone.

baldur_1 02-13-2018 06:36 AM

okay, something is going on here and i have no idea what specifically. i can see from the netstat output that apache is listening. from your log it told me you have it set to require all granted and you can reach it from localhost. so apache is nearly for certain not the issue. there is NO WAY the issue is on the side of the phone because that is the simple part but if when you set it on LOGLEVEL=debug and you dont see a reference to the phones request in the log then there is something clearly intercepting the request from the phone on the laptop.

i dont know if you know this but you have to use BOTH commands. one command only stopd apparmor temporarily but you want it stopped and disabled.

1. you need to stop it,
2. disable it from starting on boot,
3. restart your computer
4. check your bootlog to make sure it did not start

look in your boot log and see if there is a reference to apparmor or something in there. also check your sys log to see if there is any reference in there.

by everything i see it should work so i dont know. i would specifically go to a mint forum (i think there is a mint forum on linuxquestions) and ask someone there because maybe there is something specific to mint that is blocking it...

Dylan_Oscar 02-13-2018 06:03 PM

I've disabled apparmor to prevent it from starting at boot. I rebooted and confirmed that apparmor did not turn back on again, but that did not resolve the issue.
I've posted this on the Mint forum now. I will let you know if I get an answer. Thanks for all your help.

Dylan_Oscar 02-19-2018 03:46 AM

Just an update for anyone looking at this post. I have now successfully accessed a localhost on a Mac on the same network from my phone, so the router settings are not the issue, which I thought they might be for a while.
I have posted this question on the Mint forum and on, but I have not received a response yet. If anyone does know of a solution, I would be very eager to hear it, but for now it looks like I can't use this laptop for mobile testing.

All times are GMT -5. The time now is 03:12 AM.