[SOLVED] FC28 localhost:8080 doesn't work any more
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 15 of 15
  1. #1
    Join Date
    Nov 2006
    Posts
    224
    Linux (Fedora) Firefox 61.0

    FC28 localhost:8080 doesn't work any more

    Hello,
    After a crash I had to install Fedora again.
    Because I had a FC25 ISO-Image DVD for i386 I could install FC25 from scratch and so I could make a upgrade to FC28.
    After that I saw that that all packages were for x86_64 , indeed I have a 64 Bit Computer:
    Code:
    [gastonv@localhost ~]$ uname -a
    Linux localhost.localdomain 4.17.9-200.fc28.x86_64 #1 SMP Mon Jul 23 21:41:29 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
    In the past I had made a PHP-Mysql Wine program with access to a mariadb/mysql database.
    In could run that with:
    Code:
    http://localhost:8080/Wijnen/WijnKelder.php
    but from now, for that I receive a message:
    Code:
    Firefox cannot make a connection with the server on localhost:8080
    I have a test php file:
    Code:
    [gastonv@localhost ~]$ cat /var/www/html/test.php
    <html>
    <head>
    <title>PHP test</title>
    </head>
    <body>
    <p>This is an HTML line
    <p>
    <?php
    	echo "This is a PHP line";
    	phpinfo();
    ?>
    </body>
    </html>
    When I run it as:
    Code:
    http://localhost/test.php
    Then I can see it.
    But when I run a test php program with database connection, I only see a blanco window.
    Code:
    http://localhost/mariadb.php
    
    [gastonv@localhost ~]$ cat /var/www/html/mariadb.php
    <html>
       <head>
          <title>Connect to MariaDB Server</title>
       </head>
       <body>
          <?php
             $dbhost = 'localhost';
             $dbuser = 'root';
             $dbpass = 'password';       > here is my own database password
             $conn = mysql_connect($dbhost, $dbuser, $dbpass);
              if(! $conn ) {
                die('Could not connect: ' . mysql_error());
             }
             echo 'Connected successfully';
             mysql_close($conn);
          ?>
       </body>
    </html>
    Please, what can be a reason why it doesn't work any more?

    Many thanks in advance for each answer.
    Kind regards,
    Gaston Verhulst.

  2. #2
    Join Date
    Jul 2005
    Posts
    914
    Windows NT 10.0 Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    One possible reason, fedora 28 installs php7 by default, and the mysql_ functions are not available. You should convert your php code to use pdo or mysqli
    ======
    Doug G
    ======

  3. #3
    Join Date
    Nov 2006
    Posts
    224
    Linux (Fedora) Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    Hello,
    Many thanks for your hint!
    I found this website:
    http://https://nestify.io/blog/apache-php-mariadb-phpmyadmin-fedora-27/
    And i could all do what they recommend to do in order to install Apache and PHP7.1/7.2 and PHPMyAdmin
    So, I could see the Fedora Test Page and PHP Version 7.2.8 and phpMyAdmin for my localhost and 127.0.0.1, without any portnumber.
    Code:
    http://localhost
    http://127.0.0.1
    http://localhost/test.php
    http://127.0.0.1/test.php
    http://localhost/phpmyadmin/index.php
    http://127.0.0.1/phpmyadmin/index.php
    From now, I can test my PHP-MySQL Wine-page.
    Kind regards,
    Gaston Verhulst

  4. #4
    Join Date
    Nov 2006
    Posts
    224
    Linux (Fedora) Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    Hello,
    I have made a new Wine-Database and from now I can use my old PHP-MySQL Wine-page again.
    So, this problem is solved with your great hint!
    Thank you very much.
    Kind regards,
    Gaston Verhulst.

  5. #5
    Join Date
    Nov 2006
    Posts
    224
    Linux (Fedora) Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    Hello,
    In the past, in order to start the php-mysql program on my PC, I had written a script.
    And I could see my Wine-database on my smartphone and my tablet.
    In order tot see it again, I had to add one line.
    WeinKelder = Winecellar.
    Wijnen = Wines.
    Code:
    [gastonv@gastonv ~]$ cat bin/Wijnen
    #!/bin/bash
    sudo service firewalld stop >> added to the script
    sudo systemctl start httpd
    sudo systemctl start mariadb.service
    firefox localhost/Wijnen/WijnKelder.php
    From now I can see it everywhere.
    Kind regards,
    Gaston Verhulst.

  6. #6
    Join Date
    Feb 2005
    Location
    London, UK
    Posts
    706
    Linux (Ubuntu) Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    Quote Originally Posted by gastonv
    Hello,
    Code:
    sudo service firewalld stop >> added to the script
    This is an odd line. Firstly you' be better opening just port 8080 rather than stopping your whole firewall. Secondly, the ">>" will redirect the output of "sudo service firewalld stop" to a file called "added", it will also write "to the script" to the file added, for example:

    Code:
    $ echo foo >> test baa
    $ cat test
    foo baa

    I believe you either meant to write "# added to the script", which would make it a comment or ">> /path/to/logfile" to write to a logfile?

  7. #7
    Join Date
    Nov 2006
    Posts
    224
    Linux (Fedora) Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    Hello,
    Thank you very much for the reply.
    I have to say, the comment ">> added to the script" is an own reference point for this forum, so it is not really in the script.
    I think, really in the script, it is a good idea to write "# added to the script", to take attention I have made this change.
    Kind regards,
    Gaston Verhulst.

  8. #8
    Join Date
    Mar 2004
    Location
    In your closet
    Posts
    15,724
    Linux (Fedora) Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    Why not just open port 8080?

    PHP Code:
    firewall-cmd --permanent --zone=public add-port=8080/tcp
    firewall
    -cmd --reload 
    Glenn
    The Bassinator

  9. #9
    Join Date
    Nov 2006
    Posts
    224
    Linux (Fedora) Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    Thanks for the reply.
    In the past, I had to use port 8080, as written in the first item of this thread.
    To test it again, now I did:
    Code:
    [gastonv@gastonv ~]$ sudo firewall-cmd --permanent --zone=public add-port=8080/tcp
    [sudo] wachtwoord voor gastonv: 
    usage: see firewall-cmd man page
    firewall-cmd: error: unrecognized arguments: add-port=8080/tcp
    [gastonv@gastonv ~]$ sudo firewall-cmd --reload
    success
    I looked in the man page and so I tried with the 2 -- before add:
    Code:
    [--permanent] [--zone=zone] --add-port=portid[-portid]/protocol
    
    gastonv@gastonv ~]$ sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp
    [sudo] wachtwoord voor gastonv: 
    FirewallD is not running
    [gastonv@gastonv ~]$ man firewall-cmd
    [gastonv@gastonv ~]$ sudo firewall-cmd --reload
    FirewallD is not running
    I do not know what is the reason why it worked in the past and why it did not work any more after the upgrade to x86_64.
    But, on this moment, without any port, I can see my php-pages inclusive the database data on my smartphone and tablet.
    Many thanks in advance for each answer,
    Kind regards,
    Gaston Verhulst.

  10. #10
    Join Date
    Feb 2015
    Location
    Colorado
    Posts
    16
    Linux Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    I list this as a POSSIBLE reason for the command listed above that opens port 8080 in zone public not working. It is worth checking out.
    In Fedora 28, they have added a couple of new zones to firewalld. Namely FedoraServer and FedoraWorkstation (both case sensitive).
    With Fedora 28 Server Edition (I don't know about Workstation or other flavors) the firewall uses zone FedoraServer by default. In your above examples, you specified --zone=public in your command.
    Try this
    # firewall-cmd --get-zones (lists all supported zones)
    FedoraServer FedoraWorkstation block dmz drop external home internal public trusted work
    # firewall-cmd --get-default-zone
    FedoraServer (or may list something like public or etc)
    # firewall-cmd --get-active-zones
    FedoraServer (or others)
    interfaces: enp3s0
    # firewall-cmd --list-all (lists info for the default zone)
    [snippet]
    FedoraServer (active)
    services: ssh dhcpv6-client http https
    [end snippet]
    IF you get responses like above, default zone is FedoraServer and active zone is FedoraServer, and then specify --zone=public in a firewall-cmd, you will be setting a parameter in a zone that is neither default nor active. To remedy this, either specify --zone=FedoraServer in your command, or don't specify a zone at all and the command will be performed to the default zone. In the case above default zone = FedoraServer.

    There are also many services that are configured as part of firewalld. The supported services are pre-configured by Fedora to optimize the appropriate ports, etc for that service. If you service is supported, IMO it is best to make that service active as opposed to opening individual ports. Unless you have a specific reason to do otherwise. To get the list of supported services enter
    # firewall-cmd --get-services

    # firewall-cmd --permanent --zone=YourActiveZone --add-service=http
    will open port 80 amongst a few other things, is preferred to
    # firewall-cmd --permanent --zone=YourActiveZonw --add-port=80/tcp
    again this is my opinion, which is worth what you payed for it. In this case you payed nothing, so it's probably worth about the same.

    I hope this makes sense. Myself and others have been bitten by these new zones. Especially when the default zone is set to something other than public out of the box and everyone is used to public being default in the past.

    HTH
    I try to think, but nothin' happens!

  11. #11
    Join Date
    Nov 2006
    Posts
    224
    Linux (Fedora) Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    Hello,
    Many thanks for this extensive reply.
    I have tried all the commands, ans this are the results:
    Code:
    [root@gastonv gastonv]# firewall-cmd --get-zones
    FedoraServer FedoraWorkstation block dmz drop external home internal public trusted work
    [root@gastonv gastonv]# firewall-cmd --get-default-zone
    FedoraWorkstation
    [root@gastonv gastonv]# firewall-cmd --get-active-zones
    FedoraWorkstation
      interfaces: enp2s0
    [root@gastonv gastonv]# firewall-cmd --list-all 
    FedoraWorkstation (active)
      target: default
      icmp-block-inversion: no
      interfaces: enp2s0
      sources: 
      services: mdns samba-client dhcpv6-client ssh
      ports: 1025-65535/tcp 1025-65535/udp
      protocols: 
      masquerade: no
      forward-ports: 
      source-ports: 
      icmp-blocks: 
      rich rules: 
    	
    [root@gastonv gastonv]# firewall-cmd --get-services
    RH-Satellite-6 amanda-client amanda-k5-client bacula bacula-client bgp bitcoin bitcoin-rpc bitcoin-testnet bitcoin-testnet-rpc ceph ceph-mon cfengine condor-collector ctdb dhcp dhcpv6 dhcpv6-client dns docker-registry docker-swarm dropbox-lansync elasticsearch freeipa-ldap freeipa-ldaps freeipa-replication freeipa-trust ftp ganglia-client ganglia-master git gre high-availability http https imap imaps ipp ipp-client ipsec irc ircs iscsi-target jenkins kadmin kerberos kibana klogin kpasswd kprop kshell ldap ldaps libvirt libvirt-tls managesieve mdns minidlna mongodb mosh mountd ms-wbt mssql murmur mysql nfs nfs3 nmea-0183 nrpe ntp openvpn ovirt-imageio ovirt-storageconsole ovirt-vmconsole pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy proxy-dhcp ptp pulseaudio puppetmaster quassel radius redis rpc-bind rsh rsyncd samba samba-client sane sip sips smtp smtp-submission smtps snmp snmptrap spideroak-lansync squid ssh syncthing syncthing-gui synergy syslog syslog-tls telnet tftp tftp-client tinc tor-socks transmission-client upnp-client vdsm vnc-server wbem-https xmpp-bosh xmpp-client xmpp-local xmpp-server zabbix-agent zabbix-server
    [root@gastonv gastonv]# firewall-cmd --permanent --zone=FedoraWorkstation --add-service=http
    success
    [root@gastonv gastonv]# firewall-cmd --permanent --zone=FedoraWorkstation --add-port=80/tcp
    success
    I suppose, now I can use port 80?
    I shall try it.
    The reason why is, in the past I could run Kodi with port 8080, but that doesn't go any more.
    Now, I can try to do it with port 80.
    Thanks in advance for each answer,
    Kind regards,
    Gaston.

  12. #12
    Join Date
    Mar 2004
    Location
    In your closet
    Posts
    15,724
    Linux (Fedora) Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    Quote Originally Posted by gastonv
    Thanks for the reply.
    In the past, I had to use port 8080, as written in the first item of this thread.
    To test it again, now I did:
    Code:
    [gastonv@gastonv ~]$ sudo firewall-cmd --permanent --zone=public add-port=8080/tcp
    [sudo] wachtwoord voor gastonv: 
    usage: see firewall-cmd man page
    firewall-cmd: error: unrecognized arguments: add-port=8080/tcp
    [gastonv@gastonv ~]$ sudo firewall-cmd --reload
    success
    I looked in the man page and so I tried with the 2 -- before add:
    Code:
    [--permanent] [--zone=zone] --add-port=portid[-portid]/protocol
    
    gastonv@gastonv ~]$ sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp
    [sudo] wachtwoord voor gastonv: 
    FirewallD is not running
    [gastonv@gastonv ~]$ man firewall-cmd
    [gastonv@gastonv ~]$ sudo firewall-cmd --reload
    FirewallD is not running
    I do not know what is the reason why it worked in the past and why it did not work any more after the upgrade to x86_64.
    But, on this moment, without any port, I can see my php-pages inclusive the database data on my smartphone and tablet.
    Many thanks in advance for each answer,
    Kind regards,
    Gaston Verhulst.
    Oops. Left out an important --
    Glenn
    The Bassinator

  13. #13
    Join Date
    Feb 2015
    Location
    Colorado
    Posts
    16
    Linux Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    I assume that since your --get-default-zone result was FedoraWorkstation that you installed using the Fedora Workstation ISO.
    If so, we can suppose that
    1 Fedora Workstation ISO uses FedoraWorkstation as the default zone
    2 Fedora Server Edition ISO uses FedoraServer as the default zone (from personal experience)
    3 Fedora Netinstall "Minimal Install" uses public as the default zone (from personal experience)

    It would be interesting to know what some of the Spins (XFCE, KDE, etc) use as a default zone. I would guess public.

    Quote Originally Posted by gastonv
    I suppose, now I can use port 80?
    I shall try it.
    The reason why is, in the past I could run Kodi with port 8080, but that doesn't go any more.
    Now, I can try to do it with port 80.
    I used the service of http and port 80 as an example because I know they work. I apologize that I wasn't clear on that. Port 80 was an example and not meant to be a solution. My bad.

    I use Plex server and I don't know much of anything about Kodi. I don't know what ports Kodi needs opened to work, but if 8080 is needed then it would have to opened. You might have to check on the Kodi website for port usage. I looked at the output from your --get-services command, and did not see kodi listed. If it had been listed, this would have worked and been preferable
    # firewall-cmd --permanent --zone=FedoraWorkstation --add-service=kodi
    but since it is not listed, you would have to go with the following to open 8080
    # firewall-cmd --permanent --zone=FedoraWorkstation --add-port=8080/tcp (I'm assuming tcp not udp)

    The fact that Fedora added two new zones (FedoraServer and FedoraWorkstation) does not seem to be common knowledge. The take away from this thread probably should be that the default zone should be determined, then all changes should be made to that zone. It cannot be assumed anymore that public is the default zone out of the box. Oh, by the way, the command to set a new default zone is
    # firewall-cmd --set-default-zone=public (or other zone of your choice)
    # firewall-cmd --reload
    Last edited by Pudge; 31st August 2018 at 06:46 PM. Reason: added to explanation
    I try to think, but nothin' happens!

  14. #14
    Join Date
    Nov 2006
    Posts
    224
    Linux (Fedora) Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    Hello,

    I have done all of the firewall-cmd commands and and tried with port 8080:
    Code:
    firewall-cmd --permanent --zone=FedoraWorkstation --add-port=8080/tcp
    Warning: ALREADY_ENABLED: 8080:tcp
    success
    And with port 8080 in Kodi, from now I can run all I like to see and what is available to see.
    So, I have to thank you very much, also for the splendid communication.
    Kind regards,
    Gaston Verhulst.

  15. #15
    Join Date
    Feb 2015
    Location
    Colorado
    Posts
    16
    Linux Firefox 61.0

    Re: FC28 localhost:8080 doesn't work any more

    You are very welcome my friend. Glad I could help.

    Pudge
    I try to think, but nothin' happens!

Similar Threads

  1. Replies: 2
    Last Post: 10th May 2018, 03:48 PM
  2. Replies: 1
    Last Post: 20th April 2011, 10:17 AM
  3. Replies: 2
    Last Post: 29th May 2006, 06:52 PM
  4. Replies: 2
    Last Post: 10th April 2006, 06:53 PM
  5. Can't get this to work. Localhost Login
    By yuiol in forum Installation, Upgrades and Live Media
    Replies: 10
    Last Post: 10th August 2004, 09:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •