You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+98-63Lines changed: 98 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,10 @@ This is a FOSS project for asset management in IT Operations. Knowing who has wh
6
6
7
7
It is built on [Laravel 4.1](http://laravel.com) and uses the [Sentry 2](https://github.com/cartalyst/sentry) package.
8
8
9
-
Many thanks to the [Laravel 4 starter site](https://github.com/brunogaspar/laravel4-starter-kit) for a quick start.
10
-
11
9
This project is being actively developed (at what seems like breakneck speed sometimes!) We're still in alpha release, so this is NOT recommended for production use yet, as many more things will likely change before v1.0-stable is ready - but we're [releasing quite frequently](https://github.com/snipe/snipe-it/releases).
12
10
11
+
__This is web-based software__. This means there there is no executable file (aka no .exe files), and it must be run on a web server and accessed through a web browser. It runs on any Mac OSX, flavor of Linux, as well as Windows.
12
+
13
13
### Bug Reports & Feature Requests
14
14
15
15
Feel free to check out the [GitHub Issues for this project](https://github.com/snipe/snipe-it/issues) to open a bug report or see what open issues you can help with. Please search through existing issues (open and closed) to see if your question hasn't already been answered before opening a new issue.
@@ -24,14 +24,31 @@ To be notified of important news (such as new releases, security advisories, etc
-[Running this on an EC2 Micro Instance](https://github.com/snipe/snipe-it#running-this-on-an-ec2-micro-instance)
42
+
43
+
-----
27
44
## Requirements
28
45
29
46
- PHP 5.4 or later
30
47
- MCrypt PHP Extension
31
48
32
49
-----
33
50
34
-
## Important Note on Updating
51
+
## Important Notes on Updating
35
52
36
53
Whenever you pull down a new version from master or develop, when you grab the [latest official release](https://github.com/snipe/snipe-it/releases), make sure to run the following commands via command line:
37
54
@@ -42,28 +59,30 @@ Forgetting to do this can mean your DB might end up out of sync with the new fil
42
59
43
60
-----
44
61
45
-
## How to Install
62
+
## How to Install in Production
63
+
64
+
Bear in mind that Snipe-IT is still in pre-release. While it's generally pretty stable, installing this in a production environment is generally not recommended. We do our best to make sure future changes won't hoark your install, but you should always back up your databases when you upgrade to newer releases.
65
+
66
+
Note: Installation for Windows IIS [can be found here](https://gist.github.com/madd15/e48a9c4aaa4b14b6f69a) (thanks, [madd15](https://github.com/madd15)!)
### 2) Setup Environment, Database and Mail Settings
59
82
60
83
#### 2.1) Adjust Environments
61
84
62
-
Update the file `boostrap/start.php` under the section `Detect The Application Environment`.
63
-
64
-
vi bootstrap/start.php
65
-
66
-
-----
85
+
Update the file `bootstrap/start.php` under the section `Detect The Application Environment`.
67
86
68
87
__AS OF LARAVEL 4.1__
69
88
Per the [Laravel 4.1 upgrade docs](http://laravel.com/docs/upgrade):
@@ -72,12 +91,11 @@ __*"For security reasons, URL domains may no longer be used to detect your appli
72
91
73
92
To find out your local machine's hostname, type `hostname` from a terminal prompt on the machine you're installing it on. The command-line response is that machine's hostname. Please note that the hostname is NOT always the same as the domain name.
74
93
75
-
So for example, if you're installing this locally on your Mac named SnipeMBP, the environmental variable section of `bootstrap/start.php` might look like this:
94
+
So for example, if you're installing this on your server named www.yourserver.com, the environmental variable section of `bootstrap/start.php` might look like this:
76
95
77
96
$env = $app->detectEnvironment(array(
78
-
'local' => array('SnipeMBP'),
79
-
'staging' => array('staging.mysite.com'),
80
-
'production' => array('www.mysite.com')
97
+
...
98
+
'production' => array('www.yourserver.com')
81
99
));
82
100
83
101
If your development, staging and production sites all run on the same server (which is generally a terrible idea), [see this example](http://words.weareloring.com/development/setting-up-multiple-environments-in-laravel-4-1/) of how to configure the app using environmental variables.
@@ -86,37 +104,40 @@ If your development, staging and production sites all run on the same server (wh
86
104
87
105
#### 2.2) Setup Your Database
88
106
89
-
Copy the example database config `app/config/local/database.example.php` to `app/config/local/database.php`.
90
-
Update the file `app/config/local/database.php` with your database name and credentials.
107
+
Copy the example database config `app/config/production/database.example.php` to `app/config/production/database.php`.
108
+
Update the file `app/config/production/database.php` with your database name and credentials:
91
109
92
-
vi app/config/local/database.php
110
+
'mysql' => array(
111
+
'driver' => 'mysql',
112
+
'host' => 'localhost',
113
+
'database' => 'snipeit_laravel',
114
+
'username' => 'travis',
115
+
'password' => '',
116
+
'charset' => 'utf8',
117
+
'collation' => 'utf8_unicode_ci',
118
+
'prefix' => '',
119
+
),
93
120
94
121
95
-
#### 2.3) Setup Mail Settings
96
122
97
-
Copy the example mail config `app/config/local/mail.example.php` to `app/config/local/mail.php`.
98
-
Update the file `app/config/local/mail.php` with your mail settings.
123
+
#### 2.3) Setup Mail Settings
99
124
100
-
vi app/config/local/mail.php
125
+
Copy the example mail config `app/config/production/mail.example.php` to `app/config/production/mail.php`.
126
+
Update the file `app/config/production/mail.php` with your mail settings.
101
127
102
-
This will be used to send emails to your users, when they register and they request a password reset.
128
+
This will be used to send emails to your users, when they register and when they request a password reset.
103
129
104
130
#### 2.4) Adjust the application settings.
105
131
106
-
Copy the example app config `app/config/local/app.example.php` to `app/config/local/app.php`.
132
+
Copy the example app config `app/config/production/app.example.php` to `app/config/production/app.php`.
107
133
108
-
Update the file `app/config/local/app.php` with your URL settings.
134
+
Update the file `app/config/production/app.php` with your URL settings.
109
135
110
-
vi app/config/local/app.php
136
+
'url' => 'http://www.yourserver.com',
111
137
112
138
You should also change your secret key here -- if you prefer to have your key randomly generated, run the artisan key:generate command from the application root.
113
139
114
-
php artisan key:generate --env=local
115
-
116
-
117
-
#### 2.5) Additional Adjustments
118
-
119
-
The app is configured to automatically detect if you're in a local, staging, or production environment. Before deploying to a staging or production environment, follow sets 2.1, 2.2, and 2.3 above to tweak each environment as necessary. Configuration files for each environment can be found in app/config/{environment} (local, staging, and production).
140
+
php artisan key:generate --env=production
120
141
121
142
-----
122
143
@@ -140,7 +161,7 @@ Now, you need to create yourself a user and finish the installation.
140
161
141
162
Use the following command to create your default user, user groups and run all the necessary migrations automatically.
142
163
143
-
php artisan app:install --env=local
164
+
php artisan app:install
144
165
145
166
-----
146
167
@@ -158,28 +179,27 @@ If you still run into a permissions error, you may need to increase the permissi
158
179
159
180
### 7) Set the correct document root for your server
160
181
161
-
The document root for the app should be set to the public directory. In a standard Apache virtualhost setup, that might look something like this on a standard linux LAMP stack:
182
+
The document root for the app should be set to the `public` directory. In a standard Apache virtualhost setup, that might look something like this on a standard linux LAMP stack:
@@ -191,51 +211,66 @@ Loading up the sample data will give you an idea of how this should look, how yo
191
211
192
212
php artisan db:seed
193
213
214
+
__If you run this command on a database that already has your own asset data in it, it will over-write your database. ALL of your data will be gone. NEVER run the db seeder on production after on your initial install.__
215
+
194
216
-----
195
217
218
+
### Application logs
196
219
197
-
## Optional Development Stuff
198
-
### Set up the debugbar
220
+
Application logs for this app are found in `app/storage/logs`, as is customary of Laravel.
199
221
200
-
In dev mode, I use the fabulous [Laravel Debugbar](https://github.com/barryvdh/laravel-debugbar) by @barryvdh. After you've installed/updated composer, you'll need to publish the assets for the debugbar:
222
+
-----
201
223
202
-
php artisan debugbar:publish
224
+
### Running this on an EC2 Micro Instance
203
225
204
-
The profiler is enabled by default if you have debug set to true in your app.php. You certainly don't have to use it, but it's pretty handy for troubleshooting queries, seeing how much memory your pages are using, etc.
226
+
Depending on your needs, you could probably run this system in an EC2 micro instance. It doesn't take up very much memory and typically won't be a super-high-traffic application. EC2 micros fall into the free/dirt-cheap tier, which might make this a nice option. One thing to note though - composer can be a little memory-intensive while you're running updates, and you may have trouble with it failing on a micro. You can crank the memory_limit up in php.ini, but EC2 micros have swap disabled by default, so even that may not cut it. If you run into totally unhelpful error messages while running composer updates (like simply 'Killed') or fatal memory issues mentioning phar, your best bet will be to enable swap:
If you need more than 1024MB then change that to something higher.
233
+
234
+
To enable it by default after reboot, add this line to /etc/fstab:
235
+
236
+
/var/swap.1 swap swap defaults 0 0
205
237
206
238
-----
207
239
208
-
### Purging the autoloader
240
+
##Developing & Contributing
209
241
210
-
If you're doing any development on this, make sure you purge the auto-loader if you see any errors stating the new model you created can't be found, etc, otherwise your new models won't be grokked.
242
+
Please be sure to see the [contributing guidelines](https://github.com/snipe/snipe-it/blob/develop/CONTRIBUTING.md) before submitting pull requests.
211
243
212
-
php composer.phar dump-autoload
244
+
The only real difference in setting Snipe-IT up for local development versus setting it up for production usage is the configuration files, and remembering to add the local environment flag on the artisan commands.
213
245
246
+
You'll notice in your `app/config` directory, you have directories such as `local`, `staging`, and `production`. (The `testing` directory is reserved for unit tests, so don't mess with that one.)
214
247
215
-
-----
248
+
You'll want to make sure you have the configuration files updated for whichever environment you're in, which will most likely be `local`.
216
249
217
-
### Application logs
250
+
If you run the command line tools without the local flag, it will default to the production environment, so you'll want to make sure you run the commands as:
218
251
219
-
Application logs for this app are found in `app/storage/logs`, as is customary of Laravel.
252
+
php artisan key:generate --env=local
253
+
php artisan app:install --env=local
220
254
221
-
-----
255
+
### Set up the debugbar
222
256
223
-
### Running this on an EC2 Micro Instance
257
+
In dev mode, I use the fabulous [Laravel Debugbar](https://github.com/barryvdh/laravel-debugbar) by [barryvdh](https://github.com/barryvdh). After you've installed/updated composer, you'll need to publish the assets for the debugbar:
224
258
225
-
Depending on your needs, you could probably run this system in an EC2 micro instance. It doesn't take up very much memory and typically won't be a super-high-traffic application. EC2 micros fall into the free/dirt-cheap tier, which might make this a nice option. One thing to note though - composer can be a little memory-intensive while you're running updates, and you may have trouble with it failing on a micro. You can crank the memory_limit up in php.ini, but EC2 micros have swap disabled by default, so even that may not cut it. If you run into totally unhelpful error messages while running composer updates (like simply 'Killed') or fatal memory issues mentioning phar, your best bet will be to enable swap:
The profiler is enabled by default if you have debug set to true in your app.php. You certainly don't have to use it, but it's pretty handy for troubleshooting queries, seeing how much memory your pages are using, etc.
230
262
231
-
If you need more than 1024 then change that to something higher.
263
+
-----
232
264
233
-
To enable it by default after reboot, add this line to /etc/fstab:
265
+
### Purging the autoloader
234
266
235
-
/var/swap.1 swap swap defaults 0 0
267
+
If you're doing any development on this, make sure you purge the auto-loader if you see any errors stating the new model you created can't be found, etc, otherwise your new models won't be grokked.
0 commit comments