Operating System - Linux
1748195 Members
4357 Online
108759 Solutions
New Discussion юеВ

Re: Changing port 80 to 6080 for apache under linux

 
SOLVED
Go to solution
Henry Chua
Super Advisor

Changing port 80 to 6080 for apache under linux

I try to change the my apache default port from 80 to 6080 but does not seem to work. What i did was:
1. change the "Listen 80" to "Listen 6080",
2. restart by "/etc/init.d/httpd restart", but it show [FAILED]. is there any thing i need to change?

Best regards
Henry
12 REPLIES 12
Maxim Yakimenko
Super Advisor

Re: Changing port 80 to 6080 for apache under linux

My be other app holds socket open on port 6080 preventing apache?
Ivan Ferreira
Honored Contributor

Re: Changing port 80 to 6080 for apache under linux

Check /var/log/httpd/error_log for messages that can idicate what is the cause of the problem.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Henry Chua
Super Advisor

Re: Changing port 80 to 6080 for apache under linux

hrmm.. nothing on the error log, just cannot restart :p
Alexander Chuzhoy
Honored Contributor

Re: Changing port 80 to 6080 for apache under linux

It supposed to work...
what is the output from:
netstat -an|grep 6080


By the way it supposed to show "FAILED" for the stopping phase - I assume that the httpd service was down already.Does it show "FAILED" also for the starting phase?

Henry Chua
Super Advisor

Re: Changing port 80 to 6080 for apache under linux

hi, i can start with port 80 but after changed the port to 6080 it failed.. Anyway do i need to change the port setting on /etc/services?

Thanks.
Henry Chua
Super Advisor

Re: Changing port 80 to 6080 for apache under linux

output of "netstat -an|grep 6080 => nothing"
Alexander Chuzhoy
Honored Contributor

Re: Changing port 80 to 6080 for apache under linux

It works in my case without changing the line in /etc/services. (tried on RHEL 4.3)

Hm, do you use selinux? If so - try to disable it. (Edit /etc/selinux/config and make sure there's a line SELINUX=disabled).
Henry Chua
Super Advisor

Re: Changing port 80 to 6080 for apache under linux

after i disabled it, do i need to restart anything?? =)
Alexander Chuzhoy
Honored Contributor
Solution

Re: Changing port 80 to 6080 for apache under linux

There's a command:
setenforce 0
that turns off the enforcing mode.
Anyway, it's best to reboot to make sure that everything works after reboot.