LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-05-2002, 10:40 AM   #1
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Rep: Reputation: 15
changing Apache port


After searching the forums, I found that I am supposed to change the line in httpd.conf that reads
Port <number>

Well, I went into httpd.conf, and found

"<IfDefine !APACHEPROXIED>
Port 80
Listen 80
</IfDefine>
<IfDefine APACHEPROXIED>
Port 8080
Listen 8080
</IfDefine>"

I changed the above to

<IfDefine !APACHEPROXIED>
Port 81
Listen 81
</IfDefine>
<IfDefine APACHEPROXIED>
Port 81
Listen 81
</IfDefine>

I ran "/usr/sbin/apachectl restart" and "/etc/rc.d/init.d/httpd restart"

I can connect to my server by typing localhost, but if I try localhost:81, it says,

"Could not conenct to host localhost (port 81)"

You don't have to tell me how to do it, just a little advice is all I am looking for.

Last edited by GabeF; 10-06-2002 at 05:30 PM.
 
Old 10-07-2002, 04:55 AM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Try this

"<IfDefine !APACHEPROXIED>
Port 80
Listen 80
Listen 81
</IfDefine>
<IfDefine APACHEPROXIED>
Port 8080
Listen 8080
</IfDefine>"

Regards,
Peter
 
Old 10-07-2002, 07:40 AM   #3
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Original Poster
Rep: Reputation: 15
Nope, that didn't do it. Is there some special procedure that I have to follow? I ran a netstat and port 81 didn't even show up.

Do I have to .configure apache?

Last edited by GabeF; 10-07-2002 at 07:51 AM.
 
Old 10-07-2002, 09:29 AM   #4
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Try the 2 Listen Directives by themselves, just before those <IfDefine > ones...
(Then, of course, restart httpd.)

Regards,
Peter
 
Old 10-07-2002, 10:58 AM   #5
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Did you try a complete stop and start (as opposed to simple restart)? I've noticed that some of my directive changes don't take affect when just a restart is done.
 
Old 10-07-2002, 03:13 PM   #6
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Original Poster
Rep: Reputation: 15
I completely stopped httpd and then edited the httpd.conf so that references to port 80 were commented:

.....
# BindAddress *

Port 81
Listen 81

<IfDefine !APACHEPROXIED>
# Port 80
# Listen 80

Port 81
Listen 81
</IfDefine>

.....

Then I started httpd and looked at netconf. It says its listening on port 81. However, trying to connect to localhost:81 yields the can't connect to host error. Netstat shows port 80 but not 81.
 
  


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
Changing pop3 port ?? frzburn Linux - Networking 3 12-24-2004 09:33 AM
Changing port 25 sureplan_ian Linux - Networking 6 11-24-2004 12:02 AM
about changing the port no dummyagain Linux - Security 2 09-13-2004 04:24 AM
Changing relay port rchilakapati Linux - Newbie 0 09-29-2003 08:44 PM
Changing SSH Port taran Linux - Networking 2 08-10-2003 11:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:27 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