LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Apache Document Root Path (https://www.linuxquestions.org/questions/linux-general-1/apache-document-root-path-22627/)

bowen 06-05-2002 03:08 AM

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.

bowen 06-05-2002 03:16 AM

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?

dorward 06-05-2002 03:17 AM

Did you restart Apache?

What's wrong with /var/www/html? Its the location advised by the Linux Standards Base.

bowen 06-05-2002 03:24 AM

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.

dorward 06-05-2002 05:13 AM

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

adcripps 06-05-2002 07:11 AM

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.

wetback 06-05-2002 04:40 PM

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

adcripps 06-06-2002 11:11 AM

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.

imposter 11-29-2002 03:13 AM

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?


All times are GMT -5. The time now is 04:46 PM.