Вот мой кода можете посоветовать что сделать:
PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?PHP
- include ('config.php');
- echo "SESSION:";print_r($_SESSION);
- $name=$_SESSION['login'];
- $pass=$_SESSION['pass'];
- $site=$_SESSION['site'];
- $mail=$_SESSION['mail'];
- $file_name=$site;
- $text="<VirtualHost *:80>
- ServerName $site
- ServerAlias test.batareyka.org.ua *.test.batareyka.org.ua $site.batareyka.org.ua
- ServerAdmin $name
- DocumentRoot /oth/hosting/$site/data/
- <Directory /oth/hosting/$site/data/>
- Options none
- AllowOverride Limit
- Order Deny,Allow
- Allow from all
- </Directory>
- Alias /php-fcgi/ /oth/hosting/$site/data/cgi-bin/
- ErrorLog /oth/hosting/$site/log/error.log
- # Possible values include: debug, info, notice, warn, error, crit,
- # alert, emerg.
- LogLevel warn
- CustomLog /oth/hosting/$site/log/access.log combined
- </VirtualHost>";
- //Створення базы данних
- $db="CREATE DATABASE $name"; // Формирование запроса на создание базы данных
- $db_u="CREATE USER '$name'@'localhost' IDENTIFIED BY '$pass';";
- $db_r="GRANT ALL ON $name.* TO '$name'@'localhost';";
- echo "CREATE USER '$name'@'localhost' IDENTIFIED BY '$pass';";
- echo "GRANT ALL ON $name.* TO '$name'@'localhost';";
- // Створення файлу для вебсервера
- //считуетса файл построчно
- echo "$f[$i] <br>";
- }
- ServerName $site
- ServerAlias $name.batareyka.org.ua *.$site
- ServerAdmin $name
- DocumentRoot /oth/hosting/$site/data/
- <Directory /oth/hosting/$site/data/>
- Options none
- AllowOverride Limit
- Order Deny,Allow
- Allow from all
- </Directory>
- Alias /php-fcgi/ /oth/hosting/$site/data/cgi-bin/
- ErrorLog /oth/hosting/$site/log/error.log
- # Possible values include: debug, info, notice, warn, error, crit,
- # alert, emerg.
- LogLevel warn
- CustomLog /oth/hosting/$site/log/access.log combined
- </VirtualHost>' >> /oth/hosting/configs/$site.conf");
- echo "$fi[$i] <br>";
- }
- // Додаэмо параметри для фтп користувача
- mysql_query("INSERT INTO users VALUES ('$name', '$m_pass', '65534', '31', '/oth/hosting/$site/data/', '100', '100', '1024', '1024', '*', '0', '1', '*', '')") or die ("чтото не катит");
- echo $err;
- // Створення заису для користувача
- mysql_query("INSERT INTO records VALUES ('', '8', '$name.batareyka.org.ua', 'CNAME', 'batareyka.org.ua', '86400', '0', '')");
- mysql_query("INSERT INTO records VALUES ('', '', 'mail.$site', 'A', '77.87.42.61', '86400', '0', '')");
- mysql_query("INSERT INTO records VALUES ('', '', 'mail.$site', 'A', '77.87.42.61', '86400', '0', '')");
- mysql_query("INSERT INTO records VALUES ('', '', 'www.$site', 'A', '77.87.42.61', '86400', '0', '')");
- ?>