Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 1st November 2010, 06:44
chuvantai chuvantai is offline
Junior Member
 
Join Date: Oct 2010
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default ERROR 403 after create site using sites_web_domain_add

Hello
i've read this topic to automate create users and website using remoting framework.
here is my code
PHP Code:
// Add client
                
$params_client = array(        'server_id' => 1,
                                        
'company_name' => $company,
                                        
'contact_name' => $fullname,
                                        
'customer_no' => '111',
                                        
'username' =>$username,
                                        
'password' =>$password,
                                        
'language' =>'en',
                                        
'usertheme' =>'default',
                                        
'street' =>$street,
                                        
'zip' =>'',
                                        
'city' =>'',
                                        
'state' =>'non-US',
                                        
'country' =>'VN',
                                        
'telephone' =>$telephone,
                                        
'mobile' =>'',
                                        
'fax' =>'',
                                        
'email' =>$email,
                                        
'internet' =>'',
                                        
'icq' =>'',
                                        
'vat_id' =>'',
                                        
'notes' =>'',  
                                        
'template_master' => '0',
                                        
'template_additional' =>'',
                                        
'default_mailserver' =>'1',
                                        
'limit_maildomain' =>'1',
                                        
'limit_mailbox' =>'10',
                                        
'limit_mailalias' =>'10',
                                        
'limit_mailaliasdomain' =>'10',
                                        
'limit_mailforward' =>'10',
                                        
'limit_mailcatchall' =>'10',
                                        
'limit_mailrouting' => '10',
                                        
'limit_mailfilter' =>'10',
                                        
'limit_fetchmail' =>'10',
                                        
'limit_mailquota' =>'10',
                                        
'limit_spamfilter_wblist' =>'-1',
                                        
'limit_spamfilter_user' =>'-1',
                                        
'limit_spamfilter_policy' =>'-1',
                                        
'default_webserver' =>'1',
                                        
'limit_web_quota' =>'100',
                                        
'limit_web_domain' =>'10',
                                        
'web_php_options' =>"suphp",
                                        
'limit_web_aliasdomain' =>'-1',
                                        
'limit_web_subdomain' =>'-1',
                                        
'limit_ftp_user' =>'-1',
                                        
'limit_shell_user' =>'-1',
                                        
'ssh_chroot' =>'no',
                                        
'limit_webdav_user' =>'1',
                                        
'default_dnsserver' =>'1',
                                        
'limit_dns_zone' =>'-1',
                                        
'limit_dns_slave_zone' =>'-1',
                                        
'limit_dns_record' =>'-1',
                                        
//'limit_client' =>'0',
                                        
'default_dbserver' =>'1',
                                        
'limit_database' =>'-1',
                                        
'limit_cron' =>'0',
                                        
'limit_cron_type' =>'',
                                        
'limit_traffic_quota' =>'-1',
                                        
'limit_cron_frequency' =>'-1');
                
                
$client_id $client->client_add($session_id$reseller_id$params_client);
                
                
                
// Add website
                //$client_id=$domain_id;
                
mysql_select_db($dbispconfig) or die("Cannot select database");
                
                
$tablename         "web_domain";
                
$next_increment     0;
                
$qShowStatus         "SHOW TABLE STATUS LIKE '$tablename'";
                
$qShowStatusResult     mysql_query($qShowStatus) or die ( "Query failed: " mysql_error() . "<br/>" $qShowStatus );
                
$row mysql_fetch_assoc($qShowStatusResult);
                
$next_increment $row['Auto_increment'];

                
$domain_id $next_increment;
                
                
//Now we need to generate doc root and apache basedir etc. as well... Nothing works without them
                //Document root
                
$document_root "/var/www/clients/client".$client_id."/web".$domain_id;
                
//system user
                
$system_user "web".$domain_id;
                
//system group
                
$system_group 'client'.$client_id;
                
//This stuff comes from config usually in ISPCP - We don't want to do a hard include to their config so rather we generate it here
                
$php_open_basedir="/var/www/clients/client".$client_id."/web".$domain_id."/web:/var/www/clients/client".$client_id."/web".$domain_id."/tmp:/var/www/".$domain."/web:/srv/www/".$domain."/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin";
                
//Do the update  
                            //     /var/www/clients/client0/web13/web:/var/www/clients/client0/web13/tmp:/var/www/xxx.xx/web:/srv/www/xxx.xx/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin
                    
                
