Abu Mami
12-30-2001, 05:54 AM
Hi,
I would like to install a couple of PHP scripts on my server and make them available to all or some users. How is this done?
- Can the script be installed outside of the HTML root path of the server? Should it? Must it?
- How is access given to different users?
- Any special setup/path/install considerations that I must be aware of?
I imagine that there might be other issues involved, but I'm not even sure what they are.
Any help would be greatly appreciate.
Thanks.
It all depends on the script...
Most scripts are written for a single amdin/ site so youd have to build an installer to let multiple people install their own copy or you'd have to change the script to run off multiple users (sometimes it simple, mostly its not).
Assuming your script already worked for multiple users its not hard to setup. Just put it somewhere in your main web directory and then make httpd aliases to it. If the script was a cart, you could alias /cart/ to /var/www/html/main/cart/ or whatever and that would let users run it from www.them.com/cart/ Thats how I run several of my scripts... 1 installed copy but any user can link to it from their site. Of course if your clients already have a directory /cart/ (or whatever) they'll get real pissed.
ASPCode.net
12-30-2001, 11:33 AM
Forgive me if this is off-topic but I am so glad I got this to work:
I have just successfullly managed to tweak a single Burning Board installation ( this is a program that is NOT written to be multi-use ) for multiple users and since this way of doing it ( of course it means you will need to know your way around workiing with PHP or CGI scripts ) is rather general I will share it with you all:
Most scripts have a general include file which contains database info ( name, uid, pwd etc ), lets call it incdb.php. Now the basic idea is to tweak this file so it depending on the current url ( www.customer1.com/forum or www.customer2.com/forum etc ) uses different databases.
So lets say the incdb.php looks like this:
$mysqlhost = "localhost";
$mysqluser = "a123";
$mysqlpassword = "pwd123";
$mysqldb = "dbname";
I added some ( maybe not 100 percent correct ) regular expressions before that to get the current url
$sDBName = "";
if ( ereg("([A-zA-Z0-9_]{1,})\\.([A-zA-Z0-9_]{2,})$",$SERVER_NAME, $arr))
$sDBName = $arr[1] .$arr[2];
if ( ereg("[A-zA-Z0-9_]{1,}\\.([A-zA-Z0-9_]{1,})\\.([A-zA-Z0-9_]{2,})$",$SERVER_NAME, $arr))
$sDBName = $arr[1] .$arr[2];
$sDBName = "bboard" . $sDBName;
$mysqlhost = "localhost";
$mysqluser = "a123";
$mysqlpassword = "pwd123";
$mysqldb = $sDBName;
Now, this way we will get a database name of "bboardcustomer1com" for www.customer1.com/forum
and
"bboardcustomer2com" for www.customer2.com/forum
You can do the same thing for the username/password or use some kind of textfile/database to get a certains users uid/password for their database. I use the same username/password for all my board databases ( a customer is never supposed to be able to manage it directly with for example PhpMyAdmin )
Since I use my own developed CP I added a install program from it ( similar idea, creates the database based on the current users domain ).
Abu Mami
01-03-2002, 07:58 AM
Originally posted by ASPCode.net
Forgive me if this is off-topic Hey ASPCode.net,
Off topic?? Not! This seems to be pretty much what along the lines of what I'm interested in. I'm not sure that what you've done suits my needs 100%, but it certainly give me an idea of the direction to go.
BTW - Are there many scripts that are designed for multiple users? Portals? BBSs? and so on.
Thanks.