How to fix apache "not configured docroot" error under Ubuntu

Greetings to experts and gurus, I am looking for some help with apache php configuration problem.

I’ve been running several sites from the apache2 installation on the ubuntu server for several years now, without any problems, using the NameVirtualHost * line in the file etc / apache2 / conf.d / virtual.conf. I recently upgraded the server version to the latest version of lts, ​​and now I can not run php files.

I run all my sites for the location "/ home / www / [site-name] / htdocs" and I have set up and enable all my sites in / etc / apache 2 / sites-available. I also disabled the default site.

For each site file, I specified the following:

# Indexes + Directory Root. # DirectoryIndex index.html index.htm index.php DocumentRoot /home/www/[site-name]/htdocs/ # CGI Directory ScriptAlias /cgi-bin/ /home/www/[site-name]/cgi-bin/ <Location /cgi-bin> Options +ExecCGI </Location> # Logfiles ErrorLog /home/www/[site-name]/logs/error.log CustomLog /home/www/[site-name]/logs/access.log combined 

I restart apache and enter the url for the php test page on my server, and I am greeted with "Internal Server Error". When I check the error log, I get:

Script "/home/www/[site-name.BIZ/htdocs/test.php" permission to "/home/www/[site-nameapter/htdocs/test.php" not in the configured docroot.

+4
source share
3 answers

For some reason, looking at the suphp error is a lot. According to this link :

Do not be fooled by the fact that this has anything to do with the root of the Apche virtual host document; this is actually another setting in the suphp configuration file. Including paths containing RoundCube scripts fixed this. For example: DOCROOT = / var / WWW: / USR / shares / RoundCube: / var / Library / RoundCube: $ {HOME} / public_html

You need to edit the /etc/suphp/suphp.conf file and change the docroot to whatever works.

+14
source

It looks like you skipped the virtual host configuration for each site name:

 <VirtualHost IP:80> ServerName yourdomainname ServerAlias www.yourdomainname DocumentRoot /home/www/[site-name]/htdocs/ ScriptAlias /cgi-bin/ /home/www/[site-name]/cgi-bin/ <Location /cgi-bin> Options +ExecCGI </Location> ErrorLog /home/www/[site-name]/logs/yourdomainname.ua-error.log CustomLog /home/www/[site-name]/logs/yourdomainname-access.log combined </VirtualHost> <Directory "/home/www/[site-name]/htdocs/"> Options FollowSymLinks AllowOverride None Order allow,deny <Limit GET POST OPTIONS> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS> Order deny,allow Deny from all </LimitExcept> </Directory> 
+1
source

Thanks for all the help, I got there in the end. It seems that upgrading to Ubuntu 10.04 is enabled by suPHP. This became a good thing because the reason I was getting errors came down to managing files in my htdocs becoming sloppy.

To fix my problems, I had to do a few things:

First, I included suphp error messages in / etc / apache 2 / sites-available / [site-name]. This gave me a true error that told me that some of my pages have incorrect permissions. Then I set all permissions for folders on www to 755 and files to 644. I also needed to reduce the min_uid and min_gid values ​​in the suphp.conf file to 33.

0
source

Source: https://habr.com/ru/post/1382226/


All Articles