[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: configuring Mozilla to recognise .php files



Everyone else seems to be pointing you to config files and making
things more complicated than what it really is.  I get the impression
this would be your first time setting up a webserver and whatnot.  If
you're like me when I did it for the first time, things could be a
little overwhelming.

In Debian it's extremely simple to get a webserver up and running. 
You need 3 packages (plus whatever dependencies they ask you for): 
webserver, scripting language, and a connecting module.  For my system
I used apache2-mpm-prefork, php4, and libapache2-mod-php4.  Once those
are installed (assuming the apache2 service gets started - which it
always has for me using aptitude), you can immediately stick files in
/var/www/ and access them by going to localhost/filename.php in
Mozilla.  That's all there is to it.  If the service didn't get
started, simply do '/etc/init.d/apache2 restart' and you'll be set.

There are a plethora of options and things to mess with, both for php
and apache.  You can find a lot of documentation for both of them
online using google and their respective hompages.  But for a basic
setup, Debian takes care of just about everything.

One thing you should take note of is security.  Once you have the
webserver up and running, if you're not running a firewall to block
port 80, anyone can connect to it.  Apache2 has a file you can edit to
remedy that.  Check out /etc/apache2/sites-available/default.  You'll
see a section that looks a little like the following, which you can
edit to your liking:

        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                #Order allow,deny
                #allow from all
                Order deny,allow
                deny from all
                allow from 10.1.0
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                #RedirectMatch ^/$ /apache2-default/
        </Directory>

I think you can probably follow what it's doing, but i'll explain it. 
This section provides the security permissions for the /var/www/
directory.  It first denies access to EVERYONE (all).  Then it allows
connections to users whose IP address begins with 10.1.0 (which is the
internal ip address setup for my network).  You could set it up to
deny from all, then only allow your ip address.  To find out what your
ip address is you can run 'ifconfig' as root.

You can also see in my pasting up above that I commented out the
RedirectMatch line.  The comments explain what that does, and if you
try to go to 'localhost' without specifying a filename you can see for
yourself what it does.  Apache2 has that line in there by default,
took me a bit of searching to figure out where it was and how to get
rid of it, that's how I discovered all of the security stuff :)

Good luck getting it all working!

Ben



Reply to: