KETSE / casebox

Casebox: Secure all your information and team communication in one place
https://www.casebox.org
217 stars 117 forks source link

How do I install CB in GCE and in a different root directory? #74

Open FranklinMayR opened 6 years ago

FranklinMayR commented 6 years ago

I built a joomla website for a NGO and now I'm trying to install Casebox in a secondary root directory following this structure: https://_mycurrentdomain_/casebox so they can access all their services from the same domain and server; I've been trying to adapt the instructions given in https://github.com/KETSE/casebox/wiki/CentOS-7.2-x64, but still i cannot manage to make it work even not using SSL. Can you give some help on this?

UPDATE I tried again from the beginning in a GCE instance and this is the result:

$sudo cat/etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

$sudo hostnamectl
   Static hostname: mydomain.com
         Icon name: computer-vm
           Chassis: vm
        Machine ID: @#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#
           Boot ID: @#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-693.2.2.el7.x86_64
      Architecture: x86-64

$ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1460 qdisc pfifo_fast state UP qlen 1000
    link/ether 42:01:0a:8e:00:02 brd ff:ff:ff:ff:ff:ff
    inet 10.142.0.2/32 brd 10.142.0.2 scope global dynamic eth0
       valid_lft 80162sec preferred_lft 80162sec

After following -again- all the steps in the manual, this is how far i went:

