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

Snipe-It Installation on IIS (confusing at best) #2883

Closed
brudnicke opened this issue Nov 4, 2016 · 65 comments
Closed

Snipe-It Installation on IIS (confusing at best) #2883

brudnicke opened this issue Nov 4, 2016 · 65 comments

Comments

@brudnicke
Copy link

Is there a clear, concise, step by step install guide for making Snipe-It work on Windows Server 2012 using IIS? I'm finding bits and pieces here, but they are referencing PHP, database, etc, and no where does it show where I get these programs, what versions, when/where to install.

The IIS setup document only tells me how to create the site, and adjust permissions. The dependencies page only states to download and run composer from the snipe-it directory. That program is asking for some type of PHP command.

@JExactly
Copy link

JExactly commented Nov 4, 2016

@brudnicke you need to install PHP and a database app. These can be installed in IIS from the Micorsoft Web Platform (https://www.microsoft.com/web/downloads/platform.aspx) Install the platform installer so that you can add PHP (PHP 7 should work fine), MySQL 5.5 etc.. additionally, once PHP is installed, you will have PHP Manager appear in your IIS Manager, You can enable there as well as enable additional PHP extensions that are needed as referenced in the install guide.

Hope this helps!

@brudnicke
Copy link
Author

Thanks for the information. Was able to find the step by step requirements. However, when i try to access the site, it doesn't come up. Standard "The website cannot display the page". I've restarted IIS, and the server, but with no luck.

@JExactly
Copy link

JExactly commented Nov 9, 2016

Did you make sure to apply your hostname to the .env file you are accessing from. Also, did you make sure you added a DNS record as well for your server in your DNS entries?
Additionally make sure you set your bind address to the IP for your host server in IIS

@brudnicke
Copy link
Author

Not sure where I put a host name in the .env file. Not seeing a reference to it. As for DNS, I’ve created a record “snipeit” pointing to 10.10.199.12 (IP of website). I’ve tried accessing the site at http://10.10.199.12 and http://snipeit , but each of them comes up with HTTP ERROR 500.

When I added the hostname snipeit.corp.domain.com to the bindings, when I try to hit the website, it brings up the generic IIS page.

Here is the .env file:

--------------------------------------------

REQUIRED: BASIC APP SETTINGS

--------------------------------------------

APP_ENV=production
APP_DEBUG=false
APP_KEY=ChangeMe
APP_URL=null
APP_TIMEZONE='UTC'
APP_LOCALE=en

--------------------------------------------

REQUIRED: DATABASE SETTINGS

--------------------------------------------

DB_CONNECTION=mysql
DB_HOST=localhost
DB_DATABASE=null
DB_USERNAME=root
DB_PASSWORD=password
DB_PREFIX=null
DB_DUMP_PATH='C:\PROGRA1\MARIAD10.1\bin'

--------------------------------------------

REQUIRED: OUTGOING MAIL SERVER SETTINGS

--------------------------------------------

MAIL_DRIVER=smtp
MAIL_HOST=10.10.199.70
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDR=ithelpdesk@domain.com
MAIL_FROM_NAME='Snipe-IT'
MAIL_REPLYTO_ADDR=ithelpdesk@domain.com
MAIL_REPLYTO_NAME='Snipe-IT'

--------------------------------------------

REQUIRED: IMAGE LIBRARY

This should be gd or imagick

--------------------------------------------

IMAGE_LIB=gd

--------------------------------------------

OPTIONAL: SESSION SETTINGS

--------------------------------------------

SESSION_LIFETIME=12000
EXPIRE_ON_CLOSE=false
ENCRYPT=false
COOKIE_NAME=snipeit_session
COOKIE_DOMAIN=null
SECURE_COOKIES=false

--------------------------------------------

OPTIONAL: CACHE SETTINGS

--------------------------------------------

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

--------------------------------------------

OPTIONAL: AWS S3 SETTINGS

--------------------------------------------

AWS_SECRET=null
AWS_KEY=null
AWS_REGION=null
AWS_BUCKET=null

--------------------------------------------

OPTIONAL: MISC

--------------------------------------------

APP_LOG=single
APP_LOCKED=false
FILESYSTEM_DISK=local
APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1
ALLOW_IFRAMING=false

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

JExactly commented Nov 9, 2016

  1. Make sure to apply your hostname(APP_URL=yourhostname.com) in the .env file.

2.) Make sure you added a DNS record as well for your server in your DNS entries.

