Click to See Complete Forum and Search --> : Windows XP/Apache 2.0 CGI questions...


Cheeseman
04-15-2004, 03:02 PM
Hello

I would simply appreciate knowing if there is an easy way for multiple users to each have their own cgi-bin directory like the following example...

/htdocs/users/Jack/cgi-bin/...some script
/htdocs/users/Jane/cgi-bin/...some script

Each cgi-bin directory must also allow images and other non-cgi files. Can some kind person here please give a tired old man some simple, step-by-step instructions on exactly how I go about do this?. I have fiddled around until I am blue in the face but no luck so far )-: .

Also, I was just wondering if there is anything I need to be concerned about with running user accounts under Windows XP/Apache 2.0.

Finally, I've tried aliasing and using cgiEXEC/execCGI (or whatever it's called) and even did some reading about suEXEC but I either was'nt able to understand it or could'nt get the examples to work. I'd really like to open user accounts via the example shown above and keep it simple rather than turning this into a crash-course in rocket science.

Is this possible (or can I *make* it possible with a little adaptation) and what are some of the things I need to be concerned about?. I want to keep users separated from each other and most importantly, from the server itself. Each user will have their own FTP account that only allows access to their folder but I'm sure there is something else I need to do here.

Thank you very much!

dreweries
04-15-2004, 10:01 PM
I don't think it is possable to do this exactly.
But if all you want is to alow each user to be able to use there own scripts,insted of using cgi have them use php.
You can configure apache to use php scripts in all dirrectorys.
And php scripts are in my oppinion better then scripts written in perl or c.

Cheeseman
04-15-2004, 11:32 PM
Originally posted by dreweries
I don't think it is possable to do this exactly.
But if all you want is to alow each user to be able to use there own scripts,insted of using cgi have them use php.
You can configure apache to use php scripts in all dirrectorys.
And php scripts are in my oppinion better then scripts written in perl or c.

Hi and thank's for the reply:)

Well, I have been able to run any server I want (http, ftp, dns, mail, etc) with very little problem but php/mysql has turned out to be quite a challenge. I downloaded everything I needed but creating a database is proving to be difficult and I can't seem to find a GUI front-end to make things easier. I'm exhausted from this!

Anyway, any help or tips I can get will be greatly appreciated

dreweries
04-16-2004, 12:12 AM
http://www.php.net/ has instructions on how to configure apache to use php.
all you have to do is add three of four directives to your httpd.config file

Cheeseman
04-16-2004, 12:44 AM
Originally posted by dreweries
http://www.php.net/ has instructions on how to configure apache to use php.
all you have to do is add three of four directives to your httpd.config file

Well actually, there's a little more to it than that. You have to download the MySQL server, create files, configure several files and then move DLL's and such into various system folders. Then, you need some way to administer all of this and although I downloaded all the fancy GUI tools from the MySQL website and spent days playing around with all of it, I still had no luck. I got as far as creating a database and password at the command line but when I'd try to create a user, I got errors. I've got a zillion MySQL tools cluttering up my server box now and I am getting more confused by the minute. Oh yes, I already added those things to Apache's httpd file and I can't get any of it to work. I'm not trying to be smug and nasty, I'm just stating facts here. It has been a nightmare for me to say the least and I'm not known to be the dimmest bulb in the box and this thing has me beat so far.

dreweries
04-17-2004, 12:44 PM
I use windows xp and had no problems geting php or mysql working.

but I did I figure out how to make different cgi directories for apache.

make the new directories outside of your active directory.
don't put them in your htdocs directory.
put them in your apache directory.

in your httpd.conf file find the directive ScriptAlias,then add another ScriptAlias directive for each new directory.

syntax for the scriptalias directive--------------------------

ScriptAlias /put directory name here/ "put actual path to directory here"

---------------------------------------------------------------------

and then add this directive for each ne scriptalias

<Directory "put the path to the cgi directory here">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

then change (allow from all) to indicate the user for that directory

then save the httpd.conf file and restart apache.

Cheeseman
04-17-2004, 07:45 PM
Hey, I really appreciate your taking the time to help me but I did exactly as you said and when I try to go to the page, it gives me this...

You don't have permission to access /users/joe/help/ttx.cgi on this server.

By default the server looks in the "htdocs" folder so I'm not sure how it is going to find this new one (outside of the main folder) and if I change the default folder in the config file so that it finds the new one, I won't be able to get to the main one (htdocs).

Here's what I have...

<Directory "C:/Program Files/Apache Group/Apache2/users/">
AllowOverride None
Options None
Order allow,deny
Allow from joe
</Directory>

When I try to install YaBB in "Joe's" folder, it gives me a 500 internal server error and if I try to run a test script in that same folder my browser tries to download it.

Not sure what to do here:)

dreweries
04-17-2004, 09:47 PM
Your welcome,I don't mind helping people.

-----You don't have permission to access /users/joe/help/ttx.cgi on this server.------------------------------------------------------

is /help/ the cgi directory you added?
if so you need to change this


<Directory "C:/Program Files/Apache Group/Apache2/users/">
AllowOverride None
Options None
Order allow,deny
Allow from joe
</Directory>

--------------this has set the users directory to have no options allowed.and thats not good.--------------

to this

<Directory "C:/Program Files/Apache Group/Apache2/users/joe/help">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

don't worry about allow all it wont let anyone index the directory or access it,cause there are no options allowed.

when you try to run the test.cgi script add a / to the end of the url.

and make sure the shebang line points to the right program to run the script.

if you need help call me I sent you my phone# in a private message.


I have added a test cgi directory to my server and tested it and it worked,so I know this will work if you do it right.

I noticed you have apache installed in
c:/program files/apache Group/apache2/

I have found that php and apache as well seem to have problems with directory names that have spaces in them.

you should try installing apache to c:/apache/apache/
I had to do this to get it to work with perl and php.

if you do this be sure to save your htdocs folder and any other folders you have added to the apache directory first or you will lose them,and that would realy bite.

:eek:

Cheeseman
04-18-2004, 01:39 AM
Hi

Well, I just spent the last hour or so trying to get Apache to install and work in "Apache/Apache2" but after numerous installs, un-installs, moving files, etc, I finally surmized that Apache does'nt like to stray too far from it's happy home in the program files folder...lol.

Anyway, I'm reinstalling as I type. Hey, that was pretty nice of you to go out of the way to help me like this (phone number and all!). I was online (well, BBS) back in 1984 and again in the early nineties and the internet was a small, quaint, tight-knit little village where everyone looked out for each other. It's good to see that this spirit is still alive and well on this board.

Ok, well enough of the mushy stuff <reaches for tissue>. I'll come back here shortly and try the bits ofcode you provided. Take care and thank's again for sure bud!.

PS: If I simply cannot get it to work, would it be ok if I just posted/sent you a default Apache config file, told you what I wanted it to do and then maybe you could send me back a "made-to-order" config file?. Man, I feel like such a leech asking you to do that but I've been messing around with this for 4 days now so (out of sheer desperation) I had to ask. I figure the worst you can do is say no:).

UPDATE: Well, I tried your other example and I'm still having the same problem. I agree with you about the spaces between folder names causing problems but suprizingly, my Perl/CGI stuff works excellently. Whenever, you have spaces between folder names, if you just surround the path in quotes, it usually works just fine. Php/MySQL is another story though (eeek!!!). I still want to find a "pro" to just take the default config and make it "to order" with all the goodies (users, mime types, extra stuff, etc) but I hate to look a gifthorse in the mouth, you know?.

Anyway, thank's again!!

dreweries
04-18-2004, 12:24 PM
I would be happy to help.
just send me an email with a default httpd.conf file attached and instructions of what you want to do and I'll edit the file.

I can set up seperate cgi directories for your users,but as to being able to have non-cgi files in them this wont work.

A cgi directory will treat all files in it as cgi's,so any non-cgi files will return errors.You will need to put all non-cgi files in each users own user directory.

food for thought---the default cgi-bin directory cannot be indexed or directly accessed by anyone unless they know the name of the file there trying to access.So if your worried about the security issue of each user accessing the other users scripts,just use unique file names for each script.

I'm not really sure just what your main concern is with having only one cgi-bin.

