LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-05-2002, 02:08 AM   #1
bowen
LQ Newbie
 
Registered: May 2002
Location: Hong Kong
Posts: 6

Rep: Reputation: 0
Apache Document Root Path


I have just installed RedHat 7.0, MySQL 3.23.33 and Apache 1.3.19. But then, after I have installed Apache, I discovered that the Document Root of Apache Server is /var/www/html, not /usr/local/apache/htdocs.

I have already set the httpd.conf's document root to /usr/local/apache/htdocs, but nothing changed.

Can someone tell me why? Thanks.
 
Old 06-05-2002, 02:16 AM   #2
bowen
LQ Newbie
 
Registered: May 2002
Location: Hong Kong
Posts: 6

Original Poster
Rep: Reputation: 0
One more thing

Moreover, I have tried to use the following command to restart apache server, then I got the following output.

#/usr/local/apache/bin/apachectl restart
/usr/local/apache/bin/apachectl restart: httpd not running, trying to start
/usr/local/apache/bin/apachectl restart: httpd started

I have tried several times, but still this output.
But does Linux tell me that httpd is not running?
 
Old 06-05-2002, 02:17 AM   #3
dorward
Member
 
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
Did you restart Apache?

What's wrong with /var/www/html? Its the location advised by the Linux Standards Base.
 
Old 06-05-2002, 02:24 AM   #4
bowen
LQ Newbie
 
Registered: May 2002
Location: Hong Kong
Posts: 6

Original Poster
Rep: Reputation: 0
Yup, I have restart the apache server with the following command:

#/usr/local/apache/bin/apachectl restart
/usr/local/apache/bin/apachectl restart: httpd not running, trying to start
/usr/local/apahce/bin/apachectl restart: httpd started.

Because I want to install PHP, but I don't know I can't install it. I have tried to install PHP for many many times, I have edited the httpd.conf for PHP 4, but still, it is not workable. The page only display the code, but not the PHP output.

Can anyone tell me the FULL process for installing the PHP? Thanks a lot.
 
Old 06-05-2002, 04:13 AM   #5
dorward
Member
 
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
The full process for installing PHP varies a lot depending on how you install it. For example, the full process for installing it on my system was.

Code:
apt-get install php4 php4-mysql phpdoc
(and tap {Return} a few times)

PHP, btw, is quite happy with the document root in /var/www

Last edited by dorward; 06-05-2002 at 04:17 AM.
 
Old 06-05-2002, 06:11 AM   #6
adcripps
Member
 
Registered: Mar 2002
Location: South UK
Distribution: Mandrake 8.2
Posts: 103

Rep: Reputation: 15
Okay, I can add my comments, because I've just installed the latest PHP and APACHE and got them going. I'm running Mandrake 8.2 and thought that my installation would deal with the configuration. This turned out to not be the case. After a session on IRC (thanks Morn) I updated my APACHE and then PHP.

Apache first. IIRC, I couldn't go for the rpm install version because it's the same version as my installation one. So I went to apache and downloaded the tar.gz - which turned out to be easier than I thought. I followed the readme's and installed. I recommend you get the latest Apache.

Then, install PHP, and, if you're lucky, it will configure httpd.conf for you (the apache confg file). If you're not lucky then a couple of lines of code should do it (it did for me).

If you need more help, just shout.

HTH.
 
Old 06-05-2002, 03:40 PM   #7
wetback
LQ Newbie
 
Registered: Oct 2001
Posts: 2

Rep: Reputation: 0
Quote:
Originally posted by bowen
Yup, I have restart the apache server with the following command:

#/usr/local/apache/bin/apachectl restart
/usr/local/apache/bin/apachectl restart: httpd not running, trying to start
/usr/local/apahce/bin/apachectl restart: httpd started.

Because I want to install PHP, but I don't know I can't install it. I have tried to install PHP for many many times, I have edited the httpd.conf for PHP 4, but still, it is not workable. The page only display the code, but not the PHP output.

Can anyone tell me the FULL process for installing the PHP? Thanks a lot.
Try running the deamon /etc/rc.d/init.d/httpd start
 
Old 06-06-2002, 10:11 AM   #8
adcripps
Member
 
Registered: Mar 2002
Location: South UK
Distribution: Mandrake 8.2
Posts: 103

Rep: Reputation: 15
You need to configure your httpd.conf file (which is normally in /etc/conf/ but can also be in conf within the apache directory).

This file tells apahce what to do when certain requests are made of it. When Apache receives a request for a PHP file it needs to know where PHP is as PHP is the donkey that does all the work. Once it has done the donkey work, it gives it back to Apache to display.

Clearly, the fact that you are seeing the code means that PHP is not getting it.

Can you display the lines in httpd.conf. It's a shame I'm at work, because if I was at home, I'd post the couple of lines in my httpd.conf and you could try them. If I remember, when I get home, I'll put them up.
 
Old 11-29-2002, 02:13 AM   #9
imposter
LQ Newbie
 
Registered: Nov 2002
Location: UK
Distribution: Debian Sarge
Posts: 17

Rep: Reputation: 0
I have a problem where I have the httpd.conf in the install dir for apache2 and in /etc/httpd/conf/httpd.conf and in /usr/local/apache2/conf/httpd.conf

Can anyone tell me which one I should be editing?
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache - change document root? squall14716 Linux - Software 2 01-20-2010 10:16 AM
Apache 403 when changin document root. webgovernor Linux - Newbie 3 04-20-2005 12:54 AM
Apache 2: won't allow document root to be changed, plus more QtCoder Linux - Networking 1 11-06-2004 04:44 PM
Document Root in Apache Hal Linux - Newbie 2 10-28-2003 06:10 AM
Apache 2.0.40 and document path Drogo Linux - Software 11 06-27-2003 10:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:51 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration