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
4
votes
3 answers

Django Apache DocumentRoot?

What directory must the DocumentRoot in Apache be set to run a Django app is it the static directory but that does not work? Thanks to all for the help in advance.
djangoman
  • 319
  • 4
  • 11
4
votes
2 answers

PHP get file outside of document root

here is my project structure: Web root/document root: /var/www/ all the website files in the the 'www' folder I want to use require or include a file inside my folder OUTSIDE the web root/document root: /var/extra-files how can i get a file inside…
baileyJchoi
  • 473
  • 5
  • 17
4
votes
1 answer

Echo the ending part or last folder of $_SERVER['DOCUMENT_ROOT'] in PHP

I need to use $_SERVER['DOCUMENT_ROOT']; to scandir for files and folders to display for my nav menu. Let's say my root directory is at /home/user/public_html/website/. Here's how I echo the root directory: echo $_SERVER['DOCUMENT_ROOT']; it will…
Mike
  • 607
  • 8
  • 30
4
votes
2 answers

Multiple Document Roots based on directory?

My server's structure is like this: |- var |-- www |--- website1 |--- website2 |--- website3 I'm currently working on website1, but I found that when I submit one of my Ajax forms, it returns the following…
user4440513
4
votes
1 answer

Laravel javascript location should be in view or public

I have a javascript that requires a root directory path provided by PHP to call the JSON file. I'm not sure if this code should be in public/js or within my template.blade.php? If it's in public/js, then I have to specify a absolute path like below,…
Robert M. Tijerina
  • 165
  • 2
  • 4
  • 12
4
votes
1 answer

How can I learn DOCUMENT_ROOT in startup.pl under mod_perl2?

I want to learn DOCUMENT_ROOT in startup.pl, but the best I can do is to learn server_root: use Apache2::ServerUtil (); $server_root = Apache2::ServerUtil::server_root(); which is quite useless. I can set an environment variable with SetPerlEnv…
codeholic
  • 5,680
  • 3
  • 23
  • 43
4
votes
3 answers

Nginx 301 Redirect all non home page urls to home page

I'm shutting down a site and I need to 301 redirect all pages to the home page where I have a message saying that the site is being closed down. Basically any http://example.com/anyfolder -> 301 to http://www.example.com I have the following but…
Ranknoodle
  • 847
  • 12
  • 28
3
votes
2 answers

Apache,may I have multiple documentRoot?

I'm building a Zend website.The project (local) has the following structure: /app /controllers /views /public /css /images /js .htaccess index.php Because the .htaccess and index.php files reside within th public directory,the…
luca
  • 36,606
  • 27
  • 86
  • 125
3
votes
3 answers

DocumentRoot always defaults to /var/www/html and cannot change it

I've set up a Virtual host using PuPHPet (Vagrant-Puppet-PHP) Apparently PuPHPet creates a default site for me with this configuration 10-default_vhost_80.conf ServerName default ## Vhost docroot DocumentRoot…
JohnnyQ
  • 4,839
  • 6
  • 47
  • 65
3
votes
2 answers

Servlet path "/" returns that servlet content for any request pattern

When I map servlet with path as like: Home1Servlet com.project.servlets.Home1Servlet Home1Servlet
nullptr
  • 3,320
  • 7
  • 35
  • 68
3
votes
1 answer

VirtualHosts ONLY no default?

I have a debian setup with Apache. I disabled the 'default' site and added a single one for now. I want to disable access to everything except that which is under the various vhosts. DocumentRoot…
Alex.Barylski
  • 2,843
  • 4
  • 45
  • 68
3
votes
1 answer

How can I add a attribute to Root node of my XmlDocument() in C#

I already have a XmlDocument object in C#. Let's say the InnerXml looks like this; 8825 How can I add a attribute which has the name as uuid and the value as 781283721381,…
neildt
  • 5,101
  • 10
  • 56
  • 107
3
votes
1 answer

Modify document root for nginx proxy under plesk

I use Plesk with nginx as proxy, which is working good. I installed laravel php framework on a subdomain. the framework provides a direcotry "public" for public files, so I changed document_root with a custom vhost.conf file this way: DocumentRoot…
Danzzz
  • 523
  • 8
  • 26
3
votes
1 answer

Any optimizations in reducing the number of disk accesses for inode number lookup by web-servers?

Web-servers typically have a document root denoting the filesystem sub-tree visible via the web. Consequently for eg., if the document root is: /home/foouser/public_html/, then the web-server would map a request for http://www.foo.com/pics/foo.jpg …
Avinash
  • 31
  • 1
3
votes
1 answer

open_basedir restriction in effect error in php code

Im beginner in php language. in my web project i created a filepath.config.ini file which stores all file path in the website directories. for eg. CLASS1 = bin/myclass1.php CLASS2 = bin/myclass2.php and im accessing those path by using: require…
Ashish Panwar
  • 1,118
  • 3
  • 11
  • 18
1 2
3
22 23