Coder Social home page Coder Social logo

nextcloud25-rh8-nginx-remiphp7.4's Introduction

Nextcloud25-RH8-NGINX-remiPHP7.4

This was a small project for a friend a while ago, they suggested I post it on GitHub...

I had built something similar for Apache first, but was curious about NGINX so I made this. I have built a reverse proxy with NGINX, but still don’t have a good understanding of all the nuances the NGINX requires, especially around the host configuration

So, please…without hesitation, give me feedback. More important, give me the best practice. I have no qualms with people showing and telling me how to better my limited knowledge.

Quote by Ram Dass: (or << Backtrack)
“The quieter you become, the more you can hear.”

Dependencies

Keep in mind of Internal and External DNS and rules on your routers\firewalls, assuming you want this to be public. Also note that the versions may be different, based on when you install

  • NextCloud Hub 3 (25.0.1)
  • Red Hat Enterprise Linux 8.7 (Ootpa)
  • Zend Engine v3.4.0,
  • Zend OPcache v7.4.30
  • nginx version: nginx/1.14.1
  • certbot 1.22.0
  • Ver 15.1 Distrib 10.3.35-MariaDB
  • ImageMagick 6.9.12-64 Q16 x86_64 17467

Installing\Executing

What I like to do for this is log in as root or sudo -i. then copy the script into the /tmp/ and then kick it off.
The first part of the script is for variables.
A few things to consider first:

SERVER STUFF

This is basically going to be your external DNS name for your website. Its what you will enter into the URL
SERVERNAME=ncloud.Your.Domain

CERT STUFF

The script creates a demo self-signed certificate and places it in
/etc/nginx/ssl/nextcloud.key
/etc/nginx/ssl/nextcloud.crt

If you do use the certbot, you may have to go back into:
/etc/nginx/conf.d/nextcloud.conf
and change the Cert location

The fields used to create the cert are:
COUNTRY=US
STATE=California
CITY=Malibu
ORG=FunInTheSun
ORG_UNIT=Nextcloud
CERTMAIL=[email protected]


The last line on the Script enables CertBot to create the SSL cert for the site. It is commented out, so make sure you have the External DNS setup properly and your firewall rules setup. CertBot also needs port 80 and 443. Please be careful how you setup your firewalls\NAT\Port forwarding

DB STUFF

This is the name of the database that will create for nextcloud
DBNAME=nextcloud

This is the username that is needed for the nextcloud database.
NOTE: This is not a nextcloud user account
USER=nextclouduser

This is the name of the nextcloud Admin user
ADMIN=admin

PASSWORD STUFF

Generates a random password for the root account of mariadb. You can change it if you wish
date +%s | sha256sum | base64 | head -c 16 > /tmp/.MARIADBPASSWORD

Generates a random password for the nextcloud user account in mariadb. You can change it if you wish
date +%s | sha256sum | base64 | head -c 16 >> /tmp/.APPPASSWORD

Generates a random password for the Nextcolud admin user account password. You can change it if you wish
date +%s | sha256sum | base64 | head -c 16 >> /tmp/.ADMINPASS

TRUSTED DOMAIN STUFF

If you try to log in and you get a "Trusted Domain error" you will have to add it. You can do that by editing
/var/www/html/nextcloud/config/config.php
you may have to add the domain name or IPs.

LANGUAGE STUFF

In this script the default language is EN for all the settings, so you may want to change that if you want. You can find that here:
/usr/share/nginx/nextcloud/config/config.php

CLEANING UP

When the script is done running it will remind you that there are passwords and scripts in the /tmp. Keep them there if you need them but do remember to clean house. If a bad actor popped into your server, they will have the key to your kingdom.

nextcloud25-rh8-nginx-remiphp7.4's People

Contributors

patchworkgnomes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.