snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.1k stars 3.18k forks source link

Gives an error D'oh. If you're seeing this, your DocumentRoot is set incorrectly. It should be set to thepublic directory. #2626

Closed umeshpoman closed 8 years ago

umeshpoman commented 8 years ago

"D'oh. If you're seeing this, your DocumentRoot is set incorrectly. It should be set to thepublic directory."

what is the solution for it.

snipe commented 8 years ago

Set your DocumentRoot to the public directory, as it says.

ahmadabudawod commented 8 years ago

Where i can change DocumentRoot ?

snipe commented 8 years ago

Apache virtual host config.

ahmadabudawod commented 8 years ago

i have change Apache virtual but still have the same message.Could you please give me steps regarding to this problem

snipe commented 8 years ago

Did you restart apache after changing the config?

ahmadabudawod commented 8 years ago

Yes i have restart the Apache

snipe commented 8 years ago

Without seeing your apache configuration file, I'm not sure what else we can do for you here. The DocumentRoot is not correct, or you wouldn't be seeing that.

Nawdiral commented 7 years ago

Hello Snipe, I know you had been asked this over and over, but for beginners, this is not clear as you would guess, instead and we would mess up the server's existing config. Before I start any new installation I make sure to read the documentation which I find very clear and rich, my interest to use Snipe IT came after trying the demo and now I'd really like to get it working in my wampx64 server, unfortunatelly I also get the same error as many people before me. I appreciate your hard work and time dedication in this project, but I think a simple how to to solve this issue would be more helpful than just saying what the error is already saying, I ve spent many hours just to get rid of this error, in vain. Any help would be welcomed, many thanks in advance.

ghost commented 7 years ago

If you can wait until Monday, I may be able to help. I have successfully installed SnipeIT using wamp64

James

Get Outlook for iOShttps://aka.ms/o0ukef


From: Nawdiral notifications@github.com Sent: Saturday, January 14, 2017 8:38:24 PM To: snipe/snipe-it Cc: Subscribed Subject: Re: [snipe/snipe-it] Gives an error D'oh. If you're seeing this, your DocumentRoot is set incorrectly. It should be set to thepublic directory. (#2626)

Hello Snipe, I know you had been asked this over and over, but for beginners, this is not clear as you would guess, instead and we would mess up the server's existing config. Before I start any new installation I make sure to read the documentation which I find very clear and rich, my interest to use Snipe IT came after trying the demo and now I'd really like to get it working in my wampx64 server, unfortunatelly I also get the same error as many people before me. I appreciate your hard work and time dedication in this project, but I think a simple how to to solve this issue would be more helpful than just saying what the error is already saying, I ve spent many hours just to get rid of this error, in vain. Any help would be welcomed, many thanks in advance.

- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/snipe/snipe-it/issues/2626#issuecomment-272667053, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ATocGZXFFyiyVqsRsXB9u8esYJSRAbhdks5rSXiPgaJpZM4J_kV7.

Nawdiral commented 7 years ago

@jmathias59 Yes, I can wait, can't wait for Monday :) Thanks James

Nawdiral commented 7 years ago

Hello @jmathias59 @snipe I managed to get it working, many thanks :)

breaker84 commented 7 years ago

Would you like to share how to manage it?

Nawdiral commented 7 years ago

@breaker84 you should start from here: https://snipe-it.readme.io/docs/wamp, works the same for WAMP X64

vitorneto commented 6 years ago

hi ghost can you help too

josephsmartinez commented 6 years ago

@snipe (updated 12:13pm est) The following is on a CentOS server. I am getting the same error. D'oh. If you're seeing this, your DocumentRoot is set incorrectly.

Here is the DocumentRoot from our end:

<VirtualHost :80> Redirect permanent / https://app.something.com/ <VirtualHost :80> ServerAdmin app.something.com <Directory /var/www/html/snipeit/public> Require all granted AllowOverride All DocumentRoot /var/www/html/snipeit/public ServerName app.something.com

