Apache Installed



  • I have tried the Ubuntu 16.04 for the Apache installation.How about the live troubleshooting once installed the apache?
    Only Apache and Nginx is installed in the offline mode as the internet is blocking inside the VM workstation.
    I having offline machine in the vm where the troubleshooting for the appache will be done.
    The test page is seen in the loopback address of the machine.
    Any good suggestion for the live troubleshooting??????



  • @Lakshmana said in Apache Installed:

    Only Apache and Nginx is installed in the offline mode as the internet is blocking inside the VM workstation.

    Why are two web servers installed on the same system?



  • @Lakshmana said in Apache Installed:

    The test page is seen in the loopback address of the machine.
    Any good suggestion for the live troubleshooting??????

    What's the issue? Sounds like it is working correctly.



  • Just for testing the status of two web servers in the same machine



  • @Lakshmana said in Apache Installed:

    Just for testing the status of two web servers in the same machine

    But you would never have two on the same machine, they need the same ports.



  • Ok I will uninstall the Nginx from the machine and how to use the apache ??



  • @Lakshmana said in Apache Installed:

    Ok I will uninstall the Nginx from the machine and how to use the apache ??

    What's not working with Apache? Your description sounded like it was working perfectly. What is wrong with it?



  • @scottalanmiller I have installed the apache server in the machine and checked the loopback address in the browser and after that the nginx is installed but not configured properly.
    I need to check the status of the apache by deleting any files in the apache file and other things to test in the web browser



  • @Lakshmana said in Apache Installed:

    @scottalanmiller I have installed the apache server in the machine and checked the loopback address in the browser and after that the nginx is installed but not configured properly.

    Well yes, you can only have one and whichever one you start first will be the only one you can see. The other cannot start with the first one is there. Pick the one that you want and remove the other.



  • @Lakshmana said in Apache Installed:

    I need to check the status of the apache by deleting any files in the apache file and other things to test in the web browser

    I'm unclear what you want to test. Apache by default has one page and it shows it. You can delete it, but then there is nothing to show. Web servers are very basic, there is very little to test.



  • @scottalanmiller For the purpose of interview i need to check the process in the apache servers.



  • @Lakshmana said in Apache Installed:

    @scottalanmiller For the purpose of interview i need to check the process in the apache servers.

    You don't do that as you describe. Use the ps command to check on the process. Use the netstat command to see if it is listening.



  • @scottalanmiller When netstat tried in the putty session





























































































































































































  • @Lakshmana
    [[email protected] ~]$ /etc/init.d/httpd status
    httpd dead but subsys locked



  • For netstat, use these options for best results...

    netstat -tulpn


  • @Lakshmana said in Apache Installed:

    @Lakshmana
    [[email protected] ~]$ /etc/init.d/httpd status
    httpd dead but subsys locked

    Is Nginx still running? If not, was httpd restarted after it was removed?

    systemctl restart httpd


  • @scottalanmiller

    (Not all processes could be identified, non-owned process info
    will not be shown, you would have to be root to see it all.)
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
    tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
    tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN -
    tcp 0 0 :::80 :::* LISTEN -
    tcp 0 0 :::22 :::* LISTEN -
    tcp 0 0 ::1:631 :::* LISTEN -
    tcp 0 0 ::1:25 :::* LISTEN -
    udp 0 0 0.0.0.0:631 0.0.0.0:* -
    udp 0 0 0.0.0.0:68 0.0.0.0:*



  • @Lakshmana please post the output of

    netstat -anp tcp | grep listening | grep 80

    assuming you want to run on port 80. Please also post the output of

    ps ax | grep -v grep | grep -E 'apache|httpd'

    OK, not required anymore. About the error: ps ax, not ps -ax, my bad



  • @thwr [[email protected] ~]$ ps -ax | grep -v grep | grep -E 'apache|httpd'
    Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
    2239 ? Ss 0:00 /usr/sbin/httpd
    2246 ? S 0:00 /usr/sbin/httpd
    2247 ? S 0:00 /usr/sbin/httpd
    2248 ? S 0:00 /usr/sbin/httpd
    2249 ? S 0:00 /usr/sbin/httpd
    2250 ? S 0:00 /usr/sbin/httpd
    2251 ? S 0:00 /usr/sbin/httpd
    2252 ? S 0:00 /usr/sbin/httpd
    2253 ? S 0:00 /usr/sbin/httpd



  • @thwr [[email protected] ~]$ netstat -anp tcp | grep listening | grep 80
    usage: netstat [-veenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}
    netstat [-vnNcaeol] [<Socket> ...]
    netstat { [-veenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s } [delay]

        -r, --route                display routing table
        -I, --interfaces=<Iface>   display interface table for <Iface>
        -i, --interfaces           display interface table
        -g, --groups               display multicast group memberships
        -s, --statistics           display networking statistics (like SNMP)
        -M, --masquerade           display masqueraded connections
    
        -v, --verbose              be verbose
        -n, --numeric              don't resolve names
        --numeric-hosts            don't resolve host names
        --numeric-ports            don't resolve port names
        --numeric-users            don't resolve user names
        -N, --symbolic             resolve hardware names
        -e, --extend               display other/more information
        -p, --programs             display PID/Program name for sockets
        -c, --continuous           continuous listing
    
        -l, --listening            display listening server sockets
        -a, --all, --listening     display all sockets (default: connected)
        -o, --timers               display timers
        -F, --fib                  display Forwarding Information Base (default)
        -C, --cache                display routing cache instead of FIB
        -T, --notrim               stop trimming long addresses
        -Z, --context              display SELinux security context for sockets
    

    <Iface>: Name of interface to monitor/list.
    <Socket>={-t|--tcp} {-u|--udp} {-S|--sctp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom
    <AF>=Use '-A <af>' or '--<af>'; default: inet
    List of possible address families (which support routing):
    inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
    netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
    x25 (CCITT X.25)



  • @Lakshmana said in Apache Installed:

    @scottalanmiller

    (Not all processes could be identified, non-owned process info
    will not be shown, you would have to be root to see it all.)
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
    tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
    tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN -
    tcp 0 0 :::80 :::* LISTEN -
    tcp 0 0 :::22 :::* LISTEN -
    tcp 0 0 ::1:631 :::* LISTEN -
    tcp 0 0 ::1:25 :::* LISTEN -
    udp 0 0 0.0.0.0:631 0.0.0.0:* -
    udp 0 0 0.0.0.0:68 0.0.0.0:*

    Looks like you are forgetting to be root when doing systems administration tasks. Switch to root before doing any of this.



  • netstat -an | grep -i tcp | grep -i listening | grep 80
    
    ps ax | grep -v grep | grep -E 'apache|httpd'
    

    again, my bad. Could be your grep doesn't support -E, just use

    ps ax | grep -v grep | grep apache 
    
    ps ax | grep -v grep | grep httpd
    

    instead.



  • @thwr said in Apache Installed:

    ps ax | grep -v grep | grep httpd

    [[email protected] ~]# ps ax | grep -v grep | grep apache
    [[email protected] ~]# ps ax | grep -v grep | grep httpd
    2239 ? Ss 0:00 /usr/sbin/httpd
    2246 ? S 0:00 /usr/sbin/httpd
    2247 ? S 0:00 /usr/sbin/httpd
    2248 ? S 0:00 /usr/sbin/httpd
    2249 ? S 0:00 /usr/sbin/httpd
    2250 ? S 0:00 /usr/sbin/httpd
    2251 ? S 0:00 /usr/sbin/httpd
    2252 ? S 0:00 /usr/sbin/httpd
    2253 ? S 0:00 /usr/sbin/httpd



  • Okay, so at this point, httpd is definitely running.


Log in to reply