Dear Sirs!
I need to change the standard Apache port from 80 to 808(we want to set nginx as a frontend).
I`ve strictly followed this instruction:
http://help.directadmin.com/item.php?id=2
cd /usr/local/directadmin/data/templates
cp virtual_host*.conf custom
cd custom
Than i`ve changed port 80 to 808 in all the files in /usr/local/directadmin/data/templates/custom
<VirtualHost |IP|:80>
to
<VirtualHost |IP|:808>
In /etc/httpd/conf/httpd.conf
I`ve changed
Listen 80
Listen 443
to
Listen 808
Listen 443
then
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
Everething goes ok, but there is an auto insert to user's httpd.conf (line after comments - Port 80)
# Auto generated apache config file by DirectAdmin version 1.31.2
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to his/her website
# Frontpage requires these parameters in every httpd.conf file or else
# it won't work.
Port 80
ServerRoot /etc/httpd
How can i change it?
Beside that i found a topic in russian version of Google Answers:
http://otvety.google.ru/otvety/thread?tid=26436fe31991b29a&table=/otvety/&pli=1
It says:
"We proceed from the premise that the DirectAdmin listens itself the external ip on port 80,
and we can change that - there are different views on this, but it is in most correct. Therefore, we will not touch the directadmin.
Decision:
iptables-t nat-A PREROUTING-d 83.222.25.17-i eth0-p tcp-m tcp - dport 80-m state - state NEW-j REDIRECT - to 85-ports
As a result, all requests that are coming from outside to ip 83.222.25.17 port 80 - will go to 85 port.
Nginx must listen 83.222.25.17:85 and proxy_pass http://83.222.25.17;
Then nginx will receive at 85 port a request and proxies it to apache to 80 port".
This solution, of course, works. But is there another way?
P.s.
I`ve searched this forum for several times.
The most similar topic was
http://www.directadmin.com/forum/showthread.php?t=19817
but the recommendations, that are given are not working in my case - the line "port 80" does not change.
I need to change the standard Apache port from 80 to 808(we want to set nginx as a frontend).
I`ve strictly followed this instruction:
http://help.directadmin.com/item.php?id=2
cd /usr/local/directadmin/data/templates
cp virtual_host*.conf custom
cd custom
Than i`ve changed port 80 to 808 in all the files in /usr/local/directadmin/data/templates/custom
<VirtualHost |IP|:80>
to
<VirtualHost |IP|:808>
In /etc/httpd/conf/httpd.conf
I`ve changed
Listen 80
Listen 443
to
Listen 808
Listen 443
then
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
Everething goes ok, but there is an auto insert to user's httpd.conf (line after comments - Port 80)
# Auto generated apache config file by DirectAdmin version 1.31.2
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to his/her website
# Frontpage requires these parameters in every httpd.conf file or else
# it won't work.
Port 80
ServerRoot /etc/httpd
How can i change it?
Beside that i found a topic in russian version of Google Answers:
http://otvety.google.ru/otvety/thread?tid=26436fe31991b29a&table=/otvety/&pli=1
It says:
"We proceed from the premise that the DirectAdmin listens itself the external ip on port 80,
and we can change that - there are different views on this, but it is in most correct. Therefore, we will not touch the directadmin.
Decision:
iptables-t nat-A PREROUTING-d 83.222.25.17-i eth0-p tcp-m tcp - dport 80-m state - state NEW-j REDIRECT - to 85-ports
As a result, all requests that are coming from outside to ip 83.222.25.17 port 80 - will go to 85 port.
Nginx must listen 83.222.25.17:85 and proxy_pass http://83.222.25.17;
Then nginx will receive at 85 port a request and proxies it to apache to 80 port".
This solution, of course, works. But is there another way?
P.s.
I`ve searched this forum for several times.
The most similar topic was
http://www.directadmin.com/forum/showthread.php?t=19817
but the recommendations, that are given are not working in my case - the line "port 80" does not change.