LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-08-2007, 04:59 PM   #1
moonguide
LQ Newbie
 
Registered: May 2007
Posts: 4

Rep: Reputation: 0
Where to put index.php (or index.html) on Slackware 11.0


I'm replacing an old web server machine with a not quite as old one. The old machine ran RH 7.0. This one is running Slackware 11.0. I'm still getting used to the differences.

Now that MySQL is running, I'm trying to get php running on Apache. if I drag the file phpinfo.php into Firefox I get a blank pane. The file contains just the following line:

<? phpinfo(); ?>

On the old RH machine that used to print a lot of information to the screen.

I followed the instructions for adding lines to httpd.conf:

LoadModule php4_module libexe/apache/libphp4.so

and

AddModule mod_php4.c

I ran apachectl configtest and got Syntax OK. then I ran rc.httpd restart and got:

/usr/sbin/abachectl restart: httpd restarted

What did I miss?

Also, on the RH machine I had a directory /var/www/html in which I had index.php. If I entered the address of the machine (192.168.0.254) the index.php page was displayed. Now, when I enter that address from a browser on another machine in the house, I get the "Hey, it worked!" page from Apache. There was no directory "html" in /var/www on the Slackware machine. Is Apache on Slackware configured to look somewhere else for an index page?

Thanks.
 
Old 05-08-2007, 05:42 PM   #2
gibson79
Member
 
Registered: Feb 2007
Distribution: Slackware
Posts: 40

Rep: Reputation: 15
It would go in /var/www/htdocs I believe. This is the default location that apache uses.
 
Old 05-08-2007, 06:24 PM   #3
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
to enable php in apache, go to /etc/apache
Code:
cd /etc/apache
copy either the file php.ini-dist or php.ini-recommended to php.ini
Code:
cp php.ini-dist php.ini
copy mod_php.conf.example to mod_php.conf

Code:
cp mod_php.conf.example mod_php.conf
(mod_php.conf is the file that contains the LoadModule php4_module
and "AddType application/x-httpd-php .php" stuff.

then restart apache:
Code:
/etc/rc.d/rc.http restart
Apache's root directory is /var/www/htdocs
 
Old 05-08-2007, 06:35 PM   #4
moonguide
LQ Newbie
 
Registered: May 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks. I also checked some of the "Similar Threads" and found out what to look for in httpd.conf.

There is an entry called DocumentRoot. It is indeed set to /var/www/htdocs as the default. I commented out that line and added:

DocumentRoot "/var/www/html"

Then, after restarting Apache, I successfully found the expected index.html page when connecting to the web server from a browser on another machine. Also, the php info page displays the correct information.

Thanks again for the pointer.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the default webpage configuration from index.php to index.htm, etc meema Linux - Server 4 08-22-2008 09:06 PM
index.html is not noticed in /var/www/html xviddivxoggmp3 Red Hat 1 04-23-2006 06:30 PM
index.html ronraj Linux - Newbie 8 06-16-2005 04:54 PM
Konqueror + file:/usr/share/doc/HTML/index.html jon_k Linux - Software 2 11-25-2003 05:06 AM
Spanish index.html liguorir Linux - Software 1 09-24-2003 02:22 PM


All times are GMT -5. The time now is 05:27 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration