snipe / snipe-it

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

Installation on IIS 8 Server 2012 R2 #1452

Closed sund0260 closed 8 years ago

sund0260 commented 8 years ago

Hello,

I am having issues getting the app to function. To my knowledge I have installed everything as requested. I used Web Platform Installer to install PHP 5.6.0 on the server. I think everything with PHP is set up though I could not figure out MCrypt. From what I am reading it is inherently built into PHP 5.6?

I downloaded the most recent version of Snipe-IT a few weeks ago. I turned on debug, but I cannot see where anything is logging. I am not very good with IIS (newbie) so not sure where to look.

My biggest issue is I do not know how to check that all the steps were completed correctly. I ran Composer Install just fine after installing GIT and it seeded the database and added the users. When I try to open the webpage, it just says page could not be displayed. What info can I provide to help figure out what is going wrong. On URL Rewrite I disabled rule 1.

Thanks in advance.

sund0260 commented 8 years ago

Can anyone tell me where I can find the log file to post any errors I am getting?

Thank you.

ddreier commented 8 years ago

Are you trying to access the site from the computer that's hosting it? If not, check the firewall and DNS. Snipe-IT's log files are stored in <snipe-it install dir>\app\storage\logs.

sund0260 commented 8 years ago

Thank you for the response.

I am trying to access the app on the server it is installed on. Typing in http://localhost/ or the IP address just shows "This Page Can't Be Displayed" in IE. I stopped the default website and have the snipe-it website set as the standard website for the server.

The only thing in the ..\snipe-it\app\storage\logs is a file named .gitkeep and I have no clue how to open it. This leads me to believe that something with the install went wrong or the site activating in IIS is not happening.

Thank you.

ddreier commented 8 years ago

What does the binding look like for your Snipe-IT site?

sund0260 commented 8 years ago

Type: http IP address: All Unassigned Port: 80 Host Name: 'left blank'

ddreier commented 8 years ago

Which Windows OS/Version of IIS are you running? You might need the reorder the Default Documents so that index.php is first.

sund0260 commented 8 years ago

I am running on Windows 2012 R2 server using IIS 8. Not sure what you meant by reordering the Default Documents. Do I perform this in the snipe-it app folder or in IIS somewhere?

Thank you.

sund0260 commented 8 years ago

Sorry, I just think I found what you were referring to. Default documents in IIS for snipe-it site are as follows:

index.php Default.htm Defailt.asp index.htm index.html iisstart.htm default.aspx

Thank you.

ddreier commented 8 years ago

How about the Basic Settings for your site?

sund0260 commented 8 years ago

Site name: Snipe IT Application pool: Snipe IT Physical path: C:\inetpub\wwwroot\snipe-it\public Connect as 'mydomain\myunername'

Test Settings came back with everything checking out good.

ddreier commented 8 years ago

In IIS Manager, under your Snipe-IT site, you should have an item called "PHP Manager." In PHP Manager there is a "Check phpinfo()" link. What shows if you click that? There is also a link to the PHP error log in PHP Manager.

(If you don't have PHP Manager, it's available in the Web Platform Installer.)

sund0260 commented 8 years ago

Check phpinfo() shows the following: Select a site where to check PHP configuration: Snipe IT Select a URL used for the selected site: http://localhost/ After clicking OK there is a LOT of info output. Not sure if you want me to copy it all and paste it here?

As for the error log, there are a lot of repeating ones that are old and not sure if they pertain to the issue I am having, but here is what I am seeing.

[30-Nov-2015 21:48:36 America/Tegucigalpa] PHP Warning: require(C:\inetpub\wwwroot\snipe-it\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\inetpub\wwwroot\snipe-it\bootstrap\autoload.php on line 17

[30-Nov-2015 21:48:36 America/Tegucigalpa] PHP Fatal error: require(): Failed opening required 'C:\inetpub\wwwroot\snipe-it\bootstrap/../vendor/autoload.php' (include_path='.;C:\php\pear') in C:\inetpub\wwwroot\snipe-it\bootstrap\autoload.php on line 17

[07-Dec-2015 15:39:53 America/Tegucigalpa] PHP Parse error: syntax error, unexpected '...' (T_ELLIPSIS), expecting ')' in C:\inetpub\wwwroot\snipe-it\bootstrap\start.php on line 27

ddreier commented 8 years ago

No, you're right, I don't want/need to see all of phpinfo(). :)

[30-Nov-2015 21:48:36 America/Tegucigalpa] PHP Warning: require(C:\inetpub\wwwroot\snipe-it\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\inetpub\wwwroot\snipe-it\bootstrap\autoload.php on line 17

Tells me that something didn't complete successfully in the command-line setup portion. You didn't get any errors when running composer install and php artisan app:install --env=production?

sund0260 commented 8 years ago

start.php line 27 just had three periods like the example in the installation documentation. I removed them and the error does not seem to be coming back upon site restart.

ddreier commented 8 years ago

So, what does the "Detect The Application Environment" section of start.php look like now?

sund0260 commented 8 years ago

I did get some errors initially when I did not have GIT installed. I don't have the log from the Composer install but I do have the php artisan app:install as below (I edited out the application key)

Basic usage: composer For more information just type "composer".

C:\inetpub\wwwroot\snipe-it>php artisan app:install --env=production

Step: 1

Please follow the following
instructions to create your
default user.

Please enter your first name: My first name Please enter your last name: My last name Please enter your username: my username Please enter your email: my email Please enter your user password (at least 8 characters): Please confirm your user password: Do you want to seed your database with dummy data? y/N (default is no): y

Step: 2

Preparing your Application

Application key [(Deleted for publishing on help forum)] set successfully. Migration table created successfully. Migrated: 2012_12_06_225921_migration_cartalyst_sentry_install_users Migrated: 2012_12_06_225929_migration_cartalyst_sentry_install_groups Migrated: 2012_12_06_225945_migration_cartalyst_sentry_install_users_groups_pivo t Migrated: 2012_12_06_225988_migration_cartalyst_sentry_install_throttle Migrated: 2013_03_23_193214_update_users_table Migrated: 2013_11_13_075318_create_models_table Migrated: 2013_11_13_075335_create_categories_table Migrated: 2013_11_13_075347_create_manufacturers_table Migrated: 2013_11_15_015858_add_user_id_to_categories Migrated: 2013_11_15_112701_add_user_id_to_manufacturers Migrated: 2013_11_15_190327_create_assets_table Migrated: 2013_11_15_190357_create_licenses_table Migrated: 2013_11_15_201848_add_license_name_to_licenses Migrated: 2013_11_16_040323_create_depreciations_table Migrated: 2013_11_16_042851_add_depreciation_id_to_models Migrated: 2013_11_16_084923_add_user_id_to_models Migrated: 2013_11_16_103258_create_locations_table Migrated: 2013_11_16_103336_add_location_id_to_assets Migrated: 2013_11_16_103407_add_checkedout_to_to_assets Migrated: 2013_11_16_103425_create_history_table Migrated: 2013_11_17_054359_drop_licenses_table Migrated: 2013_11_17_054526_add_physical_to_assets Migrated: 2013_11_17_055126_create_settings_table Migrated: 2013_11_17_062634_add_license_to_assets Migrated: 2013_11_18_134332_add_contacts_to_users Migrated: 2013_11_18_142847_add_info_to_locations Migrated: 2013_11_18_152942_remove_location_id_from_asset Migrated: 2013_11_18_164423_set_nullvalues_for_user Migrated: 2013_11_19_013337_create_asset_logs_table Migrated: 2013_11_19_061409_edit_added_on_asset_logs_table Migrated: 2013_11_19_062250_edit_location_id_asset_logs_table Migrated: 2013_11_20_055822_add_soft_delete_on_assets Migrated: 2013_11_20_121404_add_soft_delete_on_locations Migrated: 2013_11_20_123137_add_soft_delete_on_manufacturers Migrated: 2013_11_20_123725_add_soft_delete_on_categories Migrated: 2013_11_20_130248_create_status_labels Migrated: 2013_11_20_130830_add_status_id_on_assets_table Migrated: 2013_11_20_131544_add_status_type_on_status_labels Migrated: 2013_11_20_134103_add_archived_to_assets Migrated: 2013_11_21_002321_add_uploads_table Migrated: 2013_11_21_024531_remove_deployable_boolean_from_status_labels Migrated: 2013_11_22_075308_add_option_label_to_settings_table Migrated: 2013_11_22_213400_edits_to_settings_table Migrated: 2013_11_25_013244_create_licenses_table Migrated: 2013_11_25_031458_create_license_seats_table Migrated: 2013_11_25_032022_add_type_to_actionlog_table Migrated: 2013_11_25_033008_delete_bad_licenses_table Migrated: 2013_11_25_033131_create_new_licenses_table Migrated: 2013_11_25_033534_add_licensed_to_licenses_table Migrated: 2013_11_25_101308_add_warrantee_to_assets_table Migrated: 2013_11_25_104343_alter_warranty_column_on_assets Migrated: 2013_11_25_150450_drop_parent_from_categories Migrated: 2013_11_25_151920_add_depreciate_to_assets Migrated: 2013_11_25_152903_add_depreciate_to_licenses_table Migrated: 2013_11_26_211820_drop_license_from_assets_table Migrated: 2013_11_27_062510_add_note_to_asset_logs_table Migrated: 2013_12_01_113426_add_filename_to_asset_log Migrated: 2013_12_06_094618_add_nullable_to_licenses_table Migrated: 2013_12_10_084038_add_eol_on_models_table Migrated: 2013_12_12_055218_add_manager_to_users_table Migrated: 2014_01_28_031200_add_qr_code_to_settings_table Migrated: 2014_02_13_183016_add_qr_text_to_settings_table Migrated: 2014_05_24_093839_alter_default_license_depreciation_id Migrated: 2014_05_27_231658_alter_default_values_licenses Migrated: 2014_06_19_191508_add_asset_name_to_settings Migrated: 2014_06_20_004847_make_asset_log_checkedout_to_nullable Migrated: 2014_06_20_005050_make_asset_log_purchasedate_to_nullable Migrated: 2014_06_24_003011_add_suppliers Migrated: 2014_06_24_010742_add_supplier_id_to_asset Migrated: 2014_06_24_012839_add_zip_to_supplier Migrated: 2014_06_24_033908_add_url_to_supplier Migrated: 2014_07_08_054116_add_employee_id_to_users Migrated: 2014_07_09_134316_add_requestable_to_assets Migrated: 2014_07_17_085822_add_asset_to_software Migrated: 2014_07_17_161625_make_asset_id_in_logs_nullable Migrated: 2014_08_12_053504_alpha_0_4_2_release Migrated: 2014_08_17_083523_make_location_id_nullable Migrated: 2014_10_16_200626_add_rtd_location_to_assets Migrated: 2014_10_24_000417_alter_supplier_state_to_32 Migrated: 2014_10_24_015641_add_display_checkout_date Migrated: 2014_10_28_222654_add_avatar_field_to_users_table Migrated: 2014_10_29_045924_add_image_field_to_models_table Migrated: 2014_11_01_214955_add_eol_display_to_settings Migrated: 2014_11_04_231416_update_group_field_for_reporting Migrated: 2014_11_05_212408_add_fields_to_licenses Migrated: 2014_11_07_021042_add_image_to_supplier Migrated: 2014_11_20_203007_add_username_to_user Migrated: 2014_11_20_223947_add_auto_to_settings Migrated: 2014_11_20_224421_add_prefix_to_settings Migrated: 2014_11_21_104401_change_licence_type Migrated: 2014_12_09_082500_add_fields_maintained_term_to_licenses Migrated: 2015_02_04_155757_increase_user_field_lengths Migrated: 2015_02_07_013537_add_soft_deleted_to_log Migrated: 2015_02_10_040958_fix_bad_assigned_to_ids Migrated: 2015_02_10_053310_migrate_data_to_new_statuses Migrated: 2015_02_11_044104_migrate_make_license_assigned_null Migrated: 2015_02_11_104406_migrate_create_requests_table Migrated: 2015_02_12_001312_add_mac_address_to_asset Migrated: 2015_02_12_024100_change_license_notes_type Migrated: 2015_02_17_231020_add_localonly_to_settings Migrated: 2015_02_19_222322_add_logo_and_colors_to_settings Migrated: 2015_02_24_072043_add_alerts_to_settings Migrated: 2015_02_25_022931_add_eula_fields Migrated: 2015_02_25_204513_add_accessories_table Migrated: 2015_02_26_091228_add_accessories_user_table Migrated: 2015_02_26_115128_add_deleted_at_models Migrated: 2015_02_26_233005_add_category_type Migrated: 2015_03_01_231912_update_accepted_at_to_acceptance_id Migrated: 2015_03_05_011929_add_qr_type_to_settings Migrated: 2015_03_18_055327_add_note_to_user Migrated: 2015_04_29_234704_add_slack_to_settings Migrated: 2015_05_04_085151_add_parent_id_to_locations_table Migrated: 2015_05_22_124421_add_reassignable_to_licenses Migrated: 2015_06_10_003314_fix_default_for_user_notes Migrated: 2015_06_10_003554_create_consumables Migrated: 2015_06_15_183253_move_email_to_username Migrated: 2015_06_23_070346_make_email_nullable Migrated: 2015_06_26_213716_create_asset_maintenances_table Migrated: 2015_07_09_014359_add_currency_to_settings_and_locations Migrated: 2015_07_21_122022_add_expected_checkin_date_to_asset_logs Migrated: 2015_07_24_093845_add_checkin_email_to_category_table Migrated: 2015_07_25_055415_remove_email_unique_constraint Migrated: 2015_07_29_230054_add_thread_id_to_asset_logs_table Migrated: 2015_07_31_015430_add_accepted_to_assets Migrated: 2015_09_09_195301_add_custom_css_to_settings Migrated: 2015_09_28_003314_fix_default_purchase_order Migrated: 2015_10_01_024551_add_accessory_consumable_price_info Migrated: 2015_10_12_192706_add_brand_to_settings Migrated: 2015_10_22_003314_fix_defaults_accessories Migrated: 2015_10_23_182625_add_checkout_time_and_expected_checkout_date_to_asse ts Migrated: 2015_11_05_183749_image

Admin group created successfully.

Reporting group created successfully.

Users group created successfully.

Your user was created successfully.

C:\inetpub\wwwroot\snipe-it>

sund0260 commented 8 years ago

The start.php section looks like this now:

-------------------------------------------------------------------------- Detect The Application Environment
Laravel takes a dead simple approach to your application environments
so you can just specify a machine name or HTTP host that matches a
given environment, then we will automatically detect it for you.
*/
    $env = $app->detectEnvironment(array(
        'production' => array('tptfs1')
    ));

I will say when I ran the composer and app install commands this had all the other lines as start.php normally has for other environments. Not sure if that can mess things up or not.

ddreier commented 8 years ago

Well, I'm not sure that it matters that the others are missing. But here's what it should look like:

    /*
    |--------------------------------------------------------------------------
    | Detect The Application Environment
    |--------------------------------------------------------------------------
    |
    | Laravel takes a dead simple approach to your application environments
    | so you can just specify a machine name or HTTP host that matches a
    | given environment, then we will automatically detect it for you.
    |
    */
        $env = $app->detectEnvironment( [
            'local'      => [ 'homestead', 'AlisonMBP' ],
            'travis-ci'  => getenv('APP_ENV') == 'travis-ci',
            'staging'    => [ 'stagingweb01' ],
            'production' => [ 'www.yourserver.com' ]
        ] );

You don't really have to change anything.

sund0260 commented 8 years ago

So under production I don't need to change the 'www.yourserver.com' entry?

ddreier commented 8 years ago

Nope! Also, FWIW, the ellipsis in the documentation is just there to indicate that some lines were omitted.

Instead of doing the right click -> Composer Install, do Use Composer Here and then run composer install from that command line. (You can just do that, it won't break anything and hopefully will fix some thing)

sund0260 commented 8 years ago

Basic usage: composer For more information just type "composer".

C:\inetpub\wwwroot\snipe-it>composer install Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Generating autoload files

C:\inetpub\wwwroot\snipe-it>

Restarted the website in IIS and still nothing. Nothing new in the PHP log and no files in the Snipe-IT logs.

ddreier commented 8 years ago

Is there anything in the IIS access log? You'll find that under C:\inetpub\logs\LogFiles\W3SVC#. What status code are you getting in the browser?

If there's nothing in the PHP logs you're not getting to Snipe-IT. You have to get IIS working before this is a Snipe-IT problem.

sund0260 commented 8 years ago

In the folder C:\inetpub\logs\LogFiles\W3SVC1 there are a bunch of files. The latest file in here is u_ex151203.log and was last modified 12/2/2015. This is what the file contains:

Software: Microsoft Internet Information Services 8.5

Version: 1.0

Date: 2015-12-02 01:08:01

Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken

2015-12-02 01:08:01 10.0.0.3 HEAD / - 80 - 10.0.0.11 - - 301 0 64 11812

Software: Microsoft Internet Information Services 8.5

Version: 1.0

Date: 2015-12-02 06:58:18

Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken

2015-12-02 06:58:18 10.0.0.3 HEAD / - 80 - 10.0.0.11 - - 301 0 64 5517

Software: Microsoft Internet Information Services 8.5

Version: 1.0

Date: 2015-12-02 19:44:18

Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken

2015-12-02 19:44:18 10.0.0.3 HEAD / - 80 - 10.0.0.11 - - 301 0 64 11084

In the folder C:\inetpub\logs\LogFiles\W3SVC2 there are a couple files the latest of which is u_ex151208 last updated 12/8/2015. The file contains the following:

Software: Microsoft Internet Information Services 8.5

Version: 1.0

Date: 2015-12-08 10:36:12

Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken

2015-12-08 10:36:12 10.0.0.3 HEAD / - 80 - 10.0.0.11 - - 302 0 64 8799

Software: Microsoft Internet Information Services 8.5

Version: 1.0

Date: 2015-12-08 23:19:49

Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken

2015-12-08 23:19:49 10.0.0.3 HEAD / - 80 - 10.0.0.11 - - 302 0 0 2234

Not sure why IIS might not be working right. It did work before and I had a web app installed on it. I have since uninstalled that web app. I tried stopping the snipe-it website and restarting the default website to see if I could just get the IIS page to load. Nothing. When I hover my mouse over the default website it says "Default Website (multiple protocols)". Not sure if that has anything to do with it not working right. I realize that this is not a support page for IIS, but if anyone has any ideas on what might be the issue I would greatly appreciate the help.

Thank you.

ddreier commented 8 years ago

So, I'm a little confused with what your IIS logs are telling me and what you're telling me. The response code is 302, so either the app is trying to redirect you to /auth/signin or you disabled the incorrect URL Rewrite rule and you're being redirected to HTTPS.

What happens if you go to http://localhost/auth/signin? What happens if you go to that URL after disabling all of the URL rewrite rules? (If it's not clear, I specifically want you to do these things on the server/computer hosting the app. No firewall interference that way.)

sund0260 commented 8 years ago

If I go to that site I get a sign in page for Snipe-IT. Does it have something to do with permissions? I have everything set as it asked for permission-wise in the installation guide.

ddreier commented 8 years ago

Ok, here's what your rewrite rules should look like. Do they match? image

sund0260 commented 8 years ago

Yep, everything matched exactly as you showed.

ddreier commented 8 years ago

So, on the computer hosting Snipe-IT, what exactly happens when you browse to http://localhost?

sund0260 commented 8 years ago

It says "This Page Cannot Be displayed, make sure web address is correct, look for the page with your search engine, refresh the page in a few minutes."

So using the link you gave me I was able to log in and change some things/create some entries. As soon as I go to log out and it tries to go to the page http://localhost/auth/logout/ I get the error again of the page not being able to be displayed.

ddreier commented 8 years ago

What's in the address bar when you get "This Page Cannot Be displayed"?

sund0260 commented 8 years ago

The last address I typed when I get that "This Page Cannot Be Displayed" was the address after logging out. When trying to just go to the site I type http://localhost/ to try to load it.

Interesting behavior. When I log in to Snipe-IT through the //localhost/auth/signin page and then try to go to the dashboard, I get the page cannot be displayed. The URL address though shown is http://snipeit.mywebsite.com which is not yet registered with my DNS internally. Could this be where the problem is? I know I set that address somewhere but I cannot remember where nor can I remember what the address should be set to to test everything before I make a DNS entry. Or should I just make the DNS entry and see if that fixes everything?

snipe commented 8 years ago

check app/config/production/app.php, for the url value.

sund0260 commented 8 years ago

So I tried changing the url value in app.php to 'http://localhost/' and I still get the page not loading. I tried setting the url value to "http://x.x.x.x/' (my server's IP address) and still get the page not loading.

sund0260 commented 8 years ago

Now get this. I registered the DNS and changed it back in the app.php to what I had it set as. Then I tried to access the site on a computer on the network. Seems to work just fine.... Did not run into any issues going to any of the links. Why is this not running well when using the localhost link on the hosting server?

ddreier commented 8 years ago

I definitely don't have an answer for that, but I'm glad it's working.

sund0260 commented 8 years ago

I'll run with it. Thank you both for all your help!