LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-11-2014, 06:02 AM   #1
tuanhqit
LQ Newbie
 
Registered: Jun 2014
Posts: 21

Rep: Reputation: Disabled
Help! Install apache on VPS.


Hello everybody! I'm a newbie. I'm using amazon's vps. I have installed, service httpd start -> ok. But when i enter my ipaddress
"The connection has timed out".
Right "Apache2 test page" page.
 
Old 06-11-2014, 10:57 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Are you using Amazon EC2? Have you checked that the security policy for your instance allows port 80 (HTTP) traffic through? I don't believe that this is permitted by default. Also, you need to use your instance's public IP (Mnot the private 10.x.x.x internal IP) to connect to your instance.

If both of these look good, run "ps aux" and make sure that Apache is running (the process will probably be called httpd if you're using Amazon Linux, which is a RHEL derivative).
 
1 members found this post helpful.
Old 06-12-2014, 12:06 AM   #3
tuanhqit
LQ Newbie
 
Registered: Jun 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by btmiller View Post
Are you using Amazon EC2? Have you checked that the security policy for your instance allows port 80 (HTTP) traffic through? I don't believe that this is permitted by default. Also, you need to use your instance's public IP (Mnot the private 10.x.x.x internal IP) to connect to your instance.

If both of these look good, run "ps aux" and make sure that Apache is running (the process will probably be called httpd if you're using Amazon Linux, which is a RHEL derivative).
yes, i'm using Amazon EC2. Yes, i checked sercurity policy instance allow inbound rule http :80. Public my ip address is 54.187.248.99. I used to enter on browser.
But still not work.
I'm newbie, i'm not really good english, please leading clearly. thank you. Sorry, if you don't understand what i am saying
 
Old 06-12-2014, 09:29 AM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Run "iptables -L" to make sure you don't have a packet filter on the machine preventing access to port 80. Also, as I said, check and make sure Apache is actually running (when you run "ps aux", do you see the httpd processes?).

Also, see if there is any information in the log files in /var/log/httpd or /var/log/apache2.
 
1 members found this post helpful.
Old 06-12-2014, 02:55 PM   #5
SimonPalmieri
Member
 
Registered: Dec 2013
Location: Ontario, Canada
Distribution: CentOS/Fedora/Arch
Posts: 35

Rep: Reputation: 1
As others have said previously, check that iptables is not dropping traffic destined for port 80, check that the webserver is actually running and you might also want to check if SELinux is set to Enforcing or Permissive mode.
 
1 members found this post helpful.
Old 06-12-2014, 10:59 PM   #6
tuanhqit
LQ Newbie
 
Registered: Jun 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by btmiller View Post
Run "iptables -L" to make sure you don't have a packet filter on the machine preventing access to port 80. Also, as I said, check and make sure Apache is actually running (when you run "ps aux", do you see the httpd processes?).

Also, see if there is any information in the log files in /var/log/httpd or /var/log/apache2.

Here!
[root@ip-172-31-6-114 ec2-user]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


////////////////////////////////////////////////////////////
[root@ip-172-31-6-114 ec2-user]# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.2 2920 1488 ? Ss 22:19 0:00 /sbin/init
root 2 0.0 0.0 0 0 ? S 22:19 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 22:19 0:00 [migration/0]
root 4 0.0 0.0 0 0 ? S 22:19 0:00 [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S 22:19 0:00 [migration/0]
root 6 0.0 0.0 0 0 ? S 22:19 0:00 [watchdog/0]
root 7 0.0 0.0 0 0 ? R 22:19 0:00 [events/0]
root 8 0.0 0.0 0 0 ? S 22:19 0:00 [cgroup]
root 9 0.0 0.0 0 0 ? S 22:19 0:00 [khelper]
root 10 0.0 0.0 0 0 ? S 22:19 0:00 [netns]
root 11 0.0 0.0 0 0 ? S 22:19 0:00 [async/mgr]
root 12 0.0 0.0 0 0 ? S 22:19 0:00 [pm]
root 13 0.0 0.0 0 0 ? S 22:19 0:00 [xenwatch]
root 14 0.0 0.0 0 0 ? S 22:19 0:00 [xenbus]
root 15 0.0 0.0 0 0 ? S 22:19 0:00 [sync_supers]
root 16 0.0 0.0 0 0 ? S 22:19 0:00 [bdi-default]
root 17 0.0 0.0 0 0 ? S 22:19 0:00 [kintegrityd/0]
root 18 0.0 0.0 0 0 ? S 22:19 0:00 [kblockd/0]
root 19 0.0 0.0 0 0 ? S 22:19 0:00 [ata_aux]
root 20 0.0 0.0 0 0 ? S 22:19 0:00 [ata_sff/0]
root 21 0.0 0.0 0 0 ? S 22:19 0:00 [ksuspend_usbd]
root 22 0.0 0.0 0 0 ? S 22:19 0:00 [khubd]
root 23 0.0 0.0 0 0 ? S 22:19 0:00 [kseriod]
root 24 0.0 0.0 0 0 ? S 22:19 0:00 [md/0]
root 25 0.0 0.0 0 0 ? S 22:19 0:00 [md_misc/0]
root 26 0.0 0.0 0 0 ? S 22:19 0:00 [linkwatch]
root 27 0.0 0.0 0 0 ? S 22:19 0:00 [khungtaskd]
root 28 0.0 0.0 0 0 ? S 22:19 0:00 [kswapd0]
root 29 0.0 0.0 0 0 ? SN 22:19 0:00 [ksmd]
root 30 0.0 0.0 0 0 ? S 22:19 0:00 [aio/0]
root 31 0.0 0.0 0 0 ? S 22:19 0:00 [crypto/0]
root 36 0.0 0.0 0 0 ? S 22:19 0:00 [kthrotld/0]
root 38 0.0 0.0 0 0 ? S 22:19 0:00 [khvcd]
root 39 0.0 0.0 0 0 ? S 22:19 0:00 [kpsmoused]
root 40 0.0 0.0 0 0 ? S 22:19 0:00 [usbhid_resume]
root 70 0.0 0.0 0 0 ? S 22:19 0:00 [kstriped]
root 185 0.0 0.0 0 0 ? S 22:19 0:00 [jbd2/xvda1-8]
root 186 0.0 0.0 0 0 ? S 22:19 0:00 [ext4-dio-unwr]
root 195 0.0 0.0 0 0 ? S 22:19 0:00 [flush-202:1]
root 277 0.0 0.1 2720 960 ? S<s 22:20 0:00 /sbin/udevd -d
root 523 0.0 0.0 0 0 ? S 22:20 0:00 [kauditd]
root 695 0.0 0.1 2856 792 ? Ss 22:20 0:00 /sbin/dhclient
root 731 0.0 0.1 12956 792 ? S<sl 22:20 0:00 auditd
root 756 0.0 0.2 36244 1564 ? Sl 22:20 0:00 /sbin/rsyslogd
rpc 787 0.0 0.1 2596 812 ? Ss 22:20 0:00 rpcbind
rpcuser 805 0.0 0.2 2860 1248 ? Ss 22:20 0:00 rpc.statd
dbus 831 0.0 0.1 13264 1072 ? Ssl 22:20 0:00 dbus-daemon --s
root 848 0.0 0.4 12196 2764 ? Ss 22:20 0:00 cupsd -C /etc/c
68 878 0.0 0.3 16628 2396 ? Ssl 22:20 0:00 hald
root 879 0.0 0.2 4000 1224 ? S 22:20 0:00 hald-runner
root 937 0.0 0.2 29036 1604 ? Ssl 22:20 0:00 automount --pid
root 1059 0.0 0.1 8964 1056 ? Ss 22:21 0:00 /usr/sbin/sshd
root 1154 0.0 0.4 12980 2592 ? Ss 22:21 0:00 /usr/libexec/po
postfix 1160 0.0 0.4 13056 2548 ? S 22:21 0:00 pickup -l -t fi
postfix 1161 0.0 0.4 13128 2592 ? S 22:21 0:00 qmgr -l -t fifo
root 1178 0.0 0.1 5328 912 ? Ss 22:21 0:00 /usr/sbin/abrtd
root 1186 0.0 0.2 6028 1288 ? Ss 22:21 0:01 crond
root 1197 0.0 0.0 3008 472 ? Ss 22:21 0:00 /usr/sbin/atd
root 1210 0.0 0.1 5168 652 ? Ss 22:21 0:00 /usr/bin/rhsmce
root 1225 0.0 0.1 8796 832 ? Ss 22:21 0:00 /usr/sbin/certm
root 1237 0.0 0.0 2028 504 tty1 Ss+ 22:21 0:00 /sbin/mingetty
root 1239 0.0 0.0 2028 508 tty2 Ss+ 22:21 0:00 /sbin/mingetty
root 1241 0.0 0.0 2028 508 tty3 Ss+ 22:21 0:00 /sbin/mingetty
root 1243 0.0 0.0 2028 512 tty4 Ss+ 22:21 0:00 /sbin/mingetty
root 1248 0.0 0.2 3376 1824 ? S< 22:21 0:00 /sbin/udevd -d
root 1249 0.0 0.2 3376 1808 ? S< 22:21 0:00 /sbin/udevd -d
root 1250 0.0 0.0 2028 508 tty5 Ss+ 22:21 0:00 /sbin/mingetty
root 1252 0.0 0.0 2028 512 tty6 Ss+ 22:21 0:00 /sbin/mingetty
root 1487 0.0 0.5 11908 3356 ? Ss 22:49 0:00 sshd: ec2-user
ec2-user 1492 0.0 0.2 11908 1628 ? S 22:49 0:00 sshd: ec2-user@
ec2-user 1493 0.0 0.2 5144 1692 pts/0 Ss 22:49 0:00 -bash
root 1517 0.0 0.4 10648 2544 pts/0 S 22:49 0:00 sudo su
root 1519 0.0 0.2 7504 1780 pts/0 S 22:49 0:00 su
root 1520 0.0 0.2 5244 1760 pts/0 S 22:49 0:00 bash
root 1617 0.0 0.1 2036 640 ttyS0 Ss+ 22:55 0:00 /sbin/agetty /d
root 1618 6.0 0.1 4956 1068 pts/0 R+ 22:55 0:00 ps aux
 
Old 06-12-2014, 11:05 PM   #7
tuanhqit
LQ Newbie
 
Registered: Jun 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by SimonPalmieri View Post
As others have said previously, check that iptables is not dropping traffic destined for port 80, check that the webserver is actually running and you might also want to check if SELinux is set to Enforcing or Permissive mode.
yes, i sure, SElinux is set to enforcing.
[root@ip-172-31-6-114 ec2-user]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
 
Old 06-12-2014, 11:13 PM   #8
tuanhqit
LQ Newbie
 
Registered: Jun 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by btmiller View Post
Run "iptables -L" to make sure you don't have a packet filter on the machine preventing access to port 80. Also, as I said, check and make sure Apache is actually running (when you run "ps aux", do you see the httpd processes?).

Also, see if there is any information in the log files in /var/log/httpd or /var/log/apache2.
[root@ip-172-31-6-114 httpd]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

[root@ip-172-31-6-114 httpd]#ps aux
root 1670 0.0 0.5 11384 3396 ? Ss 22:56 0:00 /usr/sbin/httpd
apache 1672 0.0 0.3 11384 2096 ? S 22:56 0:00 /usr/sbin/httpd
apache 1673 0.0 0.3 11384 2096 ? S 22:56 0:00 /usr/sbin/httpd
apache 1674 0.0 0.3 11384 2096 ? S 22:56 0:00 /usr/sbin/httpd
apache 1675 0.0 0.3 11384 2096 ? S 22:56 0:00 /usr/sbin/httpd
apache 1676 0.0 0.3 11384 2096 ? S 22:56 0:00 /usr/sbin/httpd
apache 1677 0.0 0.3 11384 2096 ? S 22:56 0:00 /usr/sbin/httpd
apache 1678 0.0 0.3 11384 2096 ? S 22:56 0:00 /usr/sbin/httpd
apache 1679 0.0 0.3 11384 2096 ? S 22:56 0:00 /usr/sbin/httpd
 
Old 06-12-2014, 11:20 PM   #9
SimonPalmieri
Member
 
Registered: Dec 2013
Location: Ontario, Canada
Distribution: CentOS/Fedora/Arch
Posts: 35

Rep: Reputation: 1
Quote:
Originally Posted by tuanhqit View Post
yes, i sure, SElinux is set to enforcing.
[root@ip-172-31-6-114 ec2-user]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Okay, as long as you are using your DocumentRoot for the website the SeLinux context shouldn't be the problem. Have you made any changes to the httpd.conf configuration file by any chance?
 
Old 06-12-2014, 11:34 PM   #10
tuanhqit
LQ Newbie
 
Registered: Jun 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by SimonPalmieri View Post
Okay, as long as you are using your DocumentRoot for the website the SeLinux context shouldn't be the problem. Have you made any changes to the httpd.conf configuration file by any chance?
No, i don't have any changes to the httpd.conf
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to install WordPress Multisite on Centos VPS with Apache LXer Syndicated Linux News 0 11-20-2013 05:01 AM
Permissions, users and security with Apache, suPHP and vsftpd and on vps pernest Linux - Server 5 07-22-2011 09:16 AM
Apache crashing VPS - need to reduce memory usage rhodri Linux - Server 2 02-15-2010 04:00 AM
Apache and FTP vps to work more like godaddy shared hosting fishdink Linux - Server 1 06-19-2009 08:55 AM
Where can I download UML VPS or Xen VPS to make a virtual private server? abefroman Linux - Software 3 12-09-2005 11:00 AM


All times are GMT -5. The time now is 11:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration