nuxsmin / sysPass

Systems Password Manager
https://syspass.org
GNU General Public License v3.0
972 stars 207 forks source link

Problems in the last phase installing syspass 3.0 #1087

Closed M1k13 closed 5 years ago

M1k13 commented 5 years ago

Hey Ruben,

Your syspass works great when i fallow your installation instructions but im trying not to use the repositories from ius. Using Centos7 This is what i did:

!bin/bash

cd ~ yum -y install bash-completion.noarch epel-release.noarch centos-release-scl centos-release-scl-rh scl-utils

yum -y install httpd mariadb-server mariadb rh-php70 sclo-php70-php-mcrypt rh-php70-php-ldap rh-php70-php-xml rh-php70-php-json rh-php70-php-gd rh-php70-php-pdo rh-php70-php-mbstring rh-php70-php-fpm.x86_64 rh-php70-php-cli rh-php70-php-mysqlnd mod_ssl wget

systemctl enable httpd.service systemctl start httpd.service

systemctl enable mariadb.service systemctl start mariadb.service

/usr/bin/mysql_secure_installation

wget https://github.com/nuxsmin/sysPass/archive/3.0.0.18040302-beta.tar.gz

wget https://github.com/nuxsmin/sysPass/archive/3.0.0.18100801-beta.tar.gz

cp .tar.gz /var/www/html/ cd /var/www/html/ tar -xzf .tar.gz

mv */ syspass

chmod -R 750 /var/www/html/syspass/ chown -R apache:apache /var/www/html/syspass/

echo "ProxyPassMatch ^/(..php(/.)?)$ fcgi://127.0.0.1:9000/var/www/html/\$1" >> /etc/httpd/conf/httpd.conf echo "DirectoryIndex /index.php index.php" >> /etc/httpd/conf/httpd.conf

systemctl restart httpd

yum -y install composer.noarch

cd /var/www/html/syspass

scl enable rh-php70 bash

systemctl enable rh-php70-php-fpm.service

service rh-php70-php-fpm start

composer install

shutdown -r now

At the end it gives me 2 errors when i try to install it and when i run the error log it says:

[Thu Oct 25 12:50:54.925554 2018] [proxy_fcgi:error] [pid 3178] [client 10.5.112.71:50169] AH01071: Got error 'Primary script unknown\n', referer: http://*********/syspass/index.php?r=install/index

any advice?

M1k13 commented 5 years ago

Oke I found out what I did wrong, if you like a I can submit the install script for you.

nuxsmin commented 5 years ago

Fine, it would be helpful for others, as I could pulish the script in he documentation.

Thanks!

M1k13 commented 5 years ago

Im still kinda new with scripts but it works great as an instalation guide and pls change/swap stuff around if you think its beter. First one is for httpd and second one is for nginx.

HTTPD:

!bin/bash

cd ~ yum -y install bash-completion.noarch epel-release.noarch centos-release-scl centos-release-scl-rh scl-utils

yum -y install httpd mariadb-server mariadb rh-php70 rh-php70-php sclo-php70-php-mcrypt rh-php70-php-ldap rh-php70-php-xml rh-php70-php-json rh-php70-php-gd rh-php70-php-pdo rh-php70-php-mbstring rh-php70-php-cli rh-php70-php-mysqlnd composer.noarch mod_ssl wget

systemctl enable httpd.service systemctl start httpd.service

systemctl enable mariadb.service systemctl start mariadb.service

/usr/bin/mysql_secure_installation <<EOF

y password password n n n n EOF

ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php70-php.conf /etc/httpd/conf.d/ ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php70-php.conf /etc/httpd/conf.modules.d/ ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php70-php7.so /etc/httpd/modules/

wget https://github.com/nuxsmin/sysPass/archive/3.0.0.18040302-beta.tar.gz

wget https://github.com/nuxsmin/sysPass/archive/3.0.0.18100801-beta.tar.gz

cp .tar.gz /var/www/html/ cd /var/www/html/ tar -xzf .tar.gz

rm -f 3.0.0.18100801-beta.tar.gz mv */ syspass

cd /var/www/html/syspass scl enable rh-php70 bash

composer install

cd /var/www/html/syspass cp -rf * /var/www/html chmod -R 750 /var/www/html/ chown -R apache /var/www/html/

systemctl restart httpd

cd /var/www/html/syspass

sed '/DirectoryIndex index.html/s/$/ index.php/' /etc/httpd/conf/httpd.conf

systemctl restart httpd

shutdown -r now

NGINX: cd ~ yum -y install bash-completion.noarch epel-release.noarch centos-release-scl centos-release-scl-rh scl-utils

install webserver(NGINX),php70,database(mariadb) and composer

yum -y install nginx mariadb-server mariadb rh-php70 rh-php70-php rh-php70-php-fpm sclo-php70-php-mcrypt rh-php70-php-ldap rh-php70-php-xml rh-php70-php-json rh-php70-php-gd rh-php70-php-pdo rh-php70-php-mbstring rh-php70-php-cli rh-php70-php-mysqlnd composer.noarch mod_ssl wget

enable and start NGINX

service nginx start service nginx enable

comment the next lines in /etc/nginx/nginx.conf

server {

listen 80 default_server;

listen [::]:80 default_server;

servername ;

root /usr/share/nginx/html;

Load configuration files for the default server block.

include /etc/nginx/default.d/*.conf;

location / {

}

error_page 404 /404.html;

location = /40x.html {

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

}

}

restart NGINX

systemctl restart nginx systemctl enable nginx

add syspass.conf and paste a new NGINX server block in the file

vim /etc/nginx/conf.d/syspass.conf server { listen 80; server_name syspass20.promea.tds.hq.org;

location / { root /var/www/syspass; index index.html index.php; try_files $uri $uri/ =404; }

error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ .php$ { root /var/www/syspass; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_NAME \$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

}

}

server_name: This is the domain you will be using for your site. Instead of localhost, we will use the public facing domain and www version of the domain you want to use.

root: This is the root directory for the site files.

try_files: What we are doing here is telling the server to display a 404 error when a given file is not found.

Restart NGINX

systemctl restart nginx

configure php.ini

vim /etc/opt/rh/rh-php70/php-fpm.d/www.conf sudo sed -i 's/user = apache/user = nginx/g' /etc/opt/rh/rh-php70/php-fpm.d/www.conf sudo sed -i 's/group = apache/group = nginx/g' /etc/opt/rh/rh-php70/php-fpm.d/www.conf

Add nginx to group apache(allows write to session.save_path)

usermod -aG nginx apache

systemctl enable rh-php70-php-fpm

systemctl enable mariadb.service systemctl start mariadb.service

/usr/bin/mysql_secure_installation <<EOF

y password password y y y y EOF

Download syspass

wget https://github.com/nuxsmin/sysPass/archive/3.0.0.18100801-beta.tar.gz

unpack syspass and place it in the right path

cd /var/www tar -xzf 3.0.0.18100801-beta.tar.gz mv sysPass-3.0.0.18100801-beta/ syspass rm -rf 3.0.0.18100801-beta.tar.gz

set the permissons

chmod -R 750 /var/www/syspass/ chown -R nginx /var/www/syspass/

restart NGINX and start/enable php-fpm

systemctl restart nginx scl enable rh-php70 bash systemctl enable rh-php70-php-fpm.service service rh-php70-php-fpm start

go to the syspass directory and run composer

cd /var/www/syspass composer install

shutdown -r now

On 31 Oct 2018, at 07:53, RubénD notifications@github.com wrote:

Fine, it would be helpful for others, as I could pulish the script in he documentation.

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nuxsmin/sysPass/issues/1087#issuecomment-434580594, or mute the thread https://github.com/notifications/unsubscribe-auth/Ap-3So9as3sYJryzqC2MWAS2kwUSARATks5uqUkFgaJpZM4X7tsc.

nuxsmin commented 5 years ago

I'll keep this opened as documentation reminder

nuxsmin commented 5 years ago

Done :wink:

https://syspass-doc.readthedocs.io/en/3.1/howtos/nginx.html