LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-01-2011, 04:36 AM   #1
agriz
Member
 
Registered: Nov 2011
Posts: 197

Rep: Reputation: Disabled
website is not loading


Hi

I have done the following

1) Changed ssh port
2) disabled root login through ssh
3) Installed few firewalls
4) block everything in iptables except 80,8080 and ssh port
5) Finally installed apache php mysql and phpmyadmin

Started the services but when hitting the ipaddress in the browser, i don't see any output

I have just added a index.html in /var/www/html/index.html
 
Old 12-01-2011, 05:29 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
what would ssh have to do with apache? you need to appreciate what is and what is not relevant here.

is apache running? What does "any output" mean? clearly *something* must happen. where are you browsing from? can you ping the box? etc.?
 
Old 12-01-2011, 05:35 AM   #3
agriz
Member
 
Registered: Nov 2011
Posts: 197

Original Poster
Rep: Reputation: Disabled
SSH has nothing to do. I just wanted to tell whatever i did in the order.
httpd is running

I guess, I should have missed some settings or something should be blocking 80. I am not able to find those things

When i type the ip address in the url (domain is not configured to nameservers right now)
I am getting the following

Quote:
Oops! Google Chrome could not connect to xxx.xxx.xxx.xxx
When i ping my ip address, I am getting result
Quote:
64 bytes from xxx.xxx.xxx.xxx: icmp_seq=1 ttl=64 time=0.019 ms
64 bytes from xxx.xxx.xxx.xxx: icmp_seq=2 ttl=64 time=0.032 ms
64 bytes from xxx.xxx.xxx.xxx: icmp_seq=3 ttl=64 time=0.024 ms
64 bytes from xxx.xxx.xxx.xxx: icmp_seq=4 ttl=64 time=0.012 ms

Additionally,

/etc/hosts

Quote:
xxx.xxx.xxx.xxx server1.example.com server1
The public DNS are 4.2.2.2 and 4.2.2.1

Last edited by agriz; 12-01-2011 at 05:39 AM.
 
Old 12-01-2011, 05:52 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
so what are your iptables rules? does netstat show apache is listening? can you telnet to the port from your client? can you connect from the server itself?
 
Old 12-01-2011, 05:59 AM   #5
agriz
Member
 
Registered: Nov 2011
Posts: 197

Original Poster
Rep: Reputation: Disabled
Quote:
httpd 12697 root 4u IPv6 99363 0t0 TCP *:80 (LISTEN)
I don't see any IPv4
is that normal?
 
Old 12-01-2011, 06:01 AM   #6
agriz
Member
 
Registered: Nov 2011
Posts: 197

Original Poster
Rep: Reputation: Disabled
Iptable rules

Quote:
iptables -p input drop
Quote:
iptables -a input i eth0 -p tcp --dport 80 -j accept
Quote:
iptables -a input i eth0 -p tcp --dport 8080 -j accept
Quote:
iptables -A INPUT -p tcp --dport 22 -m recent --set --name ssh --rsource
iptables -A INPUT -p tcp --dport 22 -m recent ! --rcheck --seconds 60 --hitcount 4 --name ssh --rsource -j ACCEPT
I can connect to the server from home using ssh.
I don't have telnet in server, bash: telnet: command not found

Last edited by agriz; 12-01-2011 at 06:03 AM.
 
Old 12-01-2011, 06:21 AM   #7
agriz
Member
 
Registered: Nov 2011
Posts: 197

Original Poster
Rep: Reputation: Disabled
I just stopped iptables and it is working.
What could be the reason?
Is someother port needed except 80?

How do i delete all the iptables rules to create new rules freshly?
 
Old 12-01-2011, 06:48 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
I don't know what the reason is, as you've not shown me the actual rules, just your additions.

iptables -Lnv

What distro is this on?
 
0 members found this post helpful.
Old 12-01-2011, 06:49 AM   #9
agriz
Member
 
Registered: Nov 2011
Posts: 197

Original Poster
Rep: Reputation: Disabled
I have restarted IPTables now

iptables -Lnv
iptables: No chain/target/match by that name.
 
Old 12-01-2011, 07:03 AM   #10
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by agriz View Post
I just stopped iptables and it is working.
What could be the reason?
Is someother port needed except 80?

How do i delete all the iptables rules to create new rules freshly?
you can try this

Code:
# iptables -D input i eth0 -p tcp --dport 80 -j accept
and add a new rule

Code:
# iptables -A INPUT -i eth0 -d 192.168.0.0/24 -p tcp --dport 80 -j ACCEPT
(make changes in the range as per your network)
 
Old 12-01-2011, 07:19 AM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well as you've stopped iptables there are no rules to show... start it again.
 
Old 12-01-2011, 08:36 AM   #12
agriz
Member
 
Registered: Nov 2011
Posts: 197

Original Poster
Rep: Reputation: Disabled
Server is down. I will update soon.
 
Old 12-01-2011, 11:27 AM   #13
agriz
Member
 
Registered: Nov 2011
Posts: 197

Original Poster
Rep: Reputation: Disabled
Quote:
service iptables start
Quote:
iptables -Lnv
Quote:
No chain/target/match by that name.
Quote:
iptables -D input -i eth0 -p tcp --dport 80 -j accept
Quote:
iptables v1.4.7: Couldn't load target `accept':/lib64/xtables/libipt_accept.so: cannot open shared object file: No such file or directory
I don't have any rule in iptables now?
 
Old 12-01-2011, 01:12 PM   #14
agriz
Member
 
Registered: Nov 2011
Posts: 197

Original Poster
Rep: Reputation: Disabled
I am using CentOS 6
 
Old 12-01-2011, 06:36 PM   #15
d3vrandom
Member
 
Registered: Jun 2006
Location: Karachi, Pakistan
Distribution: OpenSUSE, CentOS, Debian
Posts: 59

Rep: Reputation: 9
Post the output of:

Quote:
iptables -nL
The others gave you the wrong command..
 
  


Reply



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
Loading website problem surfer41 Debian 3 12-02-2006 08:11 PM
Problem loading website LetMeTryToo Linux - Software 2 11-23-2006 03:31 AM
wierd loading of website titanium_geek LQ Suggestions & Feedback 3 06-02-2005 10:16 AM
Not sure where to post for help with website loading AndeAnderson Linux - Newbie 5 04-15-2005 07:07 AM
Images not loading in website robojerk Linux - Newbie 1 02-17-2005 09:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:06 PM.

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
Open Source Consulting | Domain Registration