Find the answer to your Linux question:
Results 1 to 2 of 2
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    4

    Define Apache New Port


    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?


    PS:
    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):

    tcp 0 0 :::8000 :::* LISTEN 3644/httpd
    tcp 0 0 :::5000 :::* LISTEN 3644/httpd
    tcp 0 0 :::80 :::* LISTEN 3644/httpd
    tcp 0 0 :::8081 :::* LISTEN 3644/httpd

    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).

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    Hi fbgp2000,

    What flavour (distro) of linux are you running?
    Your config with the additional listen 8000 line is fine, so the probability is that there is some form of firewall running somewhere!

    To check your linux server, Post the output of
    Code:
    # iptables --list
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •