Apache Installed
-
For netstat, use these options for best results...
netstat -tulpn
-
@Lakshmana said in Apache Installed:
@Lakshmana
[test@localhost ~]$ /etc/init.d/httpd status
httpd dead but subsys lockedIs Nginx still running? If not, was httpd restarted after it was removed?
systemctl restart httpd
-
(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 80assuming 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 [test@localhost ~]$ 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 [test@localhost ~]$ 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:
(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
[root@localhost ~]# ps ax | grep -v grep | grep apache
[root@localhost ~]# 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.