Questions tagged [documentroot]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
119 views

Apache2 returns 403 for static file request on root

On my new Apache/2.4.52 (Ubuntu) Server installation, the SSL configuration in general runs well, having Tomcat apps proxied and working. Still, the static file configuration for root does not work. ...
philburns's user avatar
  • 101
0 votes
0 answers
76 views

Secure location of PHP files used in LAMP stack

I'm setting up a LAMP stack on Ubuntu 20.04, and had this recent discussion with a colleague about the fact that it's better to not keep the PHP scripts of all of your stack (classes, API Controllers ...
DevelJoe's user avatar
  • 187
1 vote
1 answer
129 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
553 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
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
0 votes
0 answers
1k views

Apache2 alias loading from document root instead of alias directory

I have problem with apache2. I'm new to it and I'm trying to solve some problems. I have a server running debian with apache2.4 installed and 3 web-site running. A Shiny Server, a django website and a ...
MarkPT's user avatar
  • 1
3 votes
1 answer
14k 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
0 votes
2 answers
524 views

Limit documentroot on SFTP with SSHD

I use proFTPD on debian 8. For some reasons i need users that can only access to their documentroot. I already configured this and it works but only when i connect in FTP. If the user connect on SFTP,...
Matancy's user avatar
  • 105
0 votes
1 answer
181 views

can I configure Nginx to enable HTTP in a documentRoot and HTTPS in another documentRoot? [closed]

I have SSL enabled via certBot and reversing proxy for my Node-js and everything works fine if my clients request to https://example.com/ they will see my web site under /var/www/html/ Document Root ...
Mahdi's user avatar
  • 1
0 votes
0 answers
386 views

Apache If Else documentroot

I want to change the Apache DocumentRoot setting depending on what IP address is accessing the server. I have added this code to the vhost.conf file but Apache always accepts the last declaration of ...
Juan Cullen's user avatar
2 votes
1 answer
597 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
-1 votes
1 answer
225 views

Why html output aborts before the php code execution?

I have a file named x.php in /var/www/html that looks like <html> <head> <title>-_-</title> </head> <body> <h1>Table</h1> <?php mysqli_report(...
John Goofy's user avatar
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
0 votes
1 answer
851 views

AWS eb deploy Changes httpd.conf Virtual Hosts Document Root

I run an AWS ElasicBeanstalk Apache server. There is a subdomain with a different DocumentRoot (see below). When I use eb deploy and then ssh into the machine to manually change the /etc/http/conf/...
mo_st's user avatar
  • 39
0 votes
0 answers
119 views

Apache2 docroot and the directory directive in apache2.conf

Why is in standard apache2.conf only the container directive <Directory /var/www/> instead of the docroot <Directory /var/www/html>? I have the following release: $ lsb_release -a No LSB ...
John Goofy's user avatar
0 votes
1 answer
2k views

Is it a good idea to put shared files outside public_html / root? [closed]

I just figured out that I can place files outside the domain root (outside public_html). The benefit of placing functions outside the domain root is that I can use the same file on multiple domains. ...
Jens Törnell's user avatar
1 vote
1 answer
48 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
0 votes
2 answers
1k views

Apache serve specific documentroot on IP:PORT

I want to serve a specific documentroot on port 8000 I tried creating a .conf file in /etc/httpd/conf.d: Listen 8000 <VirtualHost *:8000> DocumentRoot "/newwebroot" </VirtualHost> ...
Misterr Moron's user avatar
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
2k 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
1 answer
238 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
0 votes
1 answer
729 views

How to configure nginx to serve one site from two different document root and using different php depending on URL

I'm trying to configure nginx to use two different document root depending on url, so if some one connects to www.example.com will get site from /portal/public_html but if client connect to www....
B14D3's user avatar
  • 5,258
0 votes
1 answer
269 views

Varnish and Apache Document Root

I've inherited a system with a Debian 8 with an Apache installed and multiple VirtualHosts. In my 000-default.conf file I've got /var/www/ as document root, not /var/www/html and I can't found ...
Jon Zangitu's user avatar
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
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 votes
2 answers
515 views

nginx 1.8.0 ssl configuration root location behaving unexpectedly

I bump into this problem. I recently install nginx 1.8+ on a centos 6.7 along with PHP-FPM (5.3+). The installation was fine and setting up the virtual host was okay too but when I create a secure ...
Jeo's user avatar
  • 101
0 votes
2 answers
14k views

SSL on apache; the requested URL was not found

I am setting up SSL on my Apache/2.4.6 RHEL server. In httpd.conf, have VirtualHosts as shown below... <VirtualHost *:80> ServerName foo.bar Redirect permanent / https://foo.bar </...
Jon Snow's user avatar
1 vote
2 answers
194 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
0 votes
1 answer
10k views

HAProxy - backend with subdirectory

I have simple haproxy configuration: two servers, one is frontend, two is backend with jboss application. Here is config: defaults mode http log global ...
QkiZ's user avatar
  • 692
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
17 votes
8 answers
60k 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
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
179 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
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
-2 votes
2 answers
16k views

How to whitelist a directory in apache [closed]

Files that I want to serve via browser are located at /root/my_folder (ubuntu 14.04). I changed a path from /var/www/html to /root/my_folder in /etc/apache2/sites-available/000-default.conf, after ...
qwaz's user avatar
  • 105
4 votes
3 answers
29k 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
1 vote
1 answer
73 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
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
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
-4 votes
2 answers
1k views

how can i access a directory from network in apache using httpd.conf [closed]

I want apache to access a location which is in network that means instead of specifying a DocumentRoot from withing the server(mine is centos) i want the apache to access a directory which is on ...
user216476's user avatar
0 votes
1 answer
772 views

Apache Adding DocumentRoot to URL when www not used - could be rewrite issue

When I visit www.mysite.com all is well. When I visit mysite.com (without the www) I get redirected to http://www.mysite.com/home/admin/domains/mysite.com/public_html which gives a 404 error. /home/...
HighlandGuy's user avatar
4 votes
1 answer
23k 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
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
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
0 votes
1 answer
58 views

Set up instance of Drupal website on fresh Ubuntu server?

I am a brand new to Drupal...and web programming, for that matter. I have set up an Ubuntu 12.10 server, installed Apache, and installed Drupal 7.24 (all through bash...I am working from the server ...
robinSparkles's user avatar
0 votes
1 answer
384 views

Apache Virtual host (SSL) Doc Root issue

I am having issues with the SSL document root of my vhosts configuration. Http sees to work fine and navigates to the root directory and publishes the page fine - DocumentRoot /var/www/html/websites/...
user avatar
0 votes
1 answer
3k views

DocumentRoot Directory Apache httpd

I want to make changes over my httpd.conf file of Apache running in Windows, but I want to know why need to use (or declare) the same root twice. DocumentRoot "C:/Apache/htdocs" <Directory /> ...
Luigi Giuseppe's user avatar
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
-1 votes
3 answers
284 views

Is there a DocumentRoot naming convention and why do some suggest /var/www/example.com over /var/www/example [closed]

As the title suggest, I was wondering if there is a technical reason behind naming a web application's documentroot with the domain name? From my limited experience, it seems that including the domain ...
Michael Markieta's user avatar
1 vote
1 answer
2k views

Why can't I change document root in apache without error?

I'm trying to change my document root in apache so I can start a new project and keep an old one available so I can reference the files. Whenever I try to change the document root, though, I get a 403 ...
David's user avatar
  • 11