Page 1 of 1

setting up a webserver

Posted: Wed Jan 26, 2005 10:21 am
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

Posted: Wed Jan 26, 2005 8:21 pm
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

Posted: Thu Jan 27, 2005 2:52 am
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

Posted: Thu Jan 27, 2005 6:07 am
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.

Posted: Thu Jan 27, 2005 6:11 am
by bob_man_uk
done it, still screws up!

thanks

mattyg

Posted: Thu Jan 27, 2005 8:13 am
by timvw
apachectl configtest ... gives some indications....

Posted: Thu Jan 27, 2005 8:19 am
by bob_man_uk
brings back

Code: Select all

syntax OK

Posted: Thu Jan 27, 2005 1:37 pm
by timvw
might want to check apache's error log
tail /var/log/apache/error.log

Posted: Fri Jan 28, 2005 6:33 am
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"
:(