Closed Thread Icon

Topic awaiting preservation: apache + php (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=12643" title="Pages that link to Topic awaiting preservation: apache + php (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: apache + php <span class="small">(Page 1 of 1)</span>\

 
marf
Bipolar (III) Inmate

From: Canada
Insane since: Oct 2001

posted posted 03-09-2003 15:33

I have apache installed on my server and it works fine. But I want to install PHP and a CGI support. Can sombody tell me a good tutorial that gives step by step instructions to install PHP and/or CGI on an Apache server? Thanks.

Piper
Paranoid (IV) Inmate

From: California
Insane since: Jun 2000

posted posted 03-09-2003 17:16

Hi marf,

Is this a Windows or linux server? That will make a big difference in what you need to do.

~Charlie

marf
Bipolar (III) Inmate

From: Canada
Insane since: Oct 2001

posted posted 03-09-2003 19:00

Its on Windows XP Pro
I currently have
Apache V1.3.27 (I know V2 is out but its still in testing)
I also have PHP 4.3.1 Installed and workin on the server
Now I want to add MySQL, CGI, and Perl to the webserver. So I mainly need tutorials on these three.

Thx

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 03-09-2003 20:54

well, mysql is easy...
download the windows installer from mysql.com, start, follow instructions on screen.
Done.
Since it doesn't really tie into the webserver, no more configuration will be required.

Option b) Download a 'complete package' like foxserv (there are serveral listed in the appropriate ...), which will take care of all your needs.

And cgi isn't 'something to install', it's just a way to have apache start other programs and return their output as webpages.

so long,

Tyberius Prime

Piper
Paranoid (IV) Inmate

From: California
Insane since: Jun 2000

posted posted 03-10-2003 00:43

For perl, go to ActiveState.com and get yourself a MSI of the latest release. I'd probably stick with 5.6.1 if you're thinking about working with MySQL and perl (DBI & DBD::Mysql). URL: http://www.activestate.com/Products/ActivePerl/

CGI isn't actually language, it's an common gateway interface for just about any language. Perl just happens to be the most widely used language for CGI's (and my favorite).

To configure Apache to handle perl as a CGI you will have to edit your httpd.conf. Look for an existing cgi-script handler as it's probably already there. It'll look like this:

code:
AddHandler cgi-script .cgi .pl


If it's not there, add it inside the <IfModule mod_mime.c> block or in a Directory block (or in your <VirtualHost> blocks for that matter). I'd stick with the <IfModule mod_mime.c> block though. Make sure that it's set for both .pl and .cgi extensions.

You'll also want to associate .cgi and .pl file extensions with your perl binary. Use windows explorer for that, it's in one of the menu options. You need make sure the perl binary is in your path so Apache can find it when it needs it. I think this is handled by the ActiveState install though.

That should get you all set up.

Oh, one last thing. When you write a perl cgi, you will set to set the shebang line (the very first line of your script) to where you installed perl. It should look like #!/path/to/perl. [HINT] Install perl in C:\usr. That will let you use #!/usr/bin/perl as your shebang which is one less thing you will need to change when you upload your apps to just about any linux server.

Regards,
Charlie

marf
Bipolar (III) Inmate

From: Canada
Insane since: Oct 2001

posted posted 03-10-2003 03:45

Ok thanks for all your help. I now have another question. I have a domain name purchased. Now I have a friend who i want to host webspace for. How can i add him an account so it looks like http://friend.infinitedesigns.org

friend would be his account
how can i do this with Apache?

Thanks

brucew
Paranoid (IV) Inmate

From: North Coast of America
Insane since: Dec 2001

posted posted 03-10-2003 06:39

Adding a subdomain is a two-step process.

First, in virtual hosting section of httpd.conf (usually right at the end), add something like:

#
# Virtual Hosting for friend web.
#

<VirtualHost *>
DocumentRoot /full/path/to/friend's/htdocs/directory
ServerName friend
ErrorLog /full/path/to/friend's/log/directory
CustomLog /full/path/to/friend's/log/directory/access_log combined
[add whatever other options will apply to friend]
</VirtualHost>

Save it, create the required directories and restart apache. (Oh, don't forget to make a spare copy before editing. Just in case, ya know?)

Then add an "A" record to your DNS for friend.infinatedesigns.org and your IP address. This is done a bit differently at various hosting services, check with support if hunting around for it doesn't produce results.

If you need more info, "subdomain" and "virtual host configuration" are good keywords in your search.

HTH!

marf
Bipolar (III) Inmate

From: Canada
Insane since: Oct 2001

posted posted 03-10-2003 15:08

I adited the conf file
added all the appropriate stuff
but now the step where I tell www.buydomains.com to do

quote:
Then add an "A" record to your DNS for friend.infinatedesigns.org and your IP address. This is done a bit differently at various hosting services, check with support if hunting around for it doesn't produce results.


i m confused
I loged into my account with them and there wasn't any option to add anything of the sort...

brucew
Paranoid (IV) Inmate

From: North Coast of America
Insane since: Dec 2001

posted posted 03-10-2003 18:12
quote:
I loged into my account with them and there wasn't any option to add anything of the sort...



It might also be referred to as "Zone Records" or "Zone Editor". Not all hosting firms let their customers tinker with the DNS. Maybe your is one of them. Check with their support department. They may do it for you.

brucew
Paranoid (IV) Inmate

From: North Coast of America
Insane since: Dec 2001

posted posted 03-10-2003 18:31

If they don't do the DNS thig, there are two other possibilities.

1) Use an outside DNS service. They've been discussed here several times. I'm sure a quick search will turn up something.
2) Give your friend a web user account instead. These take the form www.yourdomain.com/~friend. The webs are still isolated so that problems in one don't affect the other. I haven't done this myself--there's no need at home and at my hosting service it's a button and form that does it--but here's the Apache docs on it: http://httpd.apache.org/docs/mod/mod_userdir.html

HTH!

« BackwardsOnwards »

Show Forum Drop Down Menu