$sudo composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 93 installs, 0 updates, 0 removals
  - Installing twig/twig (v1.35.0): Downloading (100%)         
  - Installing symfony/polyfill-util (v1.5.0): Downloading (100%)         
  - Installing paragonie/random_compat (v2.0.11): Downloading (100%)         
  - Installing symfony/polyfill-php70 (v1.5.0): Downloading (100%)         
  - Installing symfony/polyfill-php56 (v1.5.0): Downloading (100%)         
  - Installing symfony/polyfill-mbstring (v1.5.0): Downloading (100%)         
  - Installing symfony/symfony (v3.0.9): Downloading (100%)         
  - Installing symfony/polyfill-intl-icu (v1.5.0): Downloading (100%)         
  - Installing psr/log (1.0.2): Downloading (100%)         
  - Installing doctrine/lexer (v1.0.1): Downloading (100%)         
  - Installing doctrine/inflector (v1.2.0): Downloading (100%)         
  - Installing doctrine/collections (v1.5.0): Downloading (100%)         
  - Installing doctrine/cache (v1.7.1): Downloading (100%)         
  - Installing doctrine/annotations (v1.5.0): Downloading (100%)         
  - Installing doctrine/common (v2.8.1): Downloading (100%)         
  - Installing caseboxdev/rpc-bundle (dev-master 7395bb0): Downloading (100%)         
  - Installing phpoption/phpoption (1.5.0): Downloading (100%)         
  - Installing doctrine/instantiator (1.1.0): Downloading (100%)         
  - Installing phpcollection/phpcollection (0.5.0): Downloading (100%)         
  - Installing jms/parser-lib (1.0.0): Downloading (100%)         
  - Installing jms/metadata (1.6.0): Downloading (100%)         
  - Installing jms/serializer (1.9.0): Downloading (100%)         
  - Installing jms/serializer-bundle (1.5.0): Downloading (100%)         
  - Installing willdurand/jsonp-callback-validator (v1.1.0): Downloading (connecting...Downloading (100%)         
  - Installing willdurand/negotiation (1.5.0): Downloading (100%)         
  - Installing friendsofsymfony/rest-bundle (1.7.7): Downloading (100%)         
  - Installing caseboxdev/rest-bundle (dev-master 2be608c):Downloading (100%)         )
  - Installing guzzlehttp/promises (v1.3.1): Downloading (100%)         
  - Installing psr/http-message (1.0.1): Downloading (100%)         
  - Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)         
  - Installing guzzlehttp/guzzle (6.3.0): Downloading (100%)         
  - Installing satooshi/php-coveralls (dev-master aa9b714):Downloading (100%)         )
  - Installing sabre/uri (1.2.1): Downloading (100%)         
  - Installing sabre/xml (1.5.0): Downloading (100%)         
  - Installing sabre/vobject (4.1.2): Downloading (100%)         
  - Installing sabre/event (3.0.0): Downloading (100%)         
  - Installing sabre/http (4.2.3): Downloading (100%)        
  - Installing sabre/dav (3.2.0): Downloading (100%)         
  - Installing mrclay/minify (2.3.2): Downloading (100%)         
  - Installing kwi/urllinker (dev-default b5e097f): Downloading (100%)         
  - Installing reprovinci/solr-php-client (v1.0.3): Downloading (100%)         
  - Installing mistic100/randomcolor (1.0.3): Downloading (100%)         
  - Installing incenteev/composer-parameter-handler (v2.1.2): Downloading (connecting..Downloading (100%)         
  - Installing sensio/generator-bundle (v3.1.6): Downloading (100%)         
  - Installing php-imap/php-imap (2.0.3): Downloading (100%)         
  - Installing ezyang/htmlpurifier (v4.9.3): Downloading (100%)         
  - Installing ircmaxell/security-lib (v1.1.0): Downloading (100%)         
  - Installing ircmaxell/random-lib (v1.2.0): Downloading (100%)         
  - Installing league/oauth2-client (1.4.2): Downloading (100%)         
  - Installing league/oauth2-google (1.0.1): Downloading (100%)         
  - Installing php-curl-class/php-curl-class (3.6.7): Downloading (100%)         
  - Installing composer/ca-bundle (1.0.8): Downloading (100%)         
  - Installing sensiolabs/security-checker (v4.1.5): Downloading (100%)         
  - Installing sensio/distribution-bundle (v5.0.21): Downloading (100%)         
  - Installing monolog/monolog (1.23.0): Downloading (100%)         
  - Installing symfony/monolog-bundle (v2.12.1): Downloading (100%)         
  - Installing swiftmailer/swiftmailer (v5.4.8): Downloading (100%)         
  - Installing symfony/swiftmailer-bundle (v2.6.3): Downloading (100%)         
  - Installing doctrine/doctrine-cache-bundle (1.3.2): Downloading (100%)         
  - Installing jdorn/sql-formatter (v1.2.17): Downloading (100%)         
  - Installing doctrine/dbal (v2.6.2): Downloading (100%)         
  - Installing doctrine/doctrine-bundle (1.7.1): Downloading (100%)         
  - Installing doctrine/orm (v2.5.11): Downloading (100%)         
  - Installing sensio/framework-extra-bundle (v3.0.28): Downloading (100%)         
  - Installing predis/predis (v1.1.1): Downloading (100%)         
  - Installing caseboxdev/core-bundle (dev-master d068339):Downloading (100%)         )
  - Installing sebastian/version (2.0.1): Downloading (100%)         
  - Installing sebastian/resource-operations (1.0.0): Downloading (100%)         
  - Installing sebastian/recursion-context (1.0.5): Downloading (100%)         
  - Installing sebastian/object-enumerator (1.0.0): Downloading (100%)         
  - Installing sebastian/global-state (1.1.1): Downloading (100%)         
  - Installing sebastian/exporter (1.2.2): Downloading (100%)         
  - Installing sebastian/environment (1.3.8): Downloading (100%)         
  - Installing sebastian/diff (1.4.3): Downloading (100%)         
  - Installing sebastian/comparator (1.2.4): Downloading (100%)         
  - Installing phpunit/php-text-template (1.2.1): Downloading (100%)        
  - Installing phpunit/phpunit-mock-objects (3.1.3): Downloading (100%)         
  - Installing phpunit/php-timer (1.0.9): Downloading (100%)         
  - Installing phpunit/php-file-iterator (1.4.2): Downloading (100%)         
  - Installing sebastian/code-unit-reverse-lookup (1.0.1): Downloading (100%)         
  - Installing phpunit/php-token-stream (1.4.11): Downloading (100%)         
  - Installing phpunit/php-code-coverage (3.3.3): Downloading (100%)         
  - Installing webmozart/assert (1.2.0): Downloading (100%)         
  - Installing phpdocumentor/reflection-common (1.0.1): Downloading (100%)         
  - Installing phpdocumentor/type-resolver (0.4.0): Downloading (100%)         
  - Installing phpdocumentor/reflection-docblock (4.1.1): Downloading (100%)         
  - Installing phpspec/prophecy (v1.7.2): Downloading (100%)         
  - Installing myclabs/deep-copy (1.6.1): Downloading (100%)         
  - Installing phpunit/phpunit (5.3.5): Downloading (100%)         
  - Installing squizlabs/php_codesniffer (2.9.1): Downloading (100%)         
  - Installing escapestudios/symfony2-coding-standard (2.11.0): Downloading (connectingDownloading (100%)         
  - Installing pdepend/pdepend (2.5.0): Downloading (100%)         
  - Installing phpmd/phpmd (2.6.0): Downloading (100%)         
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
jms/serializer-bundle suggests installing jms/di-extra-bundle (Required to get lazy loading (de)serialization visitors, ~1.3)
sabre/vobject suggests installing hoa/bench (If you would like to run the benchmark scripts)
mrclay/minify suggests installing tubalmartin/cssmin (Support minify with CSSMin (YUI PHP port))
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing rollb  bar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
doctrine/doctrine-cache-bundle suggests installing symfony/security-acl (For using this bundle to cache ACLs)
sensio/framework-extra-bundle suggests installing symfony/psr-http-message-bridge (To use the PSR-7 converters)
predis/predis suggests installing ext-phpiredis (Allows faster serialization and deserialization of the Redis protocol)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.4.0)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Writing lock file
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Creating the "app/config/default/parameters.yml" file
Some parameters are missing. Please provide them.
core_name (default): 
locale (en): es
secret (null): 12345678
server_name (null): mydomain.com
prefix (cb): 
db_host (127.0.0.1): 
db_port (3306): 
db_name (null): casebox
db_user (null): casebox
db_pass (null): CSb/CjI#24917
solr_schema (http): 
solr_host (127.0.0.1): 
solr_port (8983): 
solr_core (null): 
solr_core_log (null): 
solr_username (null): 
solr_password (null): 
session.lifetime (4320): 
admin_email (null): user@mail.com
sender_email (null): user@mail.com
comments_pass (null): 
mailer_transport (smtp): 
mailer_host (127.0.0.1): 
mailer_user (null): 
mailer_password (null): 
convert_doc_unoconv_cmd ('/usr/bin/python3 /usr/bin/unoconv'): 
convert_doc_url ('http://convert.devops.site/document/convert'): 'http://mydomain.com/casebox/docs'
converter (api): unoconv
redis_host (127.0.0.1): 
redis_port (6379): 
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /var/www/casebox/vendor/symfony/monolog-bundle/DependencyInjection/Configuration.php on line 628

  [Doctrine\DBAL\DBALException]                                                        
  An exception occured while establishing a connection to figure out your platform version.  
  You can circumvent this by setting a 'server_version' configuration value            
  For further information have a look at:                                              
  https://github.com/doctrine/DoctrineBundle/issues/673                                

  [Doctrine\DBAL\Exception\ConnectionException]                                        
  An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'casebox'@'localhost' (using password: YES)  

  [Doctrine\DBAL\Driver\PDOException]                                                  
  SQLSTATE[HY000] [1045] Access denied for user 'casebox'@'localhost' (using password: YES)  

  [PDOException]                                                                       
  SQLSTATE[HY000] [1045] Access denied for user 'casebox'@'localhost' (using password: YES)                                                                           

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