$params_website = array('server_id' => 1,
                                        
'ip_address' => '*',
                                        
'domain' => $domain,
                                        
'type' => 'vhost',
                                        
'parent_domain_id' => '',
                                        
'vhost_type' => 'name',
                                        
'hd_quota' => '50',
                                        
'traffic_quota' => '1000',
                                        
'cgi' =>'n',
                                        
'ssi' =>'n',
                                        
'suexec' =>'n',
                                        
'errordocs' =>'1',
                                        
'subdomain' =>'www',
                                        
'ssl' =>'n',
                                        
                                        
'php' =>"mod",
                                        
'ruby' =>'n',
                                        
'active' =>'y',
                                        
                                        
'redirect_type' =>'no',
                                        
'redirect_path' =>'',
                                        
                                        
'ssl_state' =>'',
                                        
'ssl_organisation' =>'',
                                        
'ssl_organisation_unit' =>'',
                                        
'ssl_country' =>'',
                                        
'ssl_domain' =>$domain,
                                        
'ssl_request' =>'',
                                        
'ssl_cert' =>'',
                                        
'ssl_bundle' =>'',
                                        
'ssl_action' =>'',
                                        
                                        
                                        
//'stats_password' =>$password,
                                        
'stats_password' =>'',
                                        
'stats_type' =>'webalizer',
                                        
                                        
'backup_interval' =>'monthly',
                                        
'backup_copies' =>'1',
                                        
                                        
'document_root' =>$document_root,
                                        
'system_user' =>$system_user,
                                        
'system_group' =>$system_group,
                                        
'allow_override' =>'All',
                                        
'php_open_basedir' =>$php_open_basedir,
                                        
'custom_php_ini' =>''
                                        
'apache_directives' =>'',
                                        
'client_group_id' =>$client_id+1
                                        
);
                
                
$website_id $client->sites_web_domain_add($session_id$client_id$params_website); 
everything seems fine.

but when I browse to my client site, server responds 403 error page
Error log:
Code:
root@hostth5c:/var/www/hovanten3.com/log# less error.log 
[Mon Nov 01 12:20:16 2010] [error] [client 192.168.40.1] client denied by server configuration: /
[Mon Nov 01 12:35:18 2010] [error] [client 192.168.40.1] client denied by server configuration: /
Virtual Host Configuration
Quote:
root@hostth5c:/# less /etc/apache2/sites-enabled/hovanten3.com.vhost
<Directory /var/www/hovanten3.com>
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>

<VirtualHost *:80>
DocumentRoot /var/www/hovanten3.com/web

ServerName hovanten3.com
ServerAlias www.hovanten3.com
ServerAdmin webmaster@hovanten3.com

ErrorLog /var/log/ispconfig/httpd/hovanten3.com/error.log


ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 503 /error/503.html

<Directory /var/www/hovanten3.com/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client39/web38/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>


# Clear PHP settings of this website
<FilesMatch "\.ph(p3?|tml)$">
SetHandler None
</FilesMatch>
# mod_php enabled
AddType application/x-httpd-php .php .php3 .php4 .php5
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@hovanten3.com"
php_admin_value upload_tmp_dir /var/www/clients/client39/web38/tmp
php_admin_value session.save_path /var/www/clients/client39/web38/tmp
# PHPIniDir /var/www/conf/web38
php_admin_value open_basedir /var/www/clients/client39/web38/web:/var/www/clients/client39/web38/tmp:/var/www/hovanten3.com/web:/srv/www/hovanten3.com/web:/usr/share/php5:/tm
p:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin

RewriteEngine on
RewriteCond %{HTTP_HOST} ^hovanten3.com [NC]
RewriteRule ^/(.*)$ /$1
RewriteCond %{HTTP_HOST} ^www.hovanten3.com [NC]
RewriteRule ^/(.*)$ /$1

# add support for apache mpm_itk
<IfModule mpm_itk_module>
AssignUserId web38 client39
</IfModule>

<IfModule mod_dav_fs.c>
# DO NOT REMOVE THE COMMENTS!
# IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
# WEBDAV BEGIN
# WEBDAV END
</IfModule>


</VirtualHost>
Thanks and sorry for my bad english
Reply With Quote
Sponsored Links
  #2  
Old 12th November 2010, 11:45
chuvantai chuvantai is offline
Junior Member
 
Join Date: Oct 2010
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
 
Default

Somebody help me please (
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
create site template global-e Installation/Configuration 4 6th October 2010 14:07
Cannot create site leveler General 1 17th December 2008 11:33
Create new site, but without configuring email for that domain pulsorock General 1 24th September 2008 08:37
ISPConfig stop working after i add a new site xTiNcTion Installation/Configuration 4 5th January 2007 23:55
Can not create (new) site El Jefe Installation/Configuration 2 22nd October 2005 14:21


All times are GMT +2. The time now is 12:46.


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