Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 20th July 2009, 03:10
Gleno0h Gleno0h is offline
Junior Member
 
Join Date: Apr 2009
Posts: 20
Thanks: 1
Thanked 1 Time in 1 Post
Default Creating extra folders for new websites.

Hey!

Well after installing ispconfig3 i was kinda bussy with making a script for new users to auto install joomla, phpbb3 etc.

Now my question is, how can i add a extra folder to the new sites that i create?

It now makes the folders:
cgi-bin
ssl
tmp
web
-error
-stats

but what i want is
cgi-bin
ssl
tmp
web
-error
-stats
-extra

How can i make it like that for every new website?

Thanks!
Reply With Quote
Sponsored Links
  #2  
Old 20th July 2009, 04:21
dzudzu dzudzu is offline
Member
 
Join Date: Jun 2009
Location: Serbia
Posts: 64
Thanks: 1
Thanked 6 Times in 6 Posts
Default

This is just from my own research so wait for confirmation but till then u can toy around with this:

in /usr/local/ispconfig/server/plugins-enabled

file: apache2_plugin.inc.php

there is this code

// make temp direcory writable for the apache user and the website user
exec("chmod 777 ".escapeshellcmd($data["new"]["document_root"]."/tmp"));

i belive u can add another line below with appropriate chmod like 755 so it gets created

as example u asked i guess it would be something like:
exec("chmod 755 ".escapeshellcmd($data["new"]["document_root"]."/extra"));

thou note that index file is in web folder so i guess u maybe want to make /web/extra

just few of my thoughts
__________________
EonTek.rs - System Engineering

dzudzu
Reply With Quote
The Following User Says Thank You to dzudzu For This Useful Post:
Gleno0h (20th July 2009)
  #3  
Old 20th July 2009, 05:24
Gleno0h Gleno0h is offline
Junior Member
 
Join Date: Apr 2009
Posts: 20
Thanks: 1
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by dzudzu View Post
This is just from my own research so wait for confirmation but till then u can toy around with this:

in /usr/local/ispconfig/server/plugins-enabled

file: apache2_plugin.inc.php

there is this code

// make temp direcory writable for the apache user and the website user
exec("chmod 777 ".escapeshellcmd($data["new"]["document_root"]."/tmp"));

i belive u can add another line below with appropriate chmod like 755 so it gets created

as example u asked i guess it would be something like:
exec("chmod 755 ".escapeshellcmd($data["new"]["document_root"]."/extra"));

thou note that index file is in web folder so i guess u maybe want to make /web/extra

just few of my thoughts
Well that didnt do it. Its too bad i could find a tut about it, but thanks to you i got in a direction and managed to do it.

Small tutorial:

nano /usr/local/ispconfig/server/plugins-enabled/apache2_plug*
find the text containing:
Code:
// Check if the directories are there and create them if nescessary.
if(!is_dir($data["new"]["document_root"]."/web")) exec("mkdir -p ".$data["new"]["document_root"]."/web");
if(!is_dir($data["new"]["document_root"]."/web/error") and $data["new"]["errordocs"]) exec("mkdir -p ".$data["new"]["document_root"]."/web/error");
//if(!is_dir($data["new"]["document_root"]."/log")) exec("mkdir -p ".$data["new"]["document_root"]."/log");
if(!is_dir($data["new"]["document_root"]."/ssl")) exec("mkdir -p ".$data["new"]["document_root"]."/ssl");
if(!is_dir($data["new"]["document_root"]."/cgi-bin")) exec("mkdir -p ".$data["new"]["document_root"]."/cgi-bin");
if(!is_dir($data["new"]["document_root"]."/tmp")) exec("mkdir -p ".$data["new"]["document_root"]."/tmp");
then add this at the end

Code:
if(!is_dir($data["new"]["document_root"]."/web/extra")) exec("mkdir -p ".$data["new"]["document_root"]."/web/extra");
so it becomes;

Code:
// Check if the directories are there and create them if nescessary.
if(!is_dir($data["new"]["document_root"]."/web")) exec("mkdir -p ".$data["new"]["document_root"]."/web");
if(!is_dir($data["new"]["document_root"]."/web/error") and $data["new"]["errordocs"]) exec("mkdir -p ".$data["new"]["document_root"]."/web/error");
//if(!is_dir($data["new"]["document_root"]."/log")) exec("mkdir -p ".$data["new"]["document_root"]."/log");
if(!is_dir($data["new"]["document_root"]."/ssl")) exec("mkdir -p ".$data["new"]["document_root"]."/ssl");
if(!is_dir($data["new"]["document_root"]."/cgi-bin")) exec("mkdir -p ".$data["new"]["document_root"]."/cgi-bin");
if(!is_dir($data["new"]["document_root"]."/tmp")) exec("mkdir -p ".$data["new"]["document_root"]."/tmp");
if(!is_dir($data["new"]["document_root"]."/web/extra")) exec("mkdir -p ".$data["new"]["document_root"]."/web/extra");
That makes an extra dir, and for the joomla installer i did this;

