Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
First of all, I have to say that I'm a beginner in Linux. Sorry if I ask any dummy question.
I have run apache on my server and I have been using this web service as my programming test server (Apache/PHP/MySQL). During this time, Apache has been using port 80 as the default and only available port for http.
Right now, I need to let other coders to access this server remotely through a valid IP. Because my ISP has blocked port 80, I have decided to make apache available on another port as well as 80. To do so, I checked the Internet and noticed that just one line should be added to http.conf and that is:
Listen 8000
So I added this line bellow the line "Listen 80" and then restarted httpd service. But the result was not as I expected. Port 80 did work perfectly but port 8000 is not working while calling the address 192.168.1.5:8000.
What I have checked or tested till now are as bellow:
- I thought maybe I was editing a wrong http.conf file. So I commented the line "Listen 80". If the file was a wrong one, then I could browse my server without that line. But the httpd server went down and that proves the file is not a fake.
- Each time when I changed the port and restarted apache, I used telnet command from windows OS on both 80 and 8000 ports. Port 80 responded correctly to telnet command but respond for port 8000 was as bellow:
Connecting to 192.168.1.5... Could not open connection to the host, on port 8000: Connection failed
- I checked my client to ensure that port 8000 is not being blocked by my personal firewall and I'm sure it's not blocked by a personal firewall.
- There is no firewall installed on my windows servers. As far as I know, there is no firewall installed on my Linux Coding Server either. I say "as far as I know" because I'm not fluent in Linux. But I checked if IPTables is installed on this server, and it wasn't. I don't think there is any other kind of firewall installed on this server because I installed the OS on this server by myself and I didn't install any firewall. But I'm not sure if there were any firewalls in the typical install routine.
Does anybody guess what could go wrong in my system?
I checked the being listened ports with the command of "netstat -nlp" and the answer shows that httpd is listening to port 8000 (and 8081 and 5000 which I added them all):
But, still I can not telnet to the server on ports 8081, 8000 and 5000. I also can not open 192.168.1.5 on the 3 mentioned ports (But I can open it on port 80).
Quote:
Originally Posted by fbgp2000
First of all, I have to say that I'm a beginner in Linux. Sorry if I ask any dummy question.
I have run apache on my server and I have been using this web service as my programming test server (Apache/PHP/MySQL). During this time, Apache has been using port 80 as the default and only available port for http.
Right now, I need to let other coders to access this server remotely through a valid IP. Because my ISP has blocked port 80, I have decided to make apache available on another port as well as 80. To do so, I checked the Internet and noticed that just one line should be added to http.conf and that is:
Listen 8000
So I added this line bellow the line "Listen 80" and then restarted httpd service. But the result was not as I expected. Port 80 did work perfectly but port 8000 is not working while calling the address 192.168.1.5:8000.
What I have checked or tested till now are as bellow:
- I thought maybe I was editing a wrong http.conf file. So I commented the line "Listen 80". If the file was a wrong one, then I could browse my server without that line. But the httpd server went down and that proves the file is not a fake.
- Each time when I changed the port and restarted apache, I used telnet command from windows OS on both 80 and 8000 ports. Port 80 responded correctly to telnet command but respond for port 8000 was as bellow:
Connecting to 192.168.1.5... Could not open connection to the host, on port 8000: Connection failed
- I checked my client to ensure that port 8000 is not being blocked by my personal firewall and I'm sure it's not blocked by a personal firewall.
- There is no firewall installed on my windows servers. As far as I know, there is no firewall installed on my Linux Coding Server either. I say "as far as I know" because I'm not fluent in Linux. But I checked if IPTables is installed on this server, and it wasn't. I don't think there is any other kind of firewall installed on this server because I installed the OS on this server by myself and I didn't install any firewall. But I'm not sure if there were any firewalls in the typical install routine.
Does anybody guess what could go wrong in my system?
I commented the line reading "Listen 80" and all the other lines mentioning port numbers. Then I wrote a line reading "Listen 8000". Then I restarted apache. But it didn't work. Then I restarted my Linux server. It didn't work again.
As I mentioned before, when I enable the both ports of 80 and 8000 in apache, netstat reports that linux is listening to these two ports. Output of netstat is as bellow:
I commented the line reading "Listen 80" and all the other lines mentioning port numbers. Then I wrote a line reading "Listen 8000". Then I restarted apache. But it didn't work. Then I restarted my Linux server. It didn't work again.
I commented the line reading "Listen 80" and all the other lines mentioning port numbers.
You don't want to go randomly commenting lines just because they mention a port number. The Listen directive is what Apache uses to determine which port it should listen to, so if you've changed other directives, you may have inadvertently caused other problems. If I were in your shoes, I'd take the stock httpd.conf and change just the Listen line and restart Apache. If it doesn't work, you need to start digging in the log files of your server (usually in /var/log) and see what Apache is complaining about.
Also, when you say "it doesn't work", what exactly do you mean? Are you still using telnet or are you trying to connect through a browser? The browser is more likely to give some useful information.
I don't think you'd be able to get Apache running if it didn't like your config. Your netstat output even shows the daemon listening on 8000. I really want to say you do have IPtables on this box... What distro are you using?
These may be helpful:
To list iptable rules:
/usr/sbin/iptables -L
or
/sbin/iptables -L
To disable iptables (RHEL based systems):
service iptables stop
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.