SEPIA-Framework / sepia-docs

Documentation and Wiki for SEPIA. Please post your questions and bug-reports here in the issues section! Thank you :-)
https://sepia-framework.github.io/
237 stars 16 forks source link

How to set-up an apache vhost? #23

Closed DevDorrejo closed 4 years ago

DevDorrejo commented 4 years ago

Hello, i am looking how can i set up and apache vhost instead of Nginx?, thank you.

fquirin commented 4 years ago

Hi,

I'm not an expert for Apache web server but maybe this will help: https://github.com/SEPIA-Framework/sepia-docs/wiki/Reverse-Proxy-Setup#apache-http-server-example-setup-for-sepia

regards

DevDorrejo commented 4 years ago

Thank you.

Hi,

I'm not an expert for Apache web server but maybe this will help: https://github.com/SEPIA-Framework/sepia-docs/wiki/Reverse-Proxy-Setup#apache-http-server-example-setup-for-sepia

regards

i need to open the port of the proxy on my server and on my firewall?

fquirin commented 4 years ago

Do you want to access your SEPIA server from your local, private network or from "anywhere"? For internal networks there is usually no firewall stuff required unless your system has some specific settings. For access from outside you need to forward port 20726 (default port for the proxy) inside your network router and point it to your Apache machine. Here is a bit more info: https://github.com/SEPIA-Framework/sepia-docs/wiki/Network-Configurations

DevDorrejo commented 4 years ago

Hello, i have a VPS and do the next config:

Firewall: Open port 20726/tcp-udp 20727/tcp-udp, 80/tcp, 443/tcp

SEPIA-home root: /opt/sepia-server

Apacher-vhost:

Define LOCATION /opt/sepia-server
Define HOST sepiawedc.duckdns.org

ProxyPass /${LOCATION}/assist/ http://${HOST}:20721/
ProxyPass /${LOCATION}/teach/ http://${HOST}:20722/

<Location /${LOCATION}/chat/>
ProxyPass http://${HOST}:20723/

RewriteEngine On
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule /messages/(.*) ws://${HOST}:20723/messages/$1 [P]
</Location>

but cant connect the app

sepia-assistant commented 4 years ago

Hi,

as I said I'm not very experienced with Apache but looking at your configuration I see 2 potential issues. The LOCATION field is (to my understanding ... I could be wrong here) not related to the physical location of the files but defines the URL path, e.g. http://localhost:20726/LOCATION/assist/app/index.html . It should be set to LOCATION sepia as seen in the example.

The actual physical path of your SEPIA folder should be ~/SEPIA otherwise the start scripts might not work properly (shame on me but there are 2-3 places where ~/SEPIA is hardcoded in the .sh files). Can you confirm that the server actually starts?

DevDorrejo commented 4 years ago

Hi,

as I said I'm not very experienced with Apache but looking at your configuration I see 2 potential issues. The LOCATION field is (to my understanding ... I could be wrong here) not related to the physical location of the files but defines the URL path, e.g. http://localhost:20726/LOCATION/assist/app/index.html . It should be set to LOCATION sepia as seen in the example.

The actual physical path of your SEPIA folder should be "~/SEPIA" otherwise the start scripts might not work properly (shame on me but there are 2-3 places where "~/SEPIA" is hardcoded in the .sh files). Can you confirm that the server actually starts?

Yes, when i exec the run, everything is OK.

Changed all files to point to where i store the folder (/opt/sepia-server), and open all the port from 20720-20727.

now is working, http://sepiawedc.duckdns.org:20721/tools/index.html

but what is the default user, i change the user password to 12345678, but every time said wrong password or user:

username: admin password: 12345678

2: Define new admin and assistant passwords

Please define safe passwords for SEPIA admin and assistant (and remember them well!). Use AT LEAST 8 characters and combine lower/upper case letters with numbers and special characters: Admin: 12345678 Assistant: 12345678

Creating admin... 2020-03-02 16:18:27 LOG - Stored new password in database for: admin@sepia.localhost 2020-03-02 16:18:27 LOG - Stored new password in config: ../sepia-assist-server/Xtensions/assist.custom.properties

Creating assistant user... 2020-03-02 16:18:27 LOG - Stored new password in database for: assistant@sepia.localhost 2020-03-02 16:18:27 LOG - Stored new password in config: ../sepia-assist-server/Xtensions/assist.custom.properties

DONE

image

New Config:

Apache: image

Firewalld: image

./sepia-status.sh: image

sepia-assistant commented 4 years ago

Changed all files to point to where i store the folder (/opt/sepia-server), and open all the port from 20720-20727.

now is working, [...]

but what is the default user, i change the user password to 12345678, but every time said wrong password or user:

username: admin password: 12345678

Hi, glad to hear its working now! The default admin username is admin@sepia.localhost (including the @.. part) or uid1003. The UID might change when you reset the password but the pseudo email address should always stay the same. The first thing you should do after a successful setup is to create a new non-admin user as mentioned here.

DevDorrejo commented 4 years ago

Changed all files to point to where i store the folder (/opt/sepia-server), and open all the port from 20720-20727. now is working, [...] but what is the default user, i change the user password to 12345678, but every time said wrong password or user: username: admin password: 12345678

Hi, glad to hear its working now! The default admin username is admin@sepia.localhost (including the @.. part) or uid1003. The UID might change when you reset the password but the pseudo email address should always stay the same. The first thing you should do after a successful setup is to create a new non-admin user as mentioned here.

Thank you can access now, but have the next issue when creating the user:

image

sepia-assistant commented 4 years ago

Ah yes, this is a security "feature" ^^. "not allowed to access server from outside the private network" means that certain actions in the Control-HUB are only allowed when you are in the local network of the server (e.g. IPs 192.168....). You have 2 options:

DevDorrejo commented 4 years ago

Thank you, i created a user, how can i get info of the uid?, i put the password, but forget it immediately XD, and how can i manage the db? or can i change to mysql o postgresql?

sepia-assistant commented 4 years ago

=) If you remember the email address (fake or real) you've used to create the user you can use it to login and check on settings page 3 what your UID is. In your SEPIA folder there is a script as well: SEPIA/scripts/get-es-user-stats.sh that should give you email and UID of all users if I remember correct ;-) MySQL or PostreSQL are not supported at the moment. SEPIA itself will require Elasticsearch to run. There is an alternative module for user accounts using DynamoDB, but that hasn't been tested for a while. In theory it could be replaced by any DB ... with some effort ^^

DevDorrejo commented 4 years ago

ok, thank you.

sepia-assistant commented 4 years ago

I've built a new function into the SEPIA Control HUB to check the existing user accounts, stay tuned for SEPIA v2.5.0 ;-)

DevDorrejo commented 4 years ago

Ok, thank you very much.