The file path is as follows:

/var/www/html/snipeit/public

is this correct? LMK. We plan to restart the http service at 5pm, so I'll follow up.

THANK YOU!!!!

JOE

StevenJohnson1214 commented 6 years ago

Why not just add the following lines of code to the index.html: <meta http-equiv="refresh" content="0; url=./public">

In the <Body> or the <Head>. Ideally it should pick it up anywhere, but those are the known working places.

This will just do a simple meta refresh from domain.com/snipe-it/ to domain.com/snipe-it/public

snipe commented 6 years ago

Because if you can see that page, your app is configured incorrectly. We want to make that as obvious as possible, instead of trying to shim around it.

baloy4 commented 5 years ago

Good day! I have the same error, I don't have much experience with programming or web-dev, I downloaded the .zip source code from https://github.com/snipe/snipe-it/releases/tag/v4.6.15 unzipped it on my computer (Windows) and uploaded all the files to our Windows webhosting server (MDDHosting). Tried to search and read documentation and user manual about installation and what's next, and I don't get everything. Sorry :(

Saw the same error message when I accessed index.html. What file from the unzipped files should I access/run from my browser? I'm a noob with this kind of application, I'm sorry if I'm asking too much, like step-by-step guide after unzipping everything. Please help!

GitHub
snipe/snipe-it
A free open source IT asset/license management system - snipe/snipe-it
baloy4 commented 5 years ago

Please disregard my previous message. Used WAMP server on my Windows 10 laptop, now I'm stuck after editing and saving .env.example to .env and followed this:

Open command prompt then change directory to c:\wamp\www\snipe-it\ (mine was in D:). Then run: composer install --no-dev --prefer-source

Saw some errors regarding "Git" not recognized, I didn't know I have to install it. Installed Git, then re-run "composer install --no-dev --prefer-source again, and received the following:

D:\wamp64\www\snipe-it>composer install --no-dev --prefer-source Loading composer repositories with package information Installing dependencies from lock file Nothing to install or update Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead. Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump

Parse error: syntax error, unexpected '=' in D:\wamp64\www\snipe-it\vendor\laravel\framework\src\Illuminate\Support\Arr.php on line 388

D:\wamp64\www\snipe-it>php artisan key:generate

Parse error: syntax error, unexpected '=' in D:\wamp64\www\snipe-it\vendor\laravel\framework\src\Illuminate\Support\Arr.php on line 388

Please help! Tia!

StevenJohnson1214 commented 5 years ago

I'm not really the best source of information to help you, but I'll share my experiences in hopes they may help you find your answer or at least help you rule some things out...

I remember seeing similar errors to that when I was trying to Update my version of SnipeIT. I'm running Webuzo (Similar to Cpanel) on Ubuntu Server.

Since Webuzo ran it's own LEMP stack separate from the LAMP stack for all of my websites and domains... The problem I ran into was when executing php commands on the system, the system was using the unsupported php version supplied in Webuzo's LEMP Stack, not the version I needed it to be which was being used in my websites LAMP stack.

So, to summarize, the system was running 2 different versions of php and was defaulting to the unsupported version. My work around for upgrading is to replace: "php" with "/usr/local/apps/php72/bin/php" in the upgrade.php file. Then everything works as expected.

So, my question would be what version of PHP are you running? Are you certain other versions aren't running on the system? I believe 7.2.X is the recommended version.

`root@webserver:/$ php -v PHP 7.0.33-0ubuntu0.16.04.4 (cli) ( NTS )

root@webserver:/$ /usr/local/apps/php72/bin/php -v PHP 7.2.16 (cli) (built: Mar 8 2019 16:53:21) ( NTS ) `

Not 100% how this works/looks on windows. Hope this helps, let me know if I can translate any further. And again, this information could be completely irrelevant.

snipe commented 5 years ago

Hi @baloy4. Please create a new issue and fill in all of the questions in the new issue form. (When you reply to old, closed threads, it sends an email notification to everyone who ever participated in it, which can be pretty annoying to have happen on a thread that's been resolved for a while.)

We'd need to know more about your environment to know why you're seeing that error. My guess would be that your version of PHP (either web server or cli versions, or possibly both) doesn't meet the requirements (PHP >= 5.6.4, PHP < 7.3)

baloy4 commented 5 years ago

Hi Steven,

I already tried switching versions of PHP, no luck. Here's a screenshot:

image

baloy4 commented 5 years ago

The default after Wamp installation is 7.3.1 if I'm not mistaken, then I read the compatible version the other day, so I tried to change the version down to 7.2, tried 7.1 as well, and now it's at 7.0.33. Restarted Wamp services after every changes, I even restarted my laptop, just to be sure.

baloy4 commented 5 years ago

Oops, just saw there's a PHP error on my screenshot I gave you on the lower right. I clicked on it and it says:

image

snipe commented 5 years ago

Hi @baloy4.

I am not Steven.

As requested before, please create a new issue and fill in all of the questions in the new issue form. (When you reply to old, closed threads, it sends an email notification to everyone who ever participated in it, which can be pretty annoying to have happen on a thread that's been resolved for a while.)

tuanlt79 commented 4 years ago

Hi all, I run snipe-it docker. what is the solution for it.

"D'oh. If you're seeing this, your DocumentRoot is set incorrectly. It should be set to the public directory."

I install LAMP, docker-compose.

wyount commented 4 years ago

There are two ways to do this. You can use separate virtual host files if you are using two separate domains. You will see a lot of examples out there for this. Each domain can only have one document root. so you have to create a separate virtual host conf file for each domain and point it at the correct document root. This works great if you are setting up a domain just for snipe-IT, such as www.mysnipeIT.com.

Most of us are not going to go to all that trouble. So you have just one domain? You can add an alias in your /etc/apache2/sites-available/000-default.conf file. Something like this:

Alias /inventory /var/www/html/inventory/public
               <Directory /var/www/html/inventory/public>
                    Options MultiViews Indexes Includes FollowSymLinks ExecCGI
                    AllowOverride All
                    Require all granted
                    allow from all
                </Directory>

Where /inventory is the directory you will include in the URL to access the site and /var/www/html/inventory is where you copied the snipe-IT files. I will assume you are doing this on your local desktop machine. Anytime you go to localhost/inventory in your web-browser, it will point you to a directory of your choosing.

However, when I go to http://localhost/inventory I get HTTP error 500. I was able to test that this is working correctly by pointing /inventory back to my apache root and my page came up.

Alias /inventory /var/www/html
               <Directory /var/www/html>
                    Options MultiViews Indexes Includes FollowSymLinks ExecCGI
                    AllowOverride All
                    Require all granted
                    allow from all
                </Directory>

I don't know what is specifically wrong with snipe-IT.

thomasdp commented 3 years ago

For windows and IIS Modify the BASIC SETTINGS and WEBSITE BINDINGS. If you only have one website, you will probably just want to edit the BASIC SETTINCGS for the DEFAULT WEBSITE:

Open IIS Manager Click on Default Web Site Under Actions (right hand side), select Basic Settings Edit Physical Location.

jshrek commented 2 years ago

I found the following solution that worked for me... modifying the .htaccess file instead:

Here is the .htaccess file with the modified rewrite lines near the end. Note that I figured this out from FreeScout which uses laravel and the public directory as well.

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    # Make sure .env files not not browseable if in a sub-directory.
    <FilesMatch "\.env$">
       # Apache 2.2
       <IfModule !authz_core_module>
          Deny from all
       </IfModule>

       # Apache 2.4+
       <IfModule authz_core_module>
          Require all denied
       </IfModule>
    </FilesMatch>

    # MOD starts here (taken from FreeScout htaccess file)
    # add these two lines:
       RewriteEngine on
       RewriteRule (.*) public/$1 [L]
    # MOD ends here

</IfModule>