View previous topic :: View next topic |
Author |
Message |
josepi -
Joined: 20 Jul 2006 Posts: 30
|
Posted: Wed Aug 23, 2006 12:49 am Post subject: How to add host remotely |
|
|
Anyone know's about Add a Host remotely using PHP ? |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Wed Aug 23, 2006 11:39 am Post subject: |
|
|
Cannot currently be done. You will have to use the console remotely to do it. Hopefully in the future Aprelium will be adding a way to use PHP to do such things. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Wed Aug 23, 2006 3:46 pm Post subject: Re: How to add host remotely |
|
|
josepi wrote: | Anyone know's about Add a Host remotely using PHP ? |
You can do it by updating the abyss.conf from your PHP script and restarting the server. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Wed Aug 23, 2006 3:52 pm Post subject: Re: How to add host remotely |
|
|
aprelium wrote: | josepi wrote: | Anyone know's about Add a Host remotely using PHP ? |
You can do it by updating the abyss.conf from your PHP script and restarting the server. |
That said, it is very difficult to do. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
josepi -
Joined: 20 Jul 2006 Posts: 30
|
Posted: Wed Aug 30, 2006 9:19 pm Post subject: |
|
|
amm but if i add something in abyss.conf when i reload , and i open admin panel , dont show me the new host i add |
|
Back to top |
|
 |
josepi -
Joined: 20 Jul 2006 Posts: 30
|
Posted: Thu Aug 31, 2006 6:41 am Post subject: |
|
|
well i do my self and it's working
this is the code to add
Code: |
$fileloc = 'C:\Archivos de programa\Abyss Web Server';
$filelocfile = ($fileloc."\abyss.conf");
$site = "SITE TO ADD";
$ahtml = "AHTML DIRECTORY";
$lines = file($filelocfile);
rename($filelocfile, $fileloc . date("Y-m-d;H-i-s")." abyss.conf" );
// open Config for writing
$file = fopen($filelocfile,"a");
for($i=0; $i < sizeof($lines); $i++)
{
fwrite ($file, $lines[$i]);
// write new information on top of list after "<Users>"
if (strstr($lines[$i],"here"))
{
fwrite($file, ' <host>
<port>
80
</port>
<names>
<name>
'.$site.'
</name>
<name>
www.'.$site.'
</name>
</names>
<path>
D:\root\~'.$site.'
</path>
<bindip>
*
</bindip>
<indexes>
<index>
index.html
</index>
<index>
index.htm
</index>
<index>
default.aspx
</index>
<index>
index.asp
</index>
<index>
index.php
</index>
</indexes>
<dirlist>
<type>
1
</type>
<order>
ad
</order>
<scope>
<allow>
<path>
/
</path>
</allow>
</scope>
<hidden>
<file>
.*
</file>
</hidden>
<mimetype>
text/html; charset=UTF-8
</mimetype>
</dirlist>
<scripting>
<enabled>
yes
</enabled>
<cgi>
<timeout>
30
</timeout>
<usescript>
yes
</usescript>
<useshebang>
yes
</useshebang>
</cgi>
<isapi>
<ext>
dll
</ext>
<debuglevel>
0
</debuglevel>
</isapi>
<fastcgi>
<debuglevel>
1
</debuglevel>
<timeout>
240
</timeout>
</fastcgi>
<interpreters>
<interpreter>
<ext>
php
</ext>
<interface>
1
</interface>
<file>
D:/ext/'.$site.'/php-cgi.exe
</file>
<checkexists>
yes
</checkexists>
<type>
1
</type>
<updatepaths>
yes
</updatepaths>
</interpreter>
<interpreter>
<ext>
asp
</ext>
<interface>
1
</interface>
<file>
'.$ahtml.'
</file>
<checkexists>
yes
</checkexists>
<type>
0
</type>
<updatepaths>
yes
</updatepaths>
</interpreter>
</interpreters>
<environment>
<var>
<name>
REDIRECT_STATUS
</name>
<value>
200
</value>
</var>
</environment>
</scripting>
<ssi>
<enabled>
yes
</enabled>
<abbreviatesize>
yes
</abbreviatesize>
<extensions>
<ext>
shtml
</ext>
<ext>
shtm
</ext>
<ext>
stm
</ext>
</extensions>
</ssi>
<log>
<extendedformat>
yes
</extendedformat>
<file>
D:/ext/'.$site.'/access.log
</file>
</log>
<customerrors>
<errors>
<error>
<status>
400
</status>
<url>
/Error/error400.html
</url>
</error>
<error>
<status>
401
</status>
<url>
/Error/error401.html
</url>
</error>
<error>
<status>
402
</status>
<url>
/Error/error402.html
</url>
</error>
<error>
<status>
403
</status>
<url>
/Error/error403.html
</url>
</error>
<error>
<status>
404
</status>
<url>
/Error/error404.html
</url>
</error>
<error>
<status>
405
</status>
<url>
/Error/error405.html
</url>
</error>
</errors>
</customerrors>
<running>
yes
</running>
<users>
<user>
<name>
none
</name>
<password>
8dba8e5de4493b41121bd4c2ce9a7356
</password>
</user>
</users>
<throttle>
<enabled>
no
</enabled>
</throttle>
<antileech>
<strict>
no
</strict>
</antileech>
<id>
8
</id>
</host>
');
}
}
fclose($file); |
you just have to modify the code from you abyss.conf
this is the way to add a host
just have to reload abyss
i make a software my self i anyone want pm me |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Thu Aug 31, 2006 11:10 am Post subject: |
|
|
No need to double post.
Its good but obviously there is the problem of restarting abyss and making sure it does it and doesnt just crash. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Thu Aug 31, 2006 3:17 pm Post subject: |
|
|
Why'd he double post? 8O |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Thu Aug 31, 2006 3:58 pm Post subject: |
|
|
josepi wrote: | just have to reload abyss |
The idea is to have a .bat file which will stop the server and start it. This .bat file will be run from the script by using this sequence of commands:
Code: | <?php
echo 'The server is restarting';
flush();
ob_flush();
exec('start /B cmd.exe /C C:\\Full\\Path\\to\\restart.bat');
?> |
C:\\Full\\Path\\to has to be replaced with the full path to restart.bat. Note that backslashes must be doubled because they have a special meaning in PHP strings.
Below you'll find two versions of the .bat file:
* If Abyss Web Server is running as a Windows Service:
restart.bat:
Code: | @echo off
net stop AbyssWebServer
net start AbyssWebServer |
* If Abyss Web Server is running in a normal user session:
Code: | @echo off
C:\Path\to\abyssws.exe --stop
C:\Path\to\abyssws.exe |
In the above script, replace C:\Path\to\ with the actual path where Abyss Web Server is installed. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
josepi -
Joined: 20 Jul 2006 Posts: 30
|
Posted: Thu Aug 31, 2006 5:01 pm Post subject: |
|
|
Code: |
<?
/*
1.
Firts make a backup of abyss.conf
and then go to you abyss.conf
and copy from any host you have
From <host>
To </host>
and paste in $host = 'HERE YOU <host>';
VARIABLES
Remplace for Example in
--------------------------
<port>
80
</port>
<names>
<name>
something.com
</name>
<name>
www.something.com
</name>
--------------------------
This is and example of the firts part of you <host>
Remplace something.com with '.$site.'
like this
--------------------------
<port>
80
</port>
<names>
<name>
'.$site.'
</name>
<name>
www.'.$site.'
</name>
</names>
--------------------------
Remplace Ahtml Path with '.$ahtml.'
Remplace Perl Path with '.$perl.'
Remplace PHP Path with '.$php.'
2.
Add "here" to you abyss.conf where you want to add the new host's without ""
3.
create a file called abyss.bat in C:/
with this
If Abyss Run on a Normal Session
in the bat write this
@echo off
C:\Path\to\abyssws.exe --stop
C:\Path\to\abyssws.exe
Reemplace c:\path\to with abyss actual path
but if is a windows service
write in the bat this
@echo off
net stop AbyssWebServer
net start AbyssWebServer
4.
you have to edit
$sitepath
and
$sitelog
down you have an example of a simple use
*/
$batpath = "C:\\";
$host = ' <host>
<port>
80
</port>
<names>
<name>
'.$site.'
</name>
<name>
www.'.$site.'
</name>
</names>
<path>
'.$sitepath.'
</path>
<log>
<file>
'.$sitelog.'
</file>
<extendedformat>
yes
</extendedformat>
</log>
<bindip>
*
</bindip>
<indexes>
<index>
index.html
</index>
<index>
index.htm
</index>
<index>
default.aspx
</index>
</indexes>
<dirlist>
<type>
1
</type>
<order>
ad
</order>
<scope>
<allow>
<path>
/
</path>
</allow>
</scope>
<hidden>
<file>
.*
</file>
</hidden>
<mimetype>
text/html; charset=UTF-8
</mimetype>
</dirlist>
<scripting>
<enabled>
yes
</enabled>
<cgi>
<timeout>
30
</timeout>
<usescript>
yes
</usescript>
<useshebang>
yes
</useshebang>
</cgi>
<isapi>
<ext>
dll
</ext>
<debuglevel>
0
</debuglevel>
</isapi>
<fastcgi>
<debuglevel>
1
</debuglevel>
<timeout>
240
</timeout>
</fastcgi>
</scripting>
<ssi>
<enabled>
yes
</enabled>
<abbreviatesize>
yes
</abbreviatesize>
<extensions>
<ext>
shtml
</ext>
<ext>
shtm
</ext>
<ext>
stm
</ext>
</extensions>
</ssi>
<running>
yes
</running>
<id>
13
</id>
</host>';
$fileloc = 'C:\Archivos de programa\Abyss Web Server';
$filelocfile = ($fileloc."\abyss.conf");
$site = "SITE TO ADD";
$sitepath = "path of Site";
$sitelog "access.log path";
$ahtml = 'AHTML FILE';
$perl = 'PERL FILE';
$php = 'PHP FILE';
$lines = file($filelocfile);
rename($filelocfile, $fileloc . date("Y-m-d;H-i-s")." abyss.conf" );
// open Config for writing
$file = fopen($filelocfile,"a");
for($i=0; $i < sizeof($lines); $i++)
{
fwrite ($file, $lines[$i]);
if (strstr($lines[$i],"here"))
{
fwrite($file, $host);
}
}
fclose($file);
echo 'The server is restarting';
flush();
ob_flush();
exec('start /B cmd.exe /C '.$batpath.'\\abyss.bat');
?> |
Here is The Full Code of Adding a Host By Code |
|
Back to top |
|
 |
Angel -
Joined: 17 Nov 2003 Posts: 157 Location: Everett, Washington
|
|
Back to top |
 |
 |
|