Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hendry007 opened this issue Jun 16, 2019 · 11 comments
Labels

Comments

@hendry007
Copy link

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

what i will do?

@tankerkiller125
Copy link

You need to point Nginx or Apache to the /your/path/to/snip-it/public directory instead of /your/path/to/snipe-it

@hendry007
Copy link
Author

I already done this.but it showing the same error

@tankerkiller125
Copy link

Restart Nginx or Apache? This is the only thing I can think of that would cause this error. The file that displays this error is only located at the root directory. The public directory would show an actual error if it wasn't working properly (from experience anyways)

@stale
Copy link

stale bot commented Aug 15, 2019

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

@stale stale bot added the stale label Aug 15, 2019
@stale
Copy link

stale bot commented Aug 22, 2019

This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.

@stale stale bot closed this as completed Aug 22, 2019
@gablex
Copy link

gablex commented Apr 4, 2020

Is this issue really sorted? I have tried what is recommended above without success

@tankerkiller125
Copy link

tankerkiller125 commented Apr 4, 2020

This is a configuration error by end users, not an issue with flarum itself. So long as https://flarum.org/docs/install.html is followed carefully this issue should not happen. If you need further support with this I recommend asking on our discord support channel https://discord.gg/H8Z2GJZ for faster more realtime support.

Discord
Check out the Flarum community on Discord - hang out with 3,792 other members and enjoy free voice and text chat.

@mazenitv
Copy link

mazenitv commented Dec 8, 2020

Hi, I'm trying to get snipe-it to work on macos using xamp.
I should have setup everything properly my vhosts files my hosts file, mod_rewrite is enabled but i'm still getting the same message.
---http-vhosts.conf

<VirtualHost *:8888>
ServerName localhost
DocumentRoot "/opt/lamp/htdocs"
<Directory "/opt/lamp/htdocs">
ServerSignature Off
Options Indexes FollowSymLinks IncludesNoExec
AllowOverride All
Require all granted

ErrorLog "logs/localhost-error_log"

<VirtualHost *:8888>
ServerName local.it
DocumentRoot "/opt/lamp/htdocs/it/public/"
<Directory "/opt/lamp/htdocs/it/public/">
Options Indexes FollowSymLinks Includes execCGI
AllowOverride None
Require all granted

<VirtualHost *:8888>
ServerName localhost/it
DocumentRoot "/opt/lamp/htdocs/it/public/"
<Directory "/opt/lamp/htdocs/it/public/">
ServerSignature Off
Options Indexes FollowSymLinks IncludesNoExec
AllowOverride All
Require all granted

ErrorLog "logs/it.dev-error_log"

---hosts file
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 localhost/it
127.0.0.1 local.it

visiting http://localhost:8888/it/ gives me the message: D'oh. If you're seeing this, your DocumentRoot is set incorrectly. It should be set to the public directory.

and visiting http://local.it/ takes me to the xamp dashboard.

where am i going wrong?

@stylish187
Copy link

I have not found a clear solution to this issue, can this please be re-opened.

@snipe
Copy link
Owner

snipe commented Apr 8, 2021

No - it’s not an issue with Snipe-IT. It’s a server config. Make the public directory your document root in the web server. That’s the solution. The error is telling you how to fix it.

@jshrek
Copy link

jshrek commented Feb 26, 2022

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants