Install Apache/PHP 7.2.10 on Fedora 28/27, CentOS/RHEL 7.5/6.10 - Comment Page: 3

This guide shows howto install Apache HTTP Server (httpd) with PHP 7.2.10 and following modules on Fedora 28/27/26, CentOS 7.5/6.10 and Red Hat (RHEL) 7.5/6.10 systems. OPcache (php-opcache) - The Zend OPcache provides faster PHP execution through opcode caching and optimization. APCu (php-pecl-apcu) - APCu userland caching CLI (php-cli) - Command-line interface for PHP PEAR (php-pear) - PHP Extension and Application Repository framework PDO (php-pdo) - A database access abstraction module for PHP applications MySQL (php-mysqlnd) - A module for PHP applications that use MySQL databases PostgreSQL (php-pgsql) - A PostgreSQL database module for PHP MongoDB...

268 comments on “Install Apache/PHP 7.2.10 on Fedora 28/27, CentOS/RHEL 7.5/6.10 - Comment Page: 3

1 2 3 4 5 9
    1. Yeah ! thanks JR ! it s working , but would u mind to help me if possible so as it can work in /var/www/html/sqlite-example.php?

      Reply
      • Okay so code is working normally and your PHP / PDO / SQLite is working normally. It sounds definitely permission problem. Do php file with following content:

        
        < ?php
          $fp = fopen('test.txt', 'w');
          fwrite($fp, 'test');
          fwrite($fp, ' test 2');
          fclose($fp);
        ?>
        

        Run it…do you get any errors? Or do you get test.txt file, with “test test 2” content?

        Reply
    2. yeah !
      it displays :
      Warning: fopen(test.txt): failed to open stream: Permission denied in /var/www/html/file.php on line 2 Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/www/html/file.php on line 3 Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/www/html/file.php on line 4 Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/html/file.php on line 5

      Reply
      • So then try following as root (this is just test setup, no production use):

        
        mkdir /var/www/html/dbs
        
        chmod -R 775 /var/www/html/dbs
        
        chown -R apache:apache /var/www/html/dbs
        
        chcon -R -t httpd_sys_rw_content_t /var/www/html/
        

        Then modify your php code to following, (keep php code same location):

        
            // Create (connect to) SQLite database in file
            $file_db = new PDO('sqlite:dbs/messaging.sqlite3');
            // Set errormode to exceptions
            $file_db->setAttribute(PDO::ATTR_ERRMODE, 
                                    PDO::ERRMODE_EXCEPTION);
        

        Try again…is it working then? :)

        Reply
    3. Hi, thank you so much for posting this tutorial and helping people with this issue:

      I have MySQL 5.0 and I needed at least PHP 5.2, so I did this:

      $ yum –enablerepo=remi install php php-pdo php-xml php-pear php-mhash php-mcrypt php-gd

      And it all works fine with no errors. But I also need php-mysql, and it throws errors

      $ yum –enablerepo=remi install php-mysql

      So this results in errors because, I think, it depends on MySQL 5.5. So I try upgrading MySQL, like this:

      $ yum –enablerepo=remi update mysql-\*

      This is what it looks to update:

      Dependencies Resolved

      ================================================================================
      Package Arch Version Repository Size
      ================================================================================
      Updating:
      mysql x86_64 5.5.20-1.el5.remi remi 7.4 M
      mysql-devel x86_64 5.5.20-1.el5.remi remi 173 k
      mysql-server x86_64 5.5.20-1.el5.remi remi 13 M
      Installing for dependencies:
      mysql-libs x86_64 5.5.20-1.el5.remi remi 1.1 M
      mysqlclient15 x86_64 5.0.67-1.el5.remi remi 1.3 M

      Transaction Summary
      ================================================================================
      Install 2 Package(s)
      Upgrade 3 Package(s)

      Total size: 23 M

      And I get these errors:


      Transaction Check Error:
      file /usr/bin/mysql_find_rows from install of mysql-5.5.20-1.el5.remi.x86_64 c
      onflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/bin/mysqlaccess from install of mysql-5.5.20-1.el5.remi.x86_64 confl
      icts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/man/man1/my_print_defaults.1.gz from install of mysql-5.5.20-1
      .el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/man/man1/mysql.1.gz from install of mysql-5.5.20-1.el5.remi.x8
      6_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/man/man1/mysql_config.1.gz from install of mysql-5.5.20-1.el5.
      remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/man/man1/mysql_find_rows.1.gz from install of mysql-5.5.20-1.e
      l5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/man/man1/mysql_waitpid.1.gz from install of mysql-5.5.20-1.el5
      .remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/man/man1/mysqlaccess.1.gz from install of mysql-5.5.20-1.el5.r
      emi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/man/man1/mysqladmin.1.gz from install of mysql-5.5.20-1.el5.re
      mi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/man/man1/mysqldump.1.gz from install of mysql-5.5.20-1.el5.rem
      i.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/man/man1/mysqlshow.1.gz from install of mysql-5.5.20-1.el5.rem
      i.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /etc/my.cnf from install of mysql-libs-5.5.20-1.el5.remi.x86_64 conflicts
      with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.5.20-1.e
      l5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.5.20-1.
      el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/charsets/cp1251.xml from install of mysql-libs-5.5.20-1.
      el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/czech/errmsg.sys from install of mysql-libs-5.5.20-1.el5
      .remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/danish/errmsg.sys from install of mysql-libs-5.5.20-1.el
      5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/dutch/errmsg.sys from install of mysql-libs-5.5.20-1.el5
      .remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/english/errmsg.sys from install of mysql-libs-5.5.20-1.e
      l5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/estonian/errmsg.sys from install of mysql-libs-5.5.20-1.
      el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/french/errmsg.sys from install of mysql-libs-5.5.20-1.el
      5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/german/errmsg.sys from install of mysql-libs-5.5.20-1.el
      5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/greek/errmsg.sys from install of mysql-libs-5.5.20-1.el5
      .remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-libs-5.5.20-1
      .el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/italian/errmsg.sys from install of mysql-libs-5.5.20-1.e
      l5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/japanese/errmsg.sys from install of mysql-libs-5.5.20-1.
      el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/korean/errmsg.sys from install of mysql-libs-5.5.20-1.el
      5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-libs-5.5.2
      0-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-libs-5.5.20-1
      .el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/polish/errmsg.sys from install of mysql-libs-5.5.20-1.el
      5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-libs-5.5.20-
      1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/romanian/errmsg.sys from install of mysql-libs-5.5.20-1.
      el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/russian/errmsg.sys from install of mysql-libs-5.5.20-1.e
      l5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/serbian/errmsg.sys from install of mysql-libs-5.5.20-1.e
      l5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/slovak/errmsg.sys from install of mysql-libs-5.5.20-1.el
      5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/spanish/errmsg.sys from install of mysql-libs-5.5.20-1.e
      l5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/swedish/errmsg.sys from install of mysql-libs-5.5.20-1.e
      l5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386
      file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-libs-5.5.20-1
      .el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386

      This seems to say that I have MySQL 5.0 i386 installed even though I’m on a 64-bit system, and remi wants to give me 64 bit.

      Do you have any idea what I should do?

      Thank you.

      Reply
      • Hi Buttle Butkus,

        Could you post output of following commands:

        
        uname -a
        
        rpm -qa *mysql* |sort
        
        Reply
    4. Hi JR ! thanks alot ! It worked
      Best Regards ,
      Jules

      Reply
      • Hi jules,

        You are welcome! Nice to hear that you got it working… :)

        Reply
    5. Hi, JR, thanks so much for your quick response. Perhaps you guessed what my problem is. But I fixed it before I saw your post. I thought checked this:

      $ rpm -qa | grep mysql

      But I guess I didn’t.

      Somehow, I had both the i386 and x86_64 packages for mysql installed.
      When I ran STATUS query it showed x86_64 in mysql. So I gave up and decided to remove mysql altogether and start over with remi’s install.

      When I ran:

      $ yum remove mysql\*

      All of a sudden it was asking me to confirm removal of packages that included both architectures.

      ================================================================================
      Package Arch Version Repository Size
      ================================================================================
      Removing:
      mysql i386 5.0.77-4.el5_6.6 installed 7.9 M
      mysql x86_64 5.0.77-4.el5_6.6 installed 8.1 M
      mysql-devel i386 5.0.77-4.el5_6.6 installed 5.6 M
      mysql-devel x86_64 5.0.77-4.el5_6.6 installed 6.3 M
      mysql-server x86_64 5.0.77-4.el5_6.6 installed 22 M
      Removing for dependencies:
      exim x86_64 4.63-10.el5 installed 3.4 M
      perl-DBD-MySQL x86_64 3.0007-2.el5 installed 328 k
      redhat-lsb i386 4.0-2.1.4.el5 installed 21 k
      redhat-lsb x86_64 4.0-2.1.4.el5 installed 22 k

      Then all I had to do was this:

      $ yum remove mysql.i386

      And it removed 2 packages (mysql.i386 and mysql-devel.i386). redhat-lsb.i386 is still there and I guess I should remove it too.

      After that, installation worked fine of MySQL 5.5 was fine. I just wonder if I really needed to do it in order to have PHP 5.3.9 including php-mysql. Oh well. Too late now. I am fully upgraded.

      Reply
      • Yes, some reason you had both MySQL’s 32-bit and 64-bit installed, but removing wrong one is the solution… :)

        Excellent to hear that you got it working!

        Reply
    6. I’m using Fedora 16, and SELinux raise a warning and block apache. What I did to solve this problem was to put SELinux y permisive mode only for http with the next line:

      sudo semanage permissive -a httpd_t

      I hope this helps somebody with the same or similar problem

      Reply
    7. Repositories:
      rpm -Uvh http://mirror.awanti.com/epel/5/i386/epel-release-5-4.noarch.rpm
      rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
      successfully connected.

      But then the installation comes to a standstill =(

      > yum –enablerepo=remi install mysql-server
      Loaded plugins: fastestmirror
      Loading mirror speeds from cached hostfile
      * atomic: www6.atomicorp.com
      * base: mirror.corbina.net
      * epel: mirror.yandex.ru
      * extras: mirror.corbina.net
      * ius: mirror.rackspace.co.uk
      * remi: remi-mirror.dedipower.com
      * updates: mirror.corbina.net
      Excluding Packages in global exclude list
      Finished
      Setting up Install Process
      No package mysql-server available.
      Nothing to do

      > yum –enablerepo=remi install httpd php php-common
      Loaded plugins: fastestmirror
      Loading mirror speeds from cached hostfile
      * atomic: www6.atomicorp.com
      * base: mirror.corbina.net
      * epel: mirror.yandex.ru
      * extras: mirror.corbina.net
      * ius: mirror.rackspace.co.uk
      * remi: remi-mirror.dedipower.com
      * updates: mirror.corbina.net
      Excluding Packages in global exclude list
      Finished
      Setting up Install Process
      No package httpd available.
      No package php available.
      No package php-common available.
      Nothing to do

      I would be glad of any help in solving the problem.

      The data on my system:
      CentOS Linux 5.7
      Apache version 2.2.8
      PHP 5.2.5 (cli) (built: Feb 6 2008 05:50:28)
      Zend Engine v2.2.0
      with Zend Extension Manager v1.2.0
      with Zend Optimizer v3.2.8

      Reply
      • Hi Cyborg Atom,

        Could you post output of following command:

        
        yum repolist all
        
        Reply
        • > yum repolist all
          Loaded plugins: fastestmirror
          Loading mirror speeds from cached hostfile
          * atomic: www6.atomicorp.com
          * base: mirror.corbina.net
          * epel: mirror.yandex.ru
          * extras: mirror.corbina.net
          * ius: mirrors.ircam.fr
          * rpmfusion-free-updates: mirror.yandex.ru
          * rpmfusion-free-updates-testing: mirror.yandex.ru
          * updates: mirror.corbina.net
          Excluding Packages in global exclude list
          Finished
          repo id repo name status
          C5.0-base CentOS-5.0 – Base disabled
          C5.0-centosplus CentOS-5.0 – Plus disabled
          C5.0-extras CentOS-5.0 – Extras disabled
          C5.0-updates CentOS-5.0 – Updates disabled
          C5.1-base CentOS-5.1 – Base disabled
          C5.1-centosplus CentOS-5.1 – Plus disabled
          C5.1-extras CentOS-5.1 – Extras disabled
          C5.1-updates CentOS-5.1 – Updates disabled
          C5.2-base CentOS-5.2 – Base disabled
          C5.2-centosplus CentOS-5.2 – Plus disabled
          C5.2-extras CentOS-5.2 – Extras disabled
          C5.2-updates CentOS-5.2 – Updates disabled
          C5.3-base CentOS-5.3 – Base disabled
          C5.3-centosplus CentOS-5.3 – Plus disabled
          C5.3-extras CentOS-5.3 – Extras disabled
          C5.3-updates CentOS-5.3 – Updates disabled
          C5.4-base CentOS-5.4 – Base disabled
          C5.4-centosplus CentOS-5.4 – Plus disabled
          C5.4-extras CentOS-5.4 – Extras disabled
          C5.4-updates CentOS-5.4 – Updates disabled
          C5.5-base CentOS-5.5 – Base disabled
          C5.5-centosplus CentOS-5.5 – Plus disabled
          C5.5-extras CentOS-5.5 – Extras disabled
          C5.5-updates CentOS-5.5 – Updates disabled
          C5.6-base CentOS-5.6 – Base disabled
          C5.6-centosplus CentOS-5.6 – Plus disabled
          C5.6-extras CentOS-5.6 – Extras disabled
          C5.6-updates CentOS-5.6 – Updates disabled
          addons CentOS-5 – Addons enabled: 0
          atomic CentOS / Red Hat Ente enabled: 730+300
          atomic-testing CentOS / Red Hat Ente disabled
          base CentOS-5 – Base enabled: 2618+87
          c5-media CentOS-5 – Media disabled
          centosplus CentOS-5 – Plus disabled
          contrib CentOS-5 – Contrib disabled
          debug CentOS-5 – Debuginfo disabled
          epel Extra Packages for En enabled: 5407+216
          epel-debuginfo Extra Packages for En disabled
          epel-source Extra Packages for En disabled
          epel-testing Extra Packages for En disabled
          epel-testing-debuginfo Extra Packages for En disabled
          epel-testing-source Extra Packages for En disabled
          extras CentOS-5 – Extras enabled: 276+23
          ius IUS Community Package enabled: 30+120
          ius-archive IUS Community Package disabled
          ius-archive-debuginfo IUS Community Package disabled
          ius-archive-source IUS Community Package disabled
          ius-debuginfo IUS Community Package disabled
          ius-dev IUS Community Package disabled
          ius-dev-debuginfo IUS Community Package disabled
          ius-dev-source IUS Community Package disabled
          ius-source IUS Community Package disabled
          ius-testing IUS Community Package disabled
          ius-testing-debuginfo IUS Community Package disabled
          ius-testing-source IUS Community Package disabled
          remi Les RPM de remi pour disabled
          remi-test Les RPM de remi en te disabled
          rpmfusion-free-updates RPM Fusion for EL 5 – enabled: 1
          rpmfusion-free-updates-debuginfo RPM Fusion for EL 5 – disabled
          rpmfusion-free-updates-source RPM Fusion for EL 5 – disabled
          rpmfusion-free-updates-testing RPM Fusion for EL 5 – enabled: 93
          rpmfusion-free-updates-testing-debuginfo RPM Fusion for EL 5 – disabled
          rpmfusion-free-updates-testing-source RPM Fusion for EL 5 – disabled
          updates CentOS-5 – Updates enabled: 452+132
          webtatic Webtatic Repository 5 disabled
          webtatic-debuginfo Webtatic Repository 5 disabled
          webtatic-source Webtatic Repository 5 disabled
          repolist: 9607

          Reply
          • Could you post also output of following command:

            
            yum --enablerepo=remi list mysql mysql-server httpd php php-common
            
            Reply
            • > yum –enablerepo=remi list mysql mysql-server httpd php php-common
              Loaded plugins: fastestmirror
              Loading mirror speeds from cached hostfile
              * atomic: www6.atomicorp.com
              * base: mirror.corbina.net
              * epel: mirror.xfes.ru
              * extras: mirror.corbina.net
              * ius: mirror.rackspace.co.uk
              * remi: rpms.famillecollet.com
              * rpmfusion-free-updates: mirror.yandex.ru
              * rpmfusion-free-updates-testing: mirror.yandex.ru
              * updates: mirror.corbina.net
              Excluding Packages in global exclude list
              Finished
              Installed Packages
              mysql.i386 5.0.77-4.el5_6.6 installed

              Reply
              • Could you post output of following command:

                
                grep exclude /etc/yum.repos.d/* /etc/yum.conf
                
                Reply
                • > grep exclude /etc/yum.repos.d/* /etc/yum.conf
                  /etc/yum.conf:exclude=apache* httpd* mod_* mysql* MySQL* da_* *ftp* exim* sendmail* php* bind* bind-chroot*

                  O_o The packs were not allowed to update. Is this true?

                  Reply
                  • Yes, this exclude row exclude all updates and installs where package name match pattern, so if you remove / comment out exclude row, then you can update / install those packages. :)

                    One question, before you remove exclude row, do you know the reason why those packages are excluded on /etc/yum.conf?

                    Reply
                    • In general, don `t know.
                      It was a standard setup of my VPS server.

                      Reply
                      • Oh, I see :) If you want (are allowed) to install / update those packages then you have to remove that exclude line.

    8. Hello,
      Iam currently trying to develop and manage a website using fedora 16. However, I am very tired of not being allowed access to certain folders and drives(usually easily correctable in other OS’s). For instance, when I try to create the /var/www/html/test.php it says i dont have permission even though I am in terminal as [[email protected] root]. How do I troubleshoot this issue and make it so I am able to create the php file?

      Reply
    9. Also, I just switched over from windows two days ago so I am installing all the necessary programs to develop and interact with db’s.

      Reply
    10. Hi Jared77,

      Welcome to Linux user and yes, everything is relative, and fixing permissions under Linux is much easier and faster than under Windows, but of course, you need to know what to do and get used to it. :)

      If you try create file as root user, then you should be able to create file even if the permissions are wrong. So could you tell, how you try to create a file as root? What program / command you used?

      Then could you post output of following commands:

      
      ls -la /var/www
      
      ls -la /var/www/html
      
      Reply
    11. Thanks for the tutorial!

      Do you have plans to include PHP 5.4?

      Reply
      • Hi Ramy!

        You are welcome!

        Yes I have plans to update this guide also include PHP 5.4… :)

        Reply
    12. Hi JR,
      first I like to give my congratulations to you for this helping site! Thank you very much for sharing your knowledge. (Aspecially helpfull for people like me, which are only working some hours a year on topics like this)

      I´m running CentOS-5 and have to update to php53, which worked fine using your infos above. – But as a result I´m now not able to start mysqld.
      Do have have any suggestions for me?

      Thank you very much in advance.

      Kind regards,
      GG

      Reply
      • Hi GG,

        Thanks and you are welcome! :)

        What version of MySQL are you trying to run? Do you get any errors when you try to start it?

        Reply
    13. Hey,

      Thanks for this lovely thread, I followed every step. works perfect, and I can view the php page we created.

      However, when I try to access my ip through another computer on the same network, it doesn’t work, I get a connection has time out error.

      any idea why this may be ?

      Thanks in advance.

      Reply
    14. I think I know what the problem is, but I’m not quite sure how to solve it:

      Both the laptop ( which has the apache installed on it ) using wifi internet connection, and the desktop, which is wired to the internet, use the same ip address.
      as my internet provider gives me a static ip address.
      having said that, I suspect that I won’t be able to access the test.php from the desktop, unless I use a proxy.
      is that right ? if yes, I tried using an online proxy , but still I couldn’t view the page.

      Thanks again.

      Reply
      • Hi Appaloosa,

        Did you open port 80 from firewall?

        Reply
        • Hello,

          well, not sure how to do that, Im following this pdf file:

          http://www.smc.com/files/AJ/SMCD3GN-UserManual_Rogers.pdf

          I followed the port forwarding example on page 64. But that didn’t help much. Can u you look at it and tell me what else I need to do ?

          Now your question:
          I have no idea how to let the open port 80 on the firewall. ?

          Also, what should I have for my Listen directive in httpd.conf ?

          can u give me some guidance ?

          Thanks :)

          Reply
          • sorry, I forgot to mention that the following fails on me

            service iptables restart
            Redirecting to /bin/systemctl restart iptables.service
            Job failed. See system logs and ‘systemctl status’ for details.

            oooppps.

            Reply
            • Update :

              I fixed the iptable issue, still can’t access the local host using ip address.
              I had the port statment in iptables after COMMIT, not before :)

              now I get this :

              # service iptables restart
              Redirecting to /bin/systemctl restart iptables.service

              /etc/init.d/iptables restart
              bash: /etc/init.d/iptables: No such file or directory

              Im off for the night, I’ll come back tomorrow, crossing my fingers that tomorrow I’ll get it to work. can’t wait to be able to access it from anywehre.

              Reply
              • Actually you have to have it before commit, like:

                
                ...
                -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
                -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
                -A INPUT -j REJECT --reject-with icmp-host-prohibited
                -A FORWARD -j REJECT --reject-with icmp-host-prohibited
                COMMIT
                
                Reply
                • yeah I have it like that…still same problem. !?

                  Reply
                  • Could you restart iptables without any errors?

                    Reply
                    • I do have errors:

                      When I run :

                      $>service iptables restart
                      Redirecting to /bin/systemctl restart iptables.service

                      When I run :

                      /etc/init.d/iptables restart
                      bash: /etc/init.d/iptables: No such file or directory

                      so , it says file does not exist :S

                      Reply
                      • Hi Appaloosa,

                        Could you please post output of following command:

                        
                        iptables -L
                        
    15. [[email protected] appaloosa]# iptables -L
      Chain INPUT (policy ACCEPT)
      target prot opt source destination
      ACCEPT all — anywhere anywhere state RELATED,ESTABLISHED
      ACCEPT icmp — anywhere anywhere
      ACCEPT all — anywhere anywhere
      ACCEPT tcp — anywhere anywhere state NEW tcp dpt:http mark match 0x64
      ACCEPT tcp — anywhere anywhere state NEW tcp dpt:ssh
      ACCEPT tcp — anywhere anywhere state NEW tcp dpt:http
      REJECT all — anywhere anywhere reject-with icmp-host-prohibited

      Chain FORWARD (policy ACCEPT)
      target prot opt source destination
      REJECT all — anywhere anywhere reject-with icmp-host-prohibited

      Chain OUTPUT (policy ACCEPT)
      target prot opt source destination
      [[email protected] appaloosa]#

      [[email protected] appaloosa]#

      Reply
      • Hi Appaloosa,

        Looks like your http port is open and it should work now.

        So make sure that you have httpd server running and try to connect again to your computer ip address with web browser…what happens then?

        Reply
        • which ip address ? my gateway one ? or the LAN one ?

          Reply
          • Your computer ip where server is running, you can check ip(s) with ifconfig command. If you connect from local network then you can use LAN ip address and if you connect from Internet, then use public ip.

            Reply
            • are you saying that if I use public ip within the LAN it won’t work ?

              Because thats what Im trying to do here, the LAN ip works, the public ip does not work within the LAN.

              In other words, 192.168.0.64 ( my LAN ip ), works..I can view the site.

              If I use my public ip, ( from the same machine apache installed on ), it does not work.

              Reply
              • So do you have public ip and LAN ip on your computer? If yes then both should work.

                Are you absolutely sure that your computer / LAN is not behind NAT (or some other firewall setup) and you have real public ip directly on your computer?

                Reply
                • my computer is behind a NAT ( my gateway’s firewall ).
                  I did already configure that firewall to forward requests to my LAN ip.

                  I give up…

                  Thanks anyways JR :)

                  Reply
                  • Okay, you are welcome!

                    I think that the problem should be on firewall configuration, because your web server is working from LAN… :)

                    Reply
1 2 3 4 5 9

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close