Web Hosting Talk







View Full Version : Wildcards with PHP


Starhost
04-20-2001, 02:40 PM
Hi all, I was wodnering if it is possible, to make automaticly wildcards for the dns by using php (as cgi) and cron.

With PHP you are able to create files ( the pri.domain.com.include) and write the correct info in it without using the gui os some kind of database.

Do you guys think it is possible? If so, how would you do it? (especially how do I save it to the dns, in other words what does the save funvtion do in the Gui's dns).

jks
04-22-2001, 05:34 AM
Yes, sure it is possible -- it's actually quite easy.

The trick is, that the PHP function must run with enough privileges to create files in the /etc/named/ directory. Do not - _DO NOT_ - make the /etc/named/ directory world readable.

You could f.ex. run your scripts off the admin server, which is already running as root.

After writing to the include file, you just need to run the dns update command (Cobalt):

/usr/admserv/cgi-bin/.cobalt/dns/index.cgi

Very simple.

--
Jens Kristian Søgaard, Mermaid Consulting I/S,
jens@mermaidconsulting.dk,
http://www.mermaidconsulting.com/

Starhost
04-22-2001, 11:42 AM
Thanx, Now I just want to know if somebody already make a script that secures shell so that not everybody is able to login in the /web dir of every domain that is hosted on a raq (3).

Starhost
04-26-2001, 07:13 PM
Hey all!

I just finished my script that automatically creates the include file for domains with all info in it that is supposed to be in it :-)

What kind of DNS stuuf do you want to get inserted automaticlyt?

I've got:

pop.domain.com
smtp.domain.com
ftp.domain.com

Any others?


I also editted a file so that when I add a new domain to my raq there is automaticly inserted A ServerAlias in the httpd.conf for the domainname:

Serveralias *.domain.com


And I made a script that puts permissions right so that a user with ssh/telnet access can't access /web/ dir's of other sites, now this is possible!

What Shall I make next to improve the Raq 3??

tymonhall
04-27-2001, 03:02 PM
Originally posted by jks
Yes, sure it is possible -- it's actually quite easy.

The trick is, that the PHP function must run with enough privileges to create files in the /etc/named/ directory. Do not - _DO NOT_ - make the /etc/named/ directory world readable.

You could f.ex. run your scripts off the admin server, which is already running as root.

After writing to the include file, you just need to run the dns update command (Cobalt):

/usr/admserv/cgi-bin/.cobalt/dns/index.cgi

Very simple.

--
Jens Kristian Søgaard, Mermaid Consulting I/S,
jens@mermaidconsulting.dk,
http://www.mermaidconsulting.com/

what is f.ex?

Starhost
04-27-2001, 03:11 PM
EWhat do you mean exactly?

tymonhall
04-27-2001, 03:34 PM
You said "You could f.ex. run your scripts off the admin server" what is f.ex

Starhost
04-27-2001, 03:48 PM
I think he just means that you have to let the scripts run with root privlidges.

jks
04-28-2001, 05:28 AM
Originally posted by tymonhall


what is f.ex?

Short for "for example" in Danish.... :-)

Simple as that...