PDA

View Full Version : Change default web-template


hagel
7th August 2005, 20:51
Exactly which directory is used when creating new websites? I'd like to alter the default index.html which appears in newly created websites.

Cheers

till
7th August 2005, 22:28
Exactly which directory is used when creating new websites? I'd like to alter the default index.html which appears in newly created websites.

Cheers

The standard index pages are in the directory:

/root/ispconfig/isp/

falko
8th August 2005, 00:07
The standard index pages are in the directory:

/root/ispconfig/isp/

That's where all the template files are, you can modify them. But you can also use the ISPConfig web interface to create individual index pages: Management -> Server -> Settings -> Other.
Also each reseller can define individual index pages: ISP Manager -> [a reseller] -> Other.

ajajaj
16th August 2005, 18:04
We want to offer some PHP scripts pre-installed for selected customers, how do we have them get added when a new client is installed?

for example, I want to install a directory called admin somewhere /root/ispconfig/isp/admin ??? and have it's contents copied to the web/admin folder of a new site.

kinda like /etc/skel gets copied for new users in a standard debian system...

hrm - could we use /etc/skel? will that work for the web#_username users?

falko
16th August 2005, 18:35
We want to offer some PHP scripts pre-installed for selected customers, how do we have them get added when a new client is installed?

for example, I want to install a directory called admin somewhere /root/ispconfig/isp/admin ??? and have it's contents copied to the web/admin folder of a new site.

kinda like /etc/skel gets copied for new users in a standard debian system...

hrm - could we use /etc/skel? will that work for the web#_username users?

You can customize /root/ispconfig/scripts/lib/config.lib.php (function web_insert()) to achieve this.

t.roijers
31st July 2006, 18:52
Hi,

I would like to copy a default index.php and image folder to the new created website.

I would like to edit config.lib.php something like:

exec("cp -R /var/www/template/* /var/www/$wichvar");

Now, as you can guess i would like to know the exact var for $wichvar :)
Also any suggestions where (line) to put it?

Regards,
Tim

till
1st August 2006, 08:55
Insert this at line 72:

exec("cp -R /var/www/template/* /var/www/$web_path");

t.roijers
2nd August 2006, 12:49
Hello Falko,

Inserted this in the script, created a new website, but the copy command below doesn't copy the files from /var/www/template to the new website.

any suggestions?

Thanx,
Tim


Quote:
Insert this at line 72:
exec("cp -R /var/www/template/* /var/www/$web_path");

falko
2nd August 2006, 13:58
Hello Falko,

Inserted this in the script, created a new website, but the copy command below doesn't copy the files from /var/www/template to the new website.

any suggestions?

Thanx,
Tim


Quote:
Insert this at line 72:
exec("cp -R /var/www/template/* /var/www/$web_path");
Maybe it's a better idea to insert that line in the make_docroot() function. For debugging purposes, you can kill the ispconfig_wconf daemon, create a web site, and then you run
/root/ispconfig/php/php /root/ispconfig/scripts/writeconf.php
on the shell. Any errors?

t.roijers
2nd August 2006, 15:07
Hello Falko,

Killed the deamon, started the script and this is all i see:

ispconfig:~/root/ispconfig/php/php /root/ispconfig/scripts/writeconf.php
start
ende
ispconfig:~/ispconfig/scripts/lib #


No errors what so ever. But also no default template copied from /var/www/template to /var/www/$web_path

This is where the copy command is now~:
959 function make_docroot($doc_id,$hostname,$domainname,$web_qu ota,$update) {
960 global $go_info, $mod;
961 exec("cp -R /var/www/template/* /var/www/$web_path");
962






Maybe it's a better idea to insert that line in the make_docroot() function. For debugging purposes, you can kill the ispconfig_wconf daemon, create a web site, and then you run
/root/ispconfig/php/php /root/ispconfig/scripts/writeconf.php
on the shell. Any errors?

t.roijers
2nd August 2006, 16:14
After ispconfig:~/root/ispconfig/php/php /root/ispconfig/scripts/writeconf.php

start
INSERT: 20
ende

No errors, no default index.php

Tim

till
3rd August 2006, 10:43
The script is working fine when you dont get any PHP errors.

I guess you will have to debug your code by e.g. adding some echo statements to see whats going on.

t.roijers
7th August 2006, 12:33
Indeed, the script is working fine.
Problem was the $web_path var:

exec("cp -R /var/www/template/* /var/www/$web_path");

Should be:

exec("cp -R /var/www/template/* $web_path/web");

Greetinx,
Tim Roijers

Toucan
28th March 2010, 03:59
You can customize /root/ispconfig/scripts/lib/config.lib.php (function web_insert()) to achieve this.

Where do i find this file on ispconfig3?

falko
29th March 2010, 16:24
ISPConfig 3 was rewritten from scratch, so that file doesn't exist there.

Toucan
29th March 2010, 17:10
That would explain why I can't find it. I've posted a similar thread to 3' forum so hopefully I'll find an answer there.


Thanks