Look for

Code:
// copy the standard index page
if (file_exists("/usr/local/ispconfig/server/conf-custom/index/standard_index.html_".substr(escapeshellcmd($conf["language"]),0,2))){
exec("cp /usr/local/ispconfig/server/conf-custom/index/standard_index.html_".substr(escapeshellcmd($conf["language"]),0,2)." ".escapeshellcmd($data["new"][$
}
else {
if (file_exists("/usr/local/ispconfig/server/conf-custom/index/standard_index.html")){
exec("cp /usr/local/ispconfig/server/conf-custom/index/standard_index.html ".escapeshellcmd($data["new"]["document_root"])."/web/index.html");     $
}
else {
exec("cp /usr/local/ispconfig/server/conf/index/standard_index.html_".substr(escapeshellcmd($conf["language"]),0,2)." ".escapeshellcmd($data["new"]$
exec("cp /usr/local/ispconfig/server/conf/index/favicon.ico ".escapeshellcmd($data["new"]["document_root"])."/web/");
exec("cp /usr/local/ispconfig/server/conf/index/robots.txt ".escapeshellcmd($data["new"]["document_root"])."/web/");
exec("cp /usr/local/ispconfig/server/conf/index/.htaccess ".escapeshellcmd($data["new"]["document_root"])."/web/");
}
}
exec("chmod -R a+r ".escapeshellcmd($data["new"]["document_root"])."/web/");
then add this

Code:
exec("cp /usr/local/ispconfig/server/conf/installers/installapps.php ".escapeshellcmd($data["new"]["document_root"])."/web/extra/");
so it becomes;

Code:
// copy the standard index page
if (file_exists("/usr/local/ispconfig/server/conf-custom/index/standard_index.html_".substr(escapeshellcmd($conf["language"]),0,2))){
exec("cp /usr/local/ispconfig/server/conf-custom/index/standard_index.html_".substr(escapeshellcmd($conf["language"]),0,2)." ".escapeshellcmd($data["new"][$
}
else {
if (file_exists("/usr/local/ispconfig/server/conf-custom/index/standard_index.html")){
exec("cp /usr/local/ispconfig/server/conf-custom/index/standard_index.html ".escapeshellcmd($data["new"]["document_root"])."/web/index.html");     $
}
else {
exec("cp /usr/local/ispconfig/server/conf/index/standard_index.html_".substr(escapeshellcmd($conf["language"]),0,2)." ".escapeshellcmd($data["new"]$
exec("cp /usr/local/ispconfig/server/conf/index/favicon.ico ".escapeshellcmd($data["new"]["document_root"])."/web/");
exec("cp /usr/local/ispconfig/server/conf/index/robots.txt ".escapeshellcmd($data["new"]["document_root"])."/web/");
exec("cp /usr/local/ispconfig/server/conf/index/.htaccess ".escapeshellcmd($data["new"]["document_root"])."/web/");
exec("cp /usr/local/ispconfig/server/conf/installers/installapps.php ".escapeshellcmd($data["new"]["document_root"])."/web/extra/");
}
}
exec("chmod -R a+r ".escapeshellcmd($data["new"]["document_root"])."/web/");
Dont forget, /usr/local/ispconfig/server/conf/INSTALLER/ is a custom dir, you have to make that, but it also could by phpmyadmin for that matther.

Thnx!

Last edited by Gleno0h; 20th July 2009 at 05:28.
Reply With Quote
  #4  
Old 20th July 2009, 13:14
dzudzu dzudzu is offline
Member
 
Join Date: Jun 2009
Location: Serbia
Posts: 64
Thanks: 1
Thanked 6 Times in 6 Posts
Default

ah yes, my command just chmods the dir, didn't pay attention silly me, but great you worked it out
__________________
EonTek.rs - System Engineering

dzudzu
Reply With Quote
  #5  
Old 20th July 2009, 15:53
Gleno0h Gleno0h is offline
Junior Member
 
Join Date: Apr 2009
Posts: 20
Thanks: 1
Thanked 1 Time in 1 Post
 
Default

Quote:
Originally Posted by dzudzu View Post
ah yes, my command just chmods the dir, didn't pay attention silly me, but great you worked it out
Well thats also one thing i needed. "Extra" has to be 777 otherwise it cant make a temp folder when it unzip's .zip packages.
Then its moved to a folder that the user wants to use and the script chmod's the default folders that needs to have a certain chmod for instalation. Works like a charm!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
creating folders accessible from the web Boon-Dog-Danny Installation/Configuration 2 23rd July 2009 00:25
sending e-mail using mail() function linuxuser1 HOWTO-Related Questions 38 21st April 2009 12:20
simple question re creating two folders pattyjay General 2 17th July 2008 09:31
ISPConfig 2.2.14 released till General 48 19th July 2007 23:46
Problem with the apache (I can't start ist) M.Behrens Installation/Configuration 11 31st March 2006 10:48


All times are GMT +2. The time now is 04:29.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.