Can anybody give me some help?

FranklinMayR commented 6 years ago

UPDATE

I've found the solution for the first error: Extend the permissions to the DB user to the localhost IP: GRANT ALL PRIVILEGES ON casebox.* TO 'casebox'@'127.0.0.1';

After that i ran again the composer update command and these are the results:

$sudo composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 0 updates, 0 removals
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/default/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

 // Clearing the cache for the default environment with debug false                                                     

 [OK] Cache for the "default" environment (debug=false) was successfully cleared.                                       

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets
PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /var/www/casebox/vendor/symfony/monolog-bundle/DependencyInjection/Configuration.php on line 628

 Trying to install assets as relative symbolic links.

 --- ------------------- ------------------ 
      Bundle              Method / Error    
 --- ------------------- ------------------ 
  ✔   FrameworkBundle     relative symlink  
  ✔   CaseboxCoreBundle   relative symlink  
 --- ------------------- ------------------ 

 [OK] All assets were successfully installed.                                                                           

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget
Deprecation Notice: The callback Casebox\CoreBundle\Composer\ScriptHandler::buildAssets declared at /var/www/casebox/vendor/caseboxdev/core-bundle/src/Composer/ScriptHandler.php accepts a Composer\Script\CommandEvent but post-update-cmd events use a Composer\Script\Event instance. Please adjust your type hint accordingly, see https://getcomposer.org/doc/articles/scripts.md#event-classes in phar:///usr/bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:316
> Casebox\CoreBundle\Composer\ScriptHandler::buildAssets
[x] CSS minify done.
[x] JS minify donesudo composer
rm: cannot remove ‘/var/www/casebox/app/../web/css’: No such file or directory
[*] Add '/var/www/casebox/app/../web/css' symlink.
[x] Symlink '/var/www/casebox/app/../web/css' added.
rm: cannot remove ‘/var/www/casebox/app/../web/files’: No such file or directory
[*] Add '/var/www/casebox/app/../web/files' symlink.
[x] Symlink '/var/www/casebox/app/../web/files' added.
rm: cannot remove ‘/var/www/casebox/app/../web/img’: No such file or directory
[*] Add '/var/www/casebox/app/../web/img' symlink.
[x] Symlink '/var/www/casebox/app/../web/img' added.
rm: cannot remove ‘/var/www/casebox/app/../web/js’: No such file or directory
[*] Add '/var/www/casebox/app/../web/js' symlink.
[x] Symlink '/var/www/casebox/app/../web/js' added.
rm: cannot remove ‘/var/www/casebox/app/../web/min’: No such file or directory
[*] Add '/var/www/casebox/app/../web/min' symlink.
[x] Symlink '/var/www/casebox/app/../web/min' added.
[x] Casebox assets installed.
Deprecation Notice: The callback Casebox\CoreBundle\Composer\ScriptHandler::buildTranslations declared at /var/www/casebox/vendor/caseboxdev/core-bundle/src/Composer/ScriptHandler.php accepts a Composer\Script\CommandEvent but post-update-cmd events use a Composer\Script\Event instance. Please adjust your type hint accordingly, see https://getcomposer.org/doc/articles/scripts.md#event-classes in phar:///usr/bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:316
> Casebox\CoreBundle\Composer\ScriptHandler::buildTranslations
[x] Translations exported.