Additionally make sure you set your bind address to the IP for your host server in IIS.

One other thing. Make sure you have assigned the proper permissions as noted on this page for all the correct folders listed. https://snipe-it.readme.io/v3.0/docs/windowsiis

@brudnicke
Copy link
Author

  1.    I’ve added the hostname per instructions.  I’ve also setup the hostname in DNS, and checked that it’s resolving correctly.  I edited the bindings on IIS, and set the host name.  Bind is set to the IP address on the servers second network card.  I’ve verified the permissions on all the folders as suggested in the document url provided.
    

Site won’t respond.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

JExactly commented Nov 9, 2016

after you made all changes. did you restart IIS? or at leaset restart the single site in IIS

@brudnicke
Copy link
Author

Yes. Using the IISRESET command.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@brudnicke
Copy link
Author

Not sure if this makes a difference, but I ran the php artisan key:generate command, but the key is still set to ChangeMe in the .env file.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

JExactly commented Nov 9, 2016

that makes a big difference. Yes, that key is important. You have created a copy of .env.example and made your changes and saved it as .env only correct? You should also be able to take the appkey and manually add it to your .env file. I would restart your site after that.

@brudnicke
Copy link
Author

Yes. I’m working with a .env file. I’m using Notepad+++ to edit and save it.

Does it store the key somewhere after you run the command. I enter the command, and it just goes right back to a command promp.t

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

JExactly commented Nov 9, 2016

Yes, it is supposed to write the key automatically to the .env file. Are you running php artisan key:generate in the command prompt while inside of your snipeit directory?

@brudnicke
Copy link
Author

Yes. Should it be run from an elevated command prompt?

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

JExactly commented Nov 9, 2016

I would, to make sure you have write access to the directory when the command is run.

@brudnicke
Copy link
Author

I tried using the elevated command prompt, but it did not change the file.

I confirmed the security again. The file also has everyone with full control.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

JExactly commented Nov 9, 2016

manually copy the key it generates on the screen to the .env save and restart IIS

@brudnicke
Copy link
Author

It’s not generating a key (at least it’s not displaying one on the screen).

