A way to manage several websites using Abyss X1

 
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
Blini
-


Joined: 18 Mar 2005
Posts: 3
Location: France

PostPosted: Fri Mar 18, 2005 10:54 am    Post subject: A way to manage several websites using Abyss X1 Reply with quote

Hello,

I have been using Abyss web server for several years to test my websites on my computer (Windows). As I use the free version of Abyss web server, I can not run more than one website at a time. That's fine, I don't need more.

The problem was to be able to switch between multiple configuration files, so I can run one website or another one.

The other problem is that when I backup my websites files, I like to backup a single directory (and all its subdirectory, of course) and have all my configuration included in the backup. I do not want to go by hand into the C:\Program Files\... directories to pick each configuration or ini file I need to backup.

As I think this may help other Windows users, here is the way I did.

With the new Abyss X1 release comes an undocumented command-line parameter that helps a lot: '-cr config_path'. It tells Abyss to use config_path\abyss.conf as the configuration file. Moreover, this configuration file can be located on another drive than C: (the '-c' parameter does not work this way).

So, I created this hierarchy:
Code:
e:\webs
    |-- firstsite.tld
    |    |-- logs
    |    |-- settings
    |    |    |- abyss.conf
    |    |    |- persist.data
    |    |    |- php.ini
    |    |    '- my.ini
    |    |-- mysqldatabase
    |    '-- www
    |          '-- the website files
    |-- othersite.tld
    |    |-- logs
    |    |-- settings
    |    |    |- abyss.conf
    |    |    |- persist.data
    |    |    |- php.ini
    |    |    '- my.ini
    |    |-- mysqldatabase
    |    '-- www
    |         '-- the website files
   etc...


I wrote a little script "startweb.cmd", which contains this line:
Code:
start /d "%ProgramFiles%\Abyss Web Server" abyssws.exe -cr e:\webs\%1\settings

This way, I can easily start Abyss for firstsite.tld by calling:
Code:
startweb firstsite.tld

Or for othersite.tld by calling:
Code:
startweb othersite.tld


Note that the settings directories also contains php.ini and my.ini, which are the configuration files for PHP and MySql. This can be usefull is PHP or MySql settings are not the same for websites.

To let the PHP interpreter knows about the settings to use, the abyss configuration file in firstsite.tld\settings contains:
Code:
<environment>
   <var>
      <name>
         PHPRC
      </name>
      <value>
         e:\webs\firstsite.tld\settings
      </value>
   </var>
</environment>

Same thing for othersite.tld abyss.conf:
Code:
<environment>
   <var>
      <name>
         PHPRC
      </name>
      <value>
         e:\webs\othersite.tld\settings
      </value>
   </var>
</environment>


The PHP interpreter uses this PHPRC global variable to locate the php.ini. Done with PHP settings.

What about mysql ? The bad thing: MySql service always looks for its my.ini file in its own directory or in the Windows one... So I had to modify the startweb.cmd to copy the settings\my.ini file before mysql starts, and here is the definitive script:
Code:
net stop mysql >NUL 2>NUL
copy /y e:\webs\%1\settings\my.ini %WINDIR%\my.ini
net start mysql
start /d "%ProgramFiles%\Abyss Web Server" abyssws.exe -cr e:\webs\%1\settings


Sure this method is not perfect, but it could be a good start for users like me that need to manage more than one website.

Blini
Back to top View user's profile Send private message Visit poster's website
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Fri Mar 18, 2005 4:01 pm    Post subject: Re: A way to manage several websites using Abyss X1 Reply with quote

Blini wrote:

To let the PHP interpreter knows about the settings to use, the abyss configuration file in firstsite.tld\settings contains:
Code:
<environment>
   <var>
      <name>
         PHPRC
      </name>
      <value>
         e:\webs\firstsite.tld\settings
      </value>
   </var>
</environment>



You can have the same result by setting the Arguments field of the PHP interpreter in Abyss Web Server to -c e:\webs\firstsite.tld\settings
Back to top View user's profile Send private message
WolfRamiO
-


Joined: 30 May 2004
Posts: 121
Location: Viña del Mar, Chile

PostPosted: Fri Mar 18, 2005 6:25 pm    Post subject: Reply with quote

what exactly do this?
Back to top View user's profile Send private message Visit poster's website
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Fri Mar 18, 2005 10:16 pm    Post subject: Reply with quote

WolfRamiO wrote:
what exactly do this?

This method is useful for people who develop web sites and who are working on a web site at a time. They can switch from a project to another. This is not meant to support many sites running at the same time.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group