$sudo php bin/console casebox:solr:create --env=default

  [GuzzleHttp\Exception\ServerException]                                              
  Server error: `GET http://127.0.0.1:8983/solr/admin/cores?action=CREATE&name=&configSet=casebox_log&wt=json` resulted in a `500 Server Error` response:
  {                                                                                   
    "responseHeader":{                                                                
      "status":500,                                                                   
      "QTime":46},                                                                    
    "error":{                                                                         
      "metadata":[                                                                    
        "error-class","org.apache.s (truncated...)                                    

casebox:solr:create [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

$sudo php bin/console casebox:solr:update --all=true --env=default

  [Exception]                             
  Solr_connection_error                   
   (127.0.0.1:8983 -> /solr/cb_default )  

casebox:solr:update [-a|--all [ALL]] [-l|--nolimit [NOLIMIT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

$sudo php bin/console ca:cl --env=default

 // Clearing the cache for the default environment with debug                          
 // false                                                                              

PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /var/www/casebox/vendor/symfony/monolog-bundle/DependencyInjection/Configuration.php on line 628
 [OK] Cache for the "default" environment (debug=false) was successfully cleared.

$sudo php bin/console casebox:min:assets --env=default
[x] CSS minify done.
[x] JS minify done
[x] Casebox assets installed.

Then, restarted Solr and Nginx and logged into casebox as root, this is the result:

Casebox @ GCE

Updates and/or suggestions please!!!!