as to using php and mysql I could set them up for you too.
This is really the way you should go.
php is by far the best scripting language I have ever used.
there are several open sorce php scripts that you can use to create member logon sites that won't give your users direct access to your server.
If your interested I would be happy to get php and mysql working on your server for you I use windows xp and apache and know exactly how to set it all up.And I'm sure once you got it working you would find it's the answer to all your problems.
:)

Cheeseman
04-18-2004, 06:54 PM
Thank you for the kind offer!.

Well, I reinstalled Apache last night and finally went to bed. When I got up this morning, I started out with a fresh config file, made the changes you showed me, did some tweaking of my own, extensively tested everything and all works great now.

The way I have it set up is that I have various users in a folder under htdocs and each user can run scripts right out of their own folder without even having to create a cgi-bin. They can even "run" images and other files.

To make sure I was'nt getting excited for nothing, I effortlessly created a new account with full FTP access and then proceeded to configure and install YaBB2 in that folder. Everything worked fine, so I backed up all of my changes, got a ton of other stuff done and called it a day.

Then I discovered that my SMTP server had quit working for the fourth time in a row. Even DNSTools.org complains about it so right now, the biggest thing is just being able to find a decent (and free/GPL) mail server with all the bells and whistles.

I've already tried this one popular SMTP server. Great server but I'm having major probs with the SMTP connector mysteriously quitting on me ever day or so and the other one I tried is pretty old and lacks a lot of the features found in the modern mail servers. Not knocking these servers - just saying they were'nt for me:). Could you possibly recommend a few good ones?.

Oh, on the Php/MySQL. I have the MYSQL administrator and that other fancy GUI front-end (nice!!) but I'm still trying to get past the GRANT/permissions stuff. All in good time I suppose.

- Peace

dreweries
04-19-2004, 03:34 PM
Thats great,congrads.

The cheapest mail server I have found is capesoft mail server $30.00 and suports smtp and pop3,I use it and it works great comes with a 60 day trial.

http://www.capesoft.com

I was also up all night,got a virus and had to re-format my hd and start from scratch.
I upgraded apache from 1.3 to 2.0 and had php and mysql runing in under an hour.only had to add two lines to httpd.conf and copy one .dll to windows.

If you want to try php and mysql I can walk you through it on the phone,it's really not that hard I've got the installation down to an art.

Cheeseman
04-20-2004, 08:29 AM
Hi

Thank's. I got the SMTP server problem resolved (I just downloaded the new version of the program with the bug fix) and all has been working well ever since.

My main problem at the moment is just that I'm not sure if I'm supposed to be using the MySQL Administrator - or - the MySQL control center to create my databases and administer them. Are they both the same kind of MySQL front-end or are they entirely different?. I don't want to have to type reams of code into a terminal whenever I create or administer a database. Can I do it all with one of these GUI programs and which one do I use?

I have the latest versions of PHP, MySQL, MyODBC, the administrator and the control center. I've got the correct port open and I've created the cnf file, etc. The only thing is that when I go to FILE>NEW in the MySQL Control Center program and use the following info...

NAME: Joeblow
HOST NAME: mydomain.com
USERNAME: blah
PASSWORD: blahblah

...and click on the "Test" button, I get the following message...

"ERROR 1130: host 192.168.1.1 is not allowed to connect to this MySQL server"

It's not DNS or because I don't have my MySQL server up and running or anything...everything is fine there, thankfully. Also, I have a static IP assigned to my WAN on a biz account and the IP above is'nt even my LAN one but I'm not sure how to get MySQL to understand that.
I'm just wanting to create a database with a username and password so I can install PHPBB2 on it.

PS: Thank's for your very generous offer to help me over the phone and I don't mean to sound choosey or anything but I was just thinking that with a phone conversation there is nothing to refer back to (ie; notes, instructions, etc). Would you mind terribly if we used instant messaging?. I have just about everything but ICQ installed and neither one of us would end up with a phone bill at the end of the month...lol.

Thank's again for your help:)

dreweries
04-21-2004, 08:52 AM
sure I use windows messenger my email address is kanda@ubtanet.com, msn messenger will also work add me to your budy list,my messenger name is kim&andy.

goto google and search for phpmyadmin and use it to adminastor mysql.

or you can download phpmyadmin from me at http://dreweries.com/installers/

it will let you add user names and passwords to mysql with ease,but you have to have php working on your server.