Operating System - Linux
1819814 Members
2735 Online
109607 Solutions
New Discussion юеВ

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.
Henry Chua
Super Advisor

Re: Changing port 80 to 6080 for apache under linux

it works now.. but is there any repercussion for disabling SELINUX?.. or should i configure it to accept traffic from this port.
Alexander Chuzhoy
Honored Contributor

Re: Changing port 80 to 6080 for apache under linux

Follow the link:
http://www.nsa.gov/selinux/info/faq.cfm#I2


There's a way to make everything (or almost evrything ) work with selinux. There are lots of guides on the internet and it's something that you'll spend some time learning - if of course you'd like to use it on your machines...

Henry Chua
Super Advisor

Re: Changing port 80 to 6080 for apache under linux

Cool.. thanks Alex! =)