setting up a webserver

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
bob_man_uk
Forum Newbie
Posts: 5
Joined: Wed Jan 26, 2005 10:06 am

setting up a webserver

Post by bob_man_uk »

Hi all,

i wasnt quite sure where to post this as it could fall into the realms of another forum but here goes,

I am setting up a test webserver on a debian woody 3.0r4 and have samba and apache set up ok, i have installed perl but have not come round to needing it yet, the problem is i have come to run a php page, but when i run it, it comes up and asks to open save or cancel, now im not exactly an expert (yet) but it shouldnt do that, the page in question should come up like a webpage, but it isnt, i installed it all from apt-get, E.G.
apt-get install apache
apt-get install mysql-server / client
apt-get install php4
apt-get install perl
and so on, the idea was to get a 'LAMP' server or at least that is what ive read they are.

any help is appreciated,

mattyG
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

probably, you still need to add some lines to your /etc/apache/httpd.conf

One to load the module (might be in /etc/apache/modules.conf too)
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so

One to connect the files with that extension to the module
AddType application/x-httpd-php .php

And probably want to change the index files too
DirectoryIndex index.html index.htm index.shtml index.cgi index.php
bob_man_uk
Forum Newbie
Posts: 5
Joined: Wed Jan 26, 2005 10:06 am

Post by bob_man_uk »

thanks for the reply, it turns out that the modules etc were commented out (i guess by default) but even though i changed them and restarted apache it still wont open the page, also im not entirely seure what you mean by change the index files, index.html is the default one installed by apache, index.htm/shtml/cgi/php dont exist,

thanks

mattyG
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

you need to restart apache (perhaps reload is enough)


as root: /etc/init.d/apache restart (the debian way)
/usr/sbin/apachectl restart (the apache way)



just choose what you want to be considered as indexfile.
bob_man_uk
Forum Newbie
Posts: 5
Joined: Wed Jan 26, 2005 10:06 am

Post by bob_man_uk »

done it, still screws up!

thanks

mattyg
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

apachectl configtest ... gives some indications....
bob_man_uk
Forum Newbie
Posts: 5
Joined: Wed Jan 26, 2005 10:06 am

Post by bob_man_uk »

brings back

Code: Select all

syntax OK
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

might want to check apache's error log
tail /var/log/apache/error.log
bob_man_uk
Forum Newbie
Posts: 5
Joined: Wed Jan 26, 2005 10:06 am

Post by bob_man_uk »

the only errors i find in error.log are

Code: Select all

їThu Jan 27 12:54:27 2005] їerror] (2)No such file or directory: mod_mime_magic: can't read magic file /etc/apache/share/magic
їThu Jan 27 12:54:27 2005] їerror] (2)No such file or directory: mod_mime_magic: can't read magic file /etc/apache/share/magic
all the rest are notices

on access.log

Code: Select all

192.168.1.240 - - ї25/Jan/2005:18:00:06 +0000] "GET /sys-check.php HTTP/1.0" 200 23664 "-" "Mozilla/4.0 (compatible; MSIE 6.$
194.1.1.151 - - ї26/Jan/2005:15:49:29 +0000] "OPTIONS / HTTP/1.1" 200 - "-" "Microsoft-WebDAV-MiniRedir/5.1.2600"
194.1.1.151 - - ї26/Jan/2005:15:49:29 +0000] "PROPFIND /www HTTP/1.1" 404 272 "-" "Microsoft-WebDAV-MiniRedir/5.1.2600"
:(
Post Reply