From: JExactly [mailto:notifications@github.com]
Sent: Wednesday, November 09, 2016 2:17 PM
To: snipe/snipe-it
Cc: Brian Rudnicke; Mention
Subject: Re: [snipe/snipe-it] Snipe-It Installation on IIS (confusing at best) (#2883)

manually copy the key it generates on the screen to the .env save and restart IIS


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/2883#issuecomment-259515012, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AWLwtrafc7jJgYqHIldHFK_hctw4HpJsks5q8ipBgaJpZM4Kpjlt.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

JExactly commented Nov 9, 2016

I am currently out of ideas, Maybe someone else has some additional ideas

@snipe
Copy link
Owner

snipe commented Nov 10, 2016

If it's not displaying a key, something else is wrong. Check your laravel log file after you run the key generation and see if anything shows up

@JExactly
Copy link

@snipe Maybe he didn't get composer installed properly and he is missing some dependencies?

@brudnicke
Copy link
Author

Where is the laravel log located?

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

@brudnicke the laravel log is located in /inetpub/www/%yoursnipeitdirectory%/storage/logs.

i was wondering, did you get composer installed in your snipe-it directory and run the composer commands to install all the dependencies?

@brudnicke
Copy link
Author

There is no log there.

I did download and run composer from the snipe-it directory. It went through something (no prompts) and then it was finished.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

Open an administrative command prompt, navigate into your snipe-it directory and run this command: composer install --no-dev --prefer-source once that run, it will install all your dependencies

@brudnicke
Copy link
Author

Result output:

E:\Sites\Snipe-It>composer install --no-dev --prefer-source
Loading composer repositories with package information
Installing dependencies from lock file
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for intervention/image 2.3.x-dev -> satisfiable by in
tervention/image[2.3.x-dev].
- intervention/image 2.3.x-dev requires ext-fileinfo * -> the requested PHP
extension fileinfo is missing from your system.
Problem 2
- Installation request for intervention/image dev-master -> satisfiable by i
ntervention/image[dev-master].
- intervention/image dev-master requires ext-fileinfo * -> the requested PHP
extension fileinfo is missing from your system.

To enable extensions, verify that they are enabled in those .ini files:
- C:\Program Files (x86)\PHP\v7.0\php.ini
You can also run php --ini inside terminal to see which files are used by PH
P in CLI mode.

E:\Sites\Snipe-It>

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

You need to make sure any extensions that are required are enabled.
looks like it's only missing PHP fileinfo extension.

Open IIS Manager, open up PHP Manager. Under PHP Extensions, enable php_fileinfo.dll. restart IIS for safe measure, rerun the command again.

You need to make sure all PHP extensions that are required are installed and enabled. These were listed under requirements in the hlp documentation here: https://snipe-it.readme.io/docs/requirements
That lists all required PHP extensions that need to be enabled. Also, enable php_gd2, this is the GD Library exttension that is needed as well.

Enable all required that are not already while you are in there, enabling fileinfo.

@brudnicke
Copy link
Author

Lots of progress. Thanks. The extensions in question are installed. I was able to generate a key and it was placed in the .env file.

When I try to hit the site now, it come ups to /setup with the error 404 – Directory Not Found.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

did you make sure to set your directory permissions for IIS as documented here: https://snipe-it.readme.io/v3.0/docs/windowsiis ?

@JExactly
Copy link

Additionally, Make sure that under your sites Advanced settings in IIS, that your public directory is your physical path for exaple: C:\inetpub\wwwroot%snipeitdirectory%\public

@brudnicke
Copy link
Author

Yes. I just re-verified, and the permissions are set as specified in that article.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

you have to remove the entry that has the issue. it doesn't apply to IIS AFAIK

@brudnicke
Copy link
Author

It doesn’t identify the offending string.

Options -MultiViews
# Make sure .env files not not browseable if in a sub-directory.
<FilesMatch "\.env$">
Deny from all
</FilesMatch>

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

in the file I attached, I have removed the string already.

@brudnicke
Copy link
Author

Apologies. I didn’t see the attachment. I downloaded and tried to import, but I received same data error.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

JExactly commented Nov 10, 2016

all you should have in the .htaccess is

`

Options -MultiViews

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

`
I just tested this on my IIS server and I was able to import the file I uploaded without issue.

@brudnicke
Copy link
Author

In the Rewrite Rules box:

Options -MultiViews

Make sure .env files not not browseable if in a sub-directory.

<FilesMatch ".env$">
Deny from all

Still unable to save. Same data error.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

Were you able to successfully get this up and going?

@brudnicke
Copy link
Author

Not yet. I haven’t been able to get the modified .htaccess to import in to IIS. It keeps giving me that invalid data error.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

You know, I totally forgot after V3 you no longer need to import the .htaccess as it is all handled with the web.config file in the public directory. I wouldn't worry about importing the url rewrite rules. However, as long as URL Rewrite is a component listed in you site components.. You should be good. The issue seems to me then would be that your default Physical path under your sites advanced settings is not set correctly.. for example: C:\inetpub\wwwroot\SNIPE-IT\public

image

@brudnicke
Copy link
Author

My physical path is pointing to E:\Sites\Snipe-It\public (which is where the public folder is located). NOTE: There is no setup directory located under Public.

When opening the website, I get:

[cid:image001.png@01D23E7A.CAA21DC0]

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

Maybe @snipe has a better answer. I am sure there is no \setup directory because URL Rewrite handles the rewrite to the correct location for the setup.

@JExactly
Copy link

Also, I think what I would reccommend is that your remove and re-add proper permissions for the folders and restart your IIS server and see if anything changes. As well as make sure that your .ENV file has all it's proper settings and that your mysql user has proper rights to make changes to your database

@brudnicke
Copy link
Author

What should be in the web.config file? The one I have is blank.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

web.zip

@brudnicke
Copy link
Author

Thanks. The website came up to the config page. It seems to have passed all the checks, but when I click create database tables, it goes to a “Whoops, something went wrong” page.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

I would check your laravel logs now

@JExactly
Copy link

Sounds like your database user doesn't have rights to do what it needs to the snipeit database you created.
https://snipe-it.readme.io/v3.0/docs/creating-a-database-and-db-user

@JExactly
Copy link

Were you able to resolve this @brudnicke ??

@brudnicke
Copy link
Author

No. I’ve gone through the permissions again, and checked the database settings, but it still won’t let me continue on to the ‘configure tables’ portion of setup.

From: JExactly [mailto:notifications@github.com]
Sent: Wednesday, November 16, 2016 4:56 PM
To: snipe/snipe-it
Cc: Brian Rudnicke; Mention
Subject: Re: [snipe/snipe-it] Snipe-It Installation on IIS (confusing at best) (#2883)

Were you able to resolve this @brudnickehttps://github.com/brudnicke ??


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/2883#issuecomment-261099704, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AWLwthsAx0INiGwp6elL-CyeD7sVjinjks5q-4oUgaJpZM4Kpjlt.

The information including any attachments contained in this document is confidential and is for the use only of the intended recipient. If you are not the intended recipient, you should notify the sender and delete this message immediately. Any distribution, disclosure, or copying of this message, or the taking of any action based on its contents is strictly prohibited.

Birkey’s Farm Store, Inc.

@JExactly
Copy link

I would check your logs and drop them here

@seanandcara
Copy link

@brudnicke, it sounds like @JExactly is correct that your database user might not have permissions to create the tables. Hopefully, this is resolved and you're using Snipe-IT successfully.

However, if not I may be able to help. At this stage of the install process, a co-worker and I were having all sorts of problems with the URL Rewrite rules:

  1. There were already URL Rewrite rules before importing the .htaccess rules, so we cleared those out.
  2. After attempting to import the .htaccess file, the last rule was not able to be understood by IIS - per the developer, I removed the last rule (see Error in importing Rules thru URL Rewrite #2489).
  3. After fighting with it for a while longer, we also figured out that the first rule was forcing HTTPS, so either you can remove that rule or set up SSL on your server (we chose the latter).

I'll attach the Windows Server/IIS install instructions that I made while going through this process. We have been using Snipe-IT successfully for a few months now and I've used the process on multiple test servers, so I think it's ready to be shared - I hope you find it helpful.

Snipe-IT Install Instructions on IIS - SHARE.pdf

@JExactly
Copy link

JExactly commented Dec 5, 2016

Nothing is attached, You will likely have to do it through the web.

@brudnicke
Copy link
Author

Here is the laravel log.

laravel.TXT

@JExactly
Copy link

JExactly commented Dec 5, 2016

@brudnicke All the errors in the log that I am reading, It appears that a connection to your database is not happening and therefor it cannot complete its steps. I would recommend double checking the database steps listed here: https://snipe-it.readme.io/v3.6.1/docs/creating-a-database-and-db-user
(maybe start over with them to make sure everything is fresh and set properly)

Is this a mysql DB? Can you supply what is listed in your .env file under :
`# --------------------------------------------

REQUIRED: DATABASE SETTINGS

--------------------------------------------

DB_CONNECTION=mysql
DB_HOST=localhost
DB_DATABASE=null
DB_USERNAME=null
DB_PASSWORD=null
DB_PREFIX=null
DB_DUMP_PATH='

@JExactly
Copy link

@brudnicke Did you get this resolved?

@brudnicke
Copy link
Author

brudnicke commented Dec 13, 2016 via email

@JExactly
Copy link

Is your DB located on your localhost?

@brudnicke
Copy link
Author

brudnicke commented Dec 13, 2016 via email

@JExactly
Copy link

have you tried updating to the latest version to see if your issue was a bug that was fixed? I know there was mention of fixes related to Pre-flight issues. Which is where you seem to be having problems.

@snipe snipe closed this as completed Jul 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants