ips.conf template

Ghadamyari

Verified User
Joined
Aug 13, 2011
Messages
32
Hello,

I've runned a reverse proxy on my da server, I've modified the /usr/local/directadmin/data/templates/custom template files as needed and everything is fine now except the ips.conf .
The /etc/httpd/conf/ips.conf is rewritten with the server ips everytime I add a new user to the server. I couldn't find the template file of ips.conf
I need it always remain 'NameVirtualHost 127.0.0.1:81'.

Please help.

Thanks
 
the ips.conf is ips_virtual_host.conf in the template folder

Hello,

I've noticed the file before and modified it.But the file's content looks like below :
Code:
<VirtualHost 127.0.0.1:81>
        ServerName shared.domain
        ScriptAliasMatch ^/~([^/]+)/+cgi-bin/+(.*) /home/$1/public_html/cgi-bin/$2
        AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
        DocumentRoot |DOCROOT|
|*if APACHE_VER="2.0"|
        SuexecUserGroup |USER| |GROUP|
|*else|
        User |USER|
        Group |GROUP|
|*endif|
        CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

<VirtualHost 127.0.0.1:444>
        SSLEngine on
        SSLCertificateFile |CERT|
        SSLCertificateKeyFile |KEY|
        ServerName shared.domain
        ScriptAliasMatch ^/~([^/]+)/+cgi-bin/+(.*) /home/$1/public_html/cgi-bin/$2
        AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
        DocumentRoot |DOCROOT|
|*if APACHE_VER="2.0"|
        SuexecUserGroup |USER| |GROUP|
|*else|
        User |USER|
        Group |GROUP|
|*endif|
        CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

It not works, also my ips.conf file looks like below which is completely different from the template file :
Code:
# Auto generated apache config file by DirectAdmin version 1.39.1
# Modifying this file is not recommended as any changes you make will be
# overwritten when you add/remove ip's through DirectAdmin.

LogFormat "%O \"%r\"" homedir
NameVirtualHost IP1:80
NameVirtualHost IP1:443
NameVirtualHost IP2:80
NameVirtualHost IP2:443
 
Not sure why it has 127.0.0.1, it should have |IP| instead. Unless youre behind a proxy or something?

Have you a ips_virtual_host.conf in /usr/local/directadmin/data/templates/custom/ ?
 
@Peter Laws

See the first line

I've runned a reverse proxy on my da server,


@Ghadamyari

I would suggest you to live /etc/httpd/conf/ips.conf as it is without any modification, instead of this, update your /etc/httpd/conf/httpd.conf and change line

Code:
Listen *:80

to

Code:
Listen 127.0.0.1:80

or

Code:
Listen 127.0.0.1:81

if you still need 81 port.

And add 127.0.0.1 in Directadmin IP manager page and mark it as shared.

Note, if you make apache to listen only on 127.0.0.1, you might want to switch all virtualhosts to port 80. And then content of ips.conf won't make big difference.
 
I've added +i attribute to the ips.conf file to prevent it from being written by directadmin.
But this is not the correct way and directadmin developers should make a working ips.conf template !
 
A solution has been already suggested. Add 127.0.0.1 via directadmin IPs manager.
 
The best way to do it would be to have apache port as a configoption in DA. That way you could change that in one file, and wouldn't be so hard to implement.

Anyhow, I do it this way: just add "NameVirtualHost IP1:81" in /etc/httpd/conf/extra/httpd-includes.conf and do it for every IP (that's a problem if you have many of them).
 
Adding 127.0.0.1 will cause some problems in dns records.

How? When adding an IP on a page of IP manager nothing gets into any DNS zone.

And of course, when creating an account you should select a real IP from the list. I suggest adding 127.0.0.1 in directadmin to get a valid structure of 'NameVirtualHost' records in ips.conf. That's it. I've been using this structure about 3-4 years till now, and everything is working OK.

And of course in httpd templates, I've replaced

Code:
<VirtualHost |IP|:80>

with

Code:
<VirtualHost 127.0.0.1:80>


Thus, I've got a real IP in DNS zone for every domain and VirtualHost with 127.0.0.1 on backend (Apache) and a real IP on frontend (nginx).
 
Thus, I've got a real IP in DNS zone for every domain and VirtualHost with 127.0.0.1 on backend (Apache) and a real IP on frontend (nginx).
That way you'd just screwed up owned IP support in Apache, because when you go to http://123.123.123.123:80/ then you'd receive "Apache is functioning normaly" or whatever your index is in /var/www/html.
 
Nope, that's not true, since I've got virtual hosts in nginx. The moment you're talking about is not an issue for me.
 
Nope, that's not true, since I've got virtual hosts in nginx. The moment you're talking about is not an issue for me.
If that's so, I agree.

However, it would be nice to have apache port in config as variable.
 
Back
Top