Questions tagged [documentroot]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
17 votes
8 answers
58k views

How to disable the default document root in Apache?

I host some websites on my server running Apache Httpd. Each website has it's own domain or sub-domain and virtual host. Therefore, I need no default document root. Is it possible to disable ...
danijar's user avatar
  • 403
15 votes
2 answers
52k views

Best permissions/ownership for apache document root

I need some help setting the correct permissions or ownership of the apache document root. Here is what I need: different websites stored in /var/www/html/<site> two users should update/manage ...
Marco's user avatar
  • 153
11 votes
2 answers
64k views

How do I change the document root of a Linux Apache server?

I'm trying to learn how to configure an Apache HTTP server (with which I have no experience) someone else has setup in a VM running Ubuntu 8.04. I know the server is running, since I get "<html>...
Daryl Spitzer's user avatar
10 votes
6 answers
10k views

Inconsistent trailing slash in DOCUMENT_ROOT variable in PHP when using Apache

In different server environments, the PHP $_SERVER['DOCUMENT_ROOT'] super global sometimes has a trailing slash and sometimes it does not. I would have thought this issue is directly related to how ...
Tom's user avatar
  • 4,307
6 votes
4 answers
3k views

Security of Apache DocumentRoot

I have a general question about security of Apache DocumentRoot, which comes from a statement I read when installing Galaxy, a bioinformatic web service and infrastructure. The statement says "...
user2196452's user avatar
6 votes
3 answers
8k views

Apache - Difference between VirtualDocumentRoot and DocumentRoot?

I found it very difficult to find this answer, after an hour (yes, an hour) of googling and browsing through several posts on stackexchange and several other forums... even through Apache's ...
Jay's user avatar
  • 201
6 votes
2 answers
6k views

Apache: Client-IP-based DocumentRoot

I don't know if this could be possible on apache yet, I've done hefty amount of research before coming here. but: I have a VirtualHost running at **:80*, ServerName to somedomain.tld. What I want to ...
Seth Jeremi Malaki's user avatar
6 votes
6 answers
27k views

Why am I getting this error in the logs?

Ok so I just started a new ubuntu server 11.10 and i added the vhost and all seems ok ...I also restarted apache but when i visit the browser i get a blank page the server ip is http://23.21.197.126/ ...
Matt Elhotiby's user avatar
5 votes
2 answers
1k views

What is the proper way to set up the Apache document root in terms of privileges?

I have just installed Ubuntu 9.10 server edition on my machine and I wish to run my own personal local server with other users in the same LAN. First, I was wondering what folder directory structure ...
user41157's user avatar
  • 189
4 votes
1 answer
1k views

Apache wildcard documentroot

I would like to use the the subdomain as my DocumentRoot folder foo.example.com Goes to /var/www/foo However I do not want to add a new entry for every subdomain Basically *.example.com Goes ...
Botto's user avatar
  • 231
4 votes
3 answers
27k views

Lighttpd static file server 403 forbidden error

I installed lighttpd on Debian Jessie for serving static files, I have a USB drive mounted at /media/storage, with /media/storage/www as my document root and my lighttpd.conf looks like this: server....
Superpelican's user avatar
4 votes
1 answer
22k views

Apache doesn't start: syntax error....DocumentRoot must be a directory

I read all the previous answer but I couldn't fix my problem.. I'm changing the server where my website is hosted and I'm setting again apache.. Now, after installing php, fail2ban, etc i have that ...
Akylle's user avatar
  • 41
4 votes
2 answers
424 views

Apache equivalent of IIS application roots

Someone just set up a directory for me on an Apache server where I will put my PHP application. This directory has an external path of 192.168.1.5/app and points to /home/test/app. My application ...
Maxim Zaslavsky's user avatar
3 votes
3 answers
37k views

How to configure Apache document root?

I am in the process to migrate to a new web server and I would like to have a clean and safe file architecture for apache and my web application. The server will serve one single php/mysql ...
benjisail's user avatar
  • 1,331
3 votes
2 answers
6k views

Symbolic Link & LAMPP htdocs

I went through these steps in order to make a symlink directory to use outside of lampp htdocs. $ mkdir test $ chmod 777 test //test is now in /home/Dropbox/test/ //I put an index.html with 777 perms ...
user1062058's user avatar
3 votes
1 answer
13k views

Nginx - difference between root and alias?

My goal is to have a Laravel installation running alongside a Nuxt application generated as static content. I'd like for Laravel to be available, when the location start with /api. This works as ...
Repox's user avatar
  • 265
3 votes
1 answer
2k views

Is it possible to serve different DocumentRoot from Virtual Host in Apache conf depending on IP of the visitor?

I just wonder if it's possible to define several DocumentRoots for single VirtualHost in httpd.conf and serve them out depending on IP of the visitor?
jayarjo's user avatar
  • 337
2 votes
2 answers
5k views

Can a S3 mount be used as the document root for Apache?

Has anyone been successful in having their DocumentRoot reside on an S3 mount (using s3fs)? I currently have a mounted bucket at /mnt/s3. I can read and write files to it no problem. In my httpd....
Hesse's user avatar
  • 21
2 votes
2 answers
3k views

Apache ErrorDocument script location

Using apache 2.4 on Linux, with several virtual servers, each virtual server with its own DocumentRoot, I would like for the apache main server ErrorDocument local redirect to execute a single perl ...
keith20mm's user avatar
2 votes
1 answer
4k views

Apache Serving Wrong Document Root

I have installed SSL on a subdomain of my site. Everything works perfectly, except this strange behavior. If I point my browser at the following locations, these document roots are served: http://...
Leng's user avatar
  • 125
2 votes
1 answer
228 views

Is there anything wrong with making your documentroot tmpfs, if you've got the ram to spare?

As the title says, it strikes me that if I have an old mason webapp which is basically a few hundred perl scripts and components on disk, would it not run quicker if I made the documentroot a tmpfs? ...
pacifist's user avatar
  • 181
2 votes
4 answers
388 views

Sharing the same document root - except for a folder and a file

I have two websites, websitea and websiteb. I have them both pointing to the same document root and all works fine, however I want websitea to have different db details to websiteb. Database details ...
Wizzard's user avatar
  • 342
2 votes
1 answer
530 views

How to edit files from localhost via lynx?

I want to optimize a site for viewing with lynx. If I view any HTML file from outside of the DocumentRoot, I am able to edit and save these files inside lynx with keystroke e, which invokes vim. ...
John Goofy's user avatar
2 votes
1 answer
691 views

setting documentroot in apache

i've set the documentroot in httpd.conf as: DocumentRoot "C:\Users\user1\Documents\WebProjects" if the files are located in WebProjects, they work; however if i create a sub folder [project] in ...
input's user avatar
  • 123
1 vote
2 answers
1k views

How to use Mod Rewrite to access non-document-root folder files?

I have the following structure for my website codes at /var/www/html -- files ---- test.txt -- app ---- SomePhpCodes.php ---- SomePhpCodes.php -- public ---- index.php ---- .htaccess The document ...
cr001's user avatar
  • 195
1 vote
2 answers
3k views

Testing vhost config

I've been battling to get a vhost config working on an internal development server at work. I have found other vhost configs in the site-available directory. For some reason, I can't see why my new ...
user2108258's user avatar
1 vote
1 answer
6k views

Cant start apache, says html folder not directory

When I attempt to start httpd: [root@cameronaziz www]# service httpd start Starting httpd: Syntax error on line 292 of /etc/httpd/conf/httpd.conf: DocumentRoot must be a directory ...
Cameron Aziz's user avatar
1 vote
1 answer
1k views

Accessing phpmyadmin in Nginx directly from IP address (without a subdomain)

In an Ubuntu 16.04 Nginx environment which has some sites working fine, I've installed phpmyadmin: cd /var/www/html wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.zip find ....
Arcticooling's user avatar
1 vote
4 answers
5k views

Apache 2.4 Virtual host apache.conf 403 permission & 404 document root access errors

I know this questions has been raised before, but I swear I have read through the other posts. I am using virtual hosts on Apache/2.4.7 (Ubuntu) server to host multiple wordpress sites. I have one ...
phillipsk's user avatar
  • 185
1 vote
1 answer
5k views

Mapping different ServerPath to different DocumentRoot with the same address

I am using an Apache server within an intranet to give access to reports. I want, with the same servername, to map a server path to a different documentroot that happens to be a file share. Is this ...
kev's user avatar
  • 11
1 vote
1 answer
3k views

Apache refusing to change DocumentRoot

I've installed Zend Server CE 5.1.0 on Windows 7 Ultimate 64 bit in its default location, meaning the path to my htdocs is C:\Program Files (x86)\Zend\Apache2\htdocs. Not something that I would like ...
mingos's user avatar
  • 157
1 vote
1 answer
4k views

How can I edit an individual site's virtualhost using either WHM or cPanel? [closed]

I've been using Webmin/virtualmin for years. In Webmin, I can edit Apache config files quite easily. For example, if a user wants to change the DocumentRoot because he/she wants to serve up a Ruby on ...
user55578's user avatar
  • 119
1 vote
1 answer
2k views

Apache Redirect without include document root in rewrite rule

I have this working rule: RewriteRule ^(.*)/amp/$ https://example.com/$1?amp=1 [QSA,R=301,NC,NE,L] For redirecting https://example.com/register/amp/ to https://example.com/register?amp=1. And it is ...
shakaran's user avatar
  • 356
1 vote
1 answer
45 views

Apache: why always showing files from the same virtual host?

I have set up 2 virtual hosts, sharing the same IP address: <VirtualHost *> DocumentRoot "/var/www/vhosts/website1.com/httpdocs" ServerName www.website1.com </VirtualHost> ...
Daniele B's user avatar
  • 367
1 vote
1 answer
3k views

DocumentRoot takes one argument, Root directory of the document tree error

Ok so I have this linux OS on my pc xubuntu and the external IP is not working via internal or external network, not working either on my pc. Just says 404 not found. What can I do? this is the 000-...
thebestuser's user avatar
1 vote
1 answer
233 views

Duplicated version of a local (WordPress) site isn't available online in an Nginx environment

In my Ubuntu 16.04 Nginx environment I tried to create an online test version of a local WordPress site. The original site works fine and is accessed in HTTPS (the lock favicon is green in all pages). ...
Arcticooling's user avatar
1 vote
1 answer
6k views

Nginx rewrite root to sub-folder without changing server root

I am trying to move an old app to nginx from apache but I froze on here. The /.htaccess RewriteEngine on RewriteRule ^(.*) public/$1 [L] The /public/.htaccess Options +Indexes +FollowSymLinks -...
dev's user avatar
  • 111
1 vote
2 answers
182 views

I am unable to deny server filesystem access with a custom DocumentRoot in Apache?

CentOS 7.1 - Apache 2.4.6 Default configuration contains the following: .... <Directory /> AllowOverride none Require all denied </Directory> ... DocumentRoot "/var/www/html" If ...
beanaroo's user avatar
  • 113
1 vote
1 answer
2k views

Nginx not making proxy_pass when getting files (other than index.html) from Apache's Document Root

I think I'm chasing my own tail here and I've decided to ask all you gurus. I have two machines, one has a reverse proxy Nginx and the other an Apache running several virtual hosts. The nginx ...
lgg's user avatar
  • 151
1 vote
1 answer
72 views

Accessing site after IP redirect

we are using Apache2 to host multiple sites on one system in our local network. One such site is the following: <VirtualHost *:80> ServerName wiki.idi.local DocumentRoot /srv/dokuwiki/...
Mircea M's user avatar
  • 113
1 vote
2 answers
3k views

Apache2 reverseproxy - How to set a DocumentRoot on the server?

I've configured a reverseproxy with apache2. The reverseproxy configuration looks like this: <VirtualHost *:80> ServerName someserver.com ProxyRequests Off ProxyPass / ...
user3617604's user avatar
1 vote
1 answer
3k views

Apache - how do I create an exception for a vhost's VirtualDocumentRoot in httpd.conf?

I'm new to Apache, and I'm wondering if there's a way to configure VirtualDocumentRoot to create an exception for just one of my vhosts on my local server. Currently all of my sites are stored in ...
luke's user avatar
  • 13
1 vote
2 answers
3k views

XAMPP pointing a file outside root folder [closed]

I am using XAMPP for first time in Mac. Running out problems accessing other than root folder(htdocs).when I am placing my web application inside htdocs with default httpd.conf file it works when I ...
Ravi's user avatar
  • 111
1 vote
1 answer
1k views

setting php.ini to use / for webroot?

New at this, so apologies if I'm not using the correct terminology, but... Locally, in my scripts, I can include scripts using: include('/include/sample.php'); And it will automatically traverse to ...
user87732331989's user avatar
1 vote
1 answer
2k views

ubuntu apache subdomains pointing to main domain

I have a ubuntu server with apache setup, the main domain on the server is a subdomain app.example.com, which is working fine. Now if I setup john.app.example.com, then that also is displaying the ...
Suhail Thakur's user avatar
1 vote
1 answer
3k views

DocumentRoot and htaccess files

I have a muluitple vhosts set up all with the same DocumentRoot pointing to a common set of files, I have set up AliasMatch for for the bespoke files on each site, I was wondering if I can have a ....
icelizard's user avatar
  • 732
1 vote
1 answer
114 views

Apache 2.4: owncloud in sub-directory outside of DocumentRoot

I am working on moving current setup of owncloud from sub-domain https://cloud.example.com to sub-directory https://example.com/cloud to make all my apps covered by one SSL certificate. The problem is ...
Green Root's user avatar
1 vote
1 answer
523 views

Redirect to folder only if root from other site referrer

I have a redirect from root to subfolder. If user visits https://example.com it redirects to https://example.com/subfolder. But I want it not to redirect if referrer is my site, so user can reach root ...
Stas Ponomaryov's user avatar
1 vote
1 answer
178 views

WIldcard SSL Subdomain Not Pointing at Correct DocumentRoot 3

I have the same problem than: WIldcard SSL Subdomain Not Pointing at Correct DocumentRoot but the answer does not help me. I have a Wildcard SSL installed on my Apache server. With HTTP : www....
Bruno de Goyrans's user avatar
1 vote
0 answers
77 views

set document root for external calls

I'm using mod_userdir to set my document root to /home/user/server/public_html/ I also setup a virtual host that will redirect for the ServerName domain.com to /home/user/server/public_html/domain....
steros's user avatar
  • 121