Questions tagged [document-root]

The document root directory under which the current script is executing, as defined in the server's configuration file.

341 questions
2
votes
2 answers

Why is localhost (DocumentRoot) blocked from running on GoogleDrive, Dropbox or Tresorit?

I am attempting to relocate my DocumentRoot (i.e. localhost) to a synchronised folder (such as Google Drive, Dropbox or Tresorit), but the attempt fails with a 403 error. On Windows machines I can configure localhost to run from…
2
votes
1 answer

Where is httpd serving content from if DocumentRoot is commented out in httpd.conf?

Would love to know if there's a way to use some control utility to find it out. Doesn't seem like apachectl can do it, but maybe it can. Edit: I should probably add that it's root# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) root#…
Randall Stevens
  • 596
  • 1
  • 8
  • 20
2
votes
1 answer

Apache Virtual Host redirect to document root directory

I have successfully set the DocumentRoot for a given server names: DocumentRoot "/var/www/html/domain1" ServerName www.domain1.com ServerAlias *.domain1.com #Other directives here I can't seem to figure out, how…
sredwopclub
  • 51
  • 1
  • 3
2
votes
3 answers

PhpStorm Server document root giving wrong path

I'm trying to configure my server document root into PhpStorm, which is giving an incorrect path to my actual document root (processed by PHP). PhpStorm is detecting $_SERVER['DOCUMENT_ROOT'] in my code and makes a relation to a path that matches…
ProtectedVoid
  • 1,293
  • 3
  • 17
  • 42
2
votes
1 answer

PHP & .htaccess: prepend file for Multiple Directories

I would like to prepend a PHP script automatically using .htaccess. I know that there is a directive to do this. I have the following in my .htaccess file in the web root directory: php_value auto_prepend_file "./init.php" The contents of the…
Manngo
  • 14,066
  • 10
  • 88
  • 110
2
votes
0 answers

Apache2 DocumentRoot pointing to /var/www instead of /var/www/html

About 2 months ago, I set up an app on a DigitalOcean server using Ubuntu 14.04 and Apache. Initially this worked great, but for about 2 weeks now, when I try to access the app at the usual domain, I get sent to an index page, without having changed…
urs
  • 21
  • 3
2
votes
0 answers

Wamp: imported site using root links (/link) goes to localhost/ instead of localhost/projectname/

I recently imported a live site to my local machine which runs wamp. The imported site uses root links, /link, which is fine, but it breaks the wordpress theme because it looks for /localhost/ over /localhost/projectname/. What can I do for it to…
Reverie123
  • 21
  • 3
2
votes
3 answers

PHP to Javascript: dirname and document_root

I got a little problem. I am working on a project and I got my root, then I got 2 folders: website1 and website2. website1 is the staff panel, where the upload script is on (where this problem is on). website2 is the website the 'customer' will…
Joshua Bakker
  • 2,288
  • 3
  • 30
  • 63
2
votes
2 answers

Possible to reference javascript files above document root?

I am working on a project where http://www.mywebsite.com/index.html is in /var/www/public, which is the document root (according to /etc/apache2/sites-available/000-default.conf). I have javascript files in /var/www/js that I would like to reference…
aCarella
  • 2,369
  • 11
  • 52
  • 85
2
votes
2 answers

PHP file_exists not working outside document root

I have the following directory structure where the Document Root is pointed to /var/www/html/public: /application /application/controllers /public (Document Root) I am trying to use the following code to check if a file exists inside a file in the…
Tim Kipp
  • 200
  • 1
  • 16
2
votes
2 answers

I looked everywhere to change DocumentRoot on Apache to no avail

I don't know what I am doing wrong but I can't change the directory of my localhost files with Apache. I tried all kinds of things with httpd.conf, including changing "Order allow,deny" to "Require all granted". It still doesn't work. I'm running…
2
votes
1 answer

$_SERVER['DOCUMENT_ROOT'] returns path with repeated directory name

I am seeing a strange behavior when accessing $_SERVER['DOCUMENT_ROOT'] on a subdomain. It contains a duplicate folder name which does not exist. Here is the the relevant output of $_SERVER: [DOCUMENT_ROOT] =>…
Derek
  • 3,438
  • 1
  • 17
  • 35
2
votes
1 answer

DocumentRoot is not changed, Update from Apache2 2.2.22 to 2.4.7

I do have the following problem. I have moved a few websites, with the same hierachy and website structure to a new server with Apache 2.4.7. The old one had 2.2.22. I've changed the default DocumentRoot to /var/www For testing I've created a…
Keenora Fluffball
  • 1,647
  • 2
  • 18
  • 34
2
votes
3 answers

Setting up Tomcat to process JSP's in DocumentRoot

I've got Apache running on my server, and some VHosts set up for myself through this; however, the apache documentRoot, nor any VHost's documentRoot appear to be calling tomcat to process any JSP files - in order to run a JSP, I need to upload it as…
Eoghan
  • 1,720
  • 2
  • 17
  • 35
2
votes
1 answer

Nginx root directive inside location block is not working as I expect

I'm having a big headache while configuring Nginx to work inside a location block. I'm developing a web application with Laravel, and it is located at /srv/http/zenith. With Laravel, the index is inside the public folder, so I'm trying to reach it…
ranieri
  • 2,030
  • 2
  • 21
  • 39