{"id":717,"date":"2017-05-21T09:24:05","date_gmt":"2017-05-21T02:24:05","guid":{"rendered":"http:\/\/blog.trichev.com\/?p=717"},"modified":"2017-08-10T09:07:49","modified_gmt":"2017-08-10T02:07:49","slug":"snipe-it-3-6-4-on-centos-6","status":"publish","type":"post","link":"https:\/\/trichev.com\/blog\/2017\/05\/21\/snipe-it-3-6-4-on-centos-6\/","title":{"rendered":"Snipe-IT 3.6.4 on CentOS 6"},"content":{"rendered":"<p>Requirements <a href=\"https:\/\/snipe-it.readme.io\/docs\/requirements\">here<\/a>.<\/p>\n<p>PHP 5.5 installation:<br \/>\n<code>yum install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-6.noarch.rpm<br \/>\nyum install http:\/\/rpms.remirepo.net\/enterprise\/remi-release-6.rpm<br \/>\nyum install php55.x86_64 php55-php php55-php-pdo php55-php-gd php55-php-mysql php55-php-mcrypt php55-php-common php55-php-mbstring php55-php-pecl-imagick mysql-server.x86_64 php55-php-pecl-zip php55-php-ldap<br \/>\nyum install mod_ssl<\/code><\/p>\n<p>Creating a Database and User:<br \/>\n<code>mysql_secure_installation<br \/>\nmysql -u root -p<br \/>\ncreate database snipeit;<br \/>\nshow databases;<br \/>\ncreate user snipe_user;<br \/>\ngrant all on snipeit.* to 'snipe_user'@'localhost' identified by 'YOUR_DB_PASSWORD_HERE';<\/code><\/p>\n<p><code>wget https:\/\/github.com\/snipe\/snipe-it\/archive\/v3.6.4.tar.gz<br \/>\ntar zxvf snipe-it-3.6.4.tar.gz<br \/>\nmkdir \/var\/www\/snipeit &amp;&amp; cp -r snipe-it-3.6.4\/* \/var\/www\/snipeit\/<br \/>\ncd \/var\/www\/snipeit\/<br \/>\ncp .env.example .env<\/code><\/p>\n<p>.env file has to be filled out with your data:<\/p>\n<p><code>vi .env<br \/>\n# --------------------------------------------<br \/>\n# REQUIRED: BASIC APP SETTINGS<br \/>\n# --------------------------------------------<br \/>\nAPP_ENV=production<br \/>\nAPP_DEBUG=false<br \/>\nAPP_KEY=ChangeMe<br \/>\nAPP_URL=null<br \/>\nAPP_TIMEZONE='UTC'<br \/>\nAPP_LOCALE=en<\/code><\/p>\n<p><code># --------------------------------------------<br \/>\n# REQUIRED: DATABASE SETTINGS<br \/>\n# --------------------------------------------<br \/>\nDB_CONNECTION=mysql<br \/>\nDB_HOST=localhost<br \/>\nDB_DATABASE=null<br \/>\nDB_USERNAME=null<br \/>\nDB_PASSWORD=null<br \/>\nDB_PREFIX=null<br \/>\nDB_DUMP_PATH='\/usr\/bin'<\/code><\/p>\n<p><code># --------------------------------------------<br \/>\n# OPTIONAL: SSL DATABASE SETTINGS<br \/>\n# --------------------------------------------<br \/>\nDB_SSL=false<br \/>\nDB_SSL_KEY_PATH=null<br \/>\nDB_SSL_CERT_PATH=null<br \/>\nDB_SSL_CA_PATH=null<br \/>\nDB_SSL_CIPHER=null<\/code><\/p>\n<p><code># --------------------------------------------<br \/>\n# REQUIRED: OUTGOING MAIL SERVER SETTINGS<br \/>\n# --------------------------------------------<br \/>\nMAIL_DRIVER=smtp<br \/>\nMAIL_HOST=email-smtp.us-west-2.amazonaws.com<br \/>\nMAIL_PORT=587<br \/>\nMAIL_USERNAME=YOURUSERNAME<br \/>\nMAIL_PASSWORD=YOURPASSWORD<br \/>\nMAIL_ENCRYPTION=null<br \/>\nMAIL_FROM_ADDR=you@example.com<br \/>\nMAIL_FROM_NAME='Snipe-IT'<br \/>\nMAIL_REPLYTO_ADDR=you@example.com<br \/>\nMAIL_REPLYTO_NAME='Snipe-IT'<\/code><\/p>\n<p><code># --------------------------------------------<br \/>\n# REQUIRED: IMAGE LIBRARY<br \/>\n# This should be gd or imagick<br \/>\n# --------------------------------------------<br \/>\nIMAGE_LIB=gd<\/code><\/p>\n<p><code># --------------------------------------------<br \/>\n# OPTIONAL: SESSION SETTINGS<br \/>\n# --------------------------------------------<br \/>\nSESSION_LIFETIME=12000<br \/>\nEXPIRE_ON_CLOSE=false<br \/>\nENCRYPT=false<br \/>\nCOOKIE_NAME=snipeit_session<br \/>\nCOOKIE_DOMAIN=null<br \/>\nSECURE_COOKIES=false<\/code><\/p>\n<p><code># --------------------------------------------<br \/>\n# OPTIONAL: CACHE SETTINGS<br \/>\n# --------------------------------------------<br \/>\nCACHE_DRIVER=file<br \/>\nSESSION_DRIVER=file<br \/>\nQUEUE_DRIVER=sync<\/code><\/p>\n<p><code># --------------------------------------------<br \/>\n# OPTIONAL: AWS S3 SETTINGS<br \/>\n# --------------------------------------------<br \/>\nAWS_SECRET=null<br \/>\nAWS_KEY=null<br \/>\nAWS_REGION=null<br \/>\nAWS_BUCKET=null<\/code><\/p>\n<p><code># --------------------------------------------<br \/>\n# OPTIONAL: LOGIN THROTTLING<br \/>\n# --------------------------------------------<br \/>\nLOGIN_MAX_ATTEMPTS=5<br \/>\nLOGIN_LOCKOUT_DURATION=60<\/code><\/p>\n<p><code># --------------------------------------------<br \/>\n# OPTIONAL: MISC<br \/>\n# --------------------------------------------<br \/>\nAPP_LOG=single<br \/>\nAPP_LOCKED=false<br \/>\nFILESYSTEM_DISK=local<br \/>\nAPP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1<br \/>\nALLOW_IFRAMING=false<\/code><\/p>\n<p>Detailed information about all options could be found <a href=\"https:\/\/snipe-it.readme.io\/docs\/configuration\">here<\/a>.<\/p>\n<p>Composer installation:<br \/>\n<code>su - snipeit<br \/>\ncd \/var\/www\/snipeit\/<br \/>\ncurl -sS https:\/\/getcomposer.org\/installer | php<br \/>\nphp composer.phar install --no-dev --prefer-source<\/code><\/p>\n<p>Generate Your App Key:<br \/>\nThis should automatically set the APP_KEY value in your .env file for you.<br \/>\n<code>php artisan key:generate<\/code><\/p>\n<p>To start installation process just go to your Snipe IT url<\/p>\n<p>Web Server and SSL config:<br \/>\n<code>openssl req -new -x509 -days 1825 -keyout servername.domain.com.key -out servername.domaincom.crt -nodes -subj '\/O=Organization\/OU=Organization Department\/CN=servername.domain.com<br \/>\ncp servername.domain.com.key \/etc\/pki\/tls\/private\/<br \/>\nchmod 400 \/etc\/pki\/tls\/private\/servername.domain.com.key<br \/>\ncp servername.domain.com.crt \/etc\/pki\/tls\/certs\/<\/code><\/p>\n<p><code>vi \/var\/www\/snipeit\/public\/.htaccess<br \/>\n#Uncomment these lines<br \/>\nRewriteCond %{HTTPS} off<br \/>\nRewriteRule (.*) https:\/\/%{HTTP_HOST}%{REQUEST_URI} [R=301,L]<\/code><\/p>\n<p><code>vi \/etc\/httpd\/conf.d\/snipeit.conf:<br \/>\nDocumentRoot \/var\/www\/snipeit\/public<br \/>\nServerName servername.domain.com<br \/>\nSSLEngine On<br \/>\nSSLCertificateFile \/etc\/pki\/tls\/certs\/servername.domaincom.crt<br \/>\nSSLCertificateKeyFile \/etc\/pki\/tls\/private\/servername.domain.com.key<br \/>\nAllow From All<br \/>\nAllowOverride All<br \/>\nOptions +Indexes<\/code><\/p>\n<p><code>chown -R snipeit:snipeit \/var\/www\/snipeit\/<br \/>\nchown -R apache:apache \/var\/www\/snipeit\/storage<br \/>\nchown -R apache:apache \/var\/www\/snipeit\/public\/uploads<br \/>\nchmod -R 755 \/var\/www\/snipeit\/storage<br \/>\nchmod -R 755 \/var\/www\/snipeit\/public\/uploads\/<\/code><\/p>\n<p>LDAP Settings:<br \/>\n<code>LDAP Integration - LDAP enabled<br \/>\nActive Directory - This is an Active Directory server<br \/>\nLDAP Password Sync - Yes<br \/>\nActive Directory domain - domain.com<br \/>\nLDAP Server ldap:\/\/servername.domain.com<br \/>\nLDAP Bind Username - readonlyuser@domain.com<br \/>\nBase Bind DN - OU=Users,OU=SomeOU,DC=domain,DC=com<br \/>\n#Request only enabled users<br \/>\nLDAP Filter - &amp;(sAMAccountType=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2))<br \/>\nUsername Field - samaccountname<br \/>\nLast Name - sn<br \/>\nLDAP First Name - givenname<br \/>\nLDAP Authentication query - samaccountname=<br \/>\nLDAP Version - 3<br \/>\nLDAP Email - mail<\/code><\/p>\n<p>Links: <a href=\"https:\/\/snipe-it.readme.io\/docs\">https:\/\/snipe-it.readme.io\/docs<\/a><br \/>\n<a href=\"https:\/\/snipe-it.readme.io\/v3.6.2\/docs\/ldap-sync-login\">https:\/\/snipe-it.readme.io\/v3.6.2\/docs\/ldap-sync-login<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Requirements here. PHP 5.5 installation: yum install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-6.noarch.rpm yum install http:\/\/rpms.remirepo.net\/enterprise\/remi-release-6.rpm yum install php55.x86_64 php55-php php55-php-pdo php55-php-gd php55-php-mysql php55-php-mcrypt php55-php-common php55-php-mbstring php55-php-pecl-imagick mysql-server.x86_64 php55-php-pecl-zip php55-php-ldap yum install mod_ssl Creating a Database and User: mysql_secure_installation mysql -u root -p create database snipeit; show databases; create user snipe_user; grant all on snipeit.* to &#8216;snipe_user&#8217;@&#8217;localhost&#8217; identified by &#8216;YOUR_DB_PASSWORD_HERE&#8217;; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[231],"tags":[222,212,32,221,28,14,11],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/717"}],"collection":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/comments?post=717"}],"version-history":[{"count":1,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/717\/revisions"}],"predecessor-version":[{"id":718,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/717\/revisions\/718"}],"wp:attachment":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/media?parent=717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/categories?post=717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/tags?post=717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}