ip publica school tool and Google Cloud

Asked by Christian Tipantuna

estimados he instalado satisfactoriamente school tool bajo ubuntu 14.04 y también edite el archivo /etc/schooltool/standard/paste.ini para cambiar el host a 0.0.0.0 pero no puedo acceder desde a la aplicación con la ip publica de mi servidor.

El apache lo veo correctamente http://50.56.176.79/ pero si lo cambio a http://50.56.176.79:7080/ no logra abrir school tool. Por favor su ayuda. Mil Gracias

Question information

Language:
English (United States) Edit question
Status:
Solved
For:
SchoolTool Edit question
Assignee:
No assignee Edit question
Solved by:
Christian Tipantuna
Solved:
Last query:
Last reply:
Revision history for this message
Douglas Cerna (replaceafill) said :
#1

Hola Cristian.

Asegúrese de reiniciar el servicio de SchoolTool luego de haber editado paste.ini:

$ sudo service schooltool restart

Y que después esté corriendo correctamente (cuatro servicios deben decir RUNNING):

$ sudo service schooltool status
schooltool RUNNING pid ...
services:celery_report RUNNING pid ...
services:redis RUNNING pid ...
services:zeo RUNNING pid ...

Por último, vea si no hay algún firewall instalado en el servidor que impida el tráfico de alguna manera (esto es lo que "iptables" lista en uno de los servidores de desarrollo indicando que nada se filtra):

$ sudo iptables --list

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Espero esto le sirva.

Revision history for this message
Christian Tipantuna (ctipantuna) said :
#2

excelente muchas gracias, funcionó después de añadir la siguiente línea:

sudo iptables -A INPUT -p tcp --dport 7080 -j ACCEPT

Revision history for this message
Christian Tipantuna (ctipantuna) said :
#3

excelente muchas gracias, funcionó después de añadir la siguiente línea:

sudo iptables -A INPUT -p tcp --dport 7080 -j ACCEPT

Revision history for this message
Francisco Cortes (kornho) said :
#4

english

Hi

I find myself also facing the same difficulty expressed by christian in his first post
I got apache working, 4 running services working, paste.ini file changed as needed, yet I can't connect to the server remotely on http://external-ip:7080
my server is a vm instance in google cloud running ubuntu-1404-trusty-v20141212
services, iptables and paste.ini showing below
what am I missing?

spanish

Hola

me encuentro con la misma dificultad expuesta por christian
mi servidor es un vm en google cloud con ubuntu-1404-trusty-v20141212
apache esta instalado y trabajando y puedo ver la pagina por defecto del servidor en la direccion ip pero
la pagina de schooltool no carga
services, iptables and paste.ini se muestran abajo
que me esta faltando

************************

@ubuntu4schooltool:~$ sudo service schooltool status
schooltool RUNNING pid 2743, uptime 0:14:51
services:celery_report RUNNING pid 2742, uptime 0:14:51
services:redis RUNNING pid 2740, uptime 0:14:51
services:zeo RUNNING pid 2741, uptime 0:14:51

*************************

ubuntu4schooltool:~$ sudo iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
sshguard all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:7080
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:7080

*************************

[composite:main]
use = egg:Paste#urlmap
/ = schooltool
/schooltool.task_results = task_results
[app:schooltool]
use = egg:schooltool#main
config_file=schooltool.conf
[app:task_results]
use = egg:schooltool#task_results
config_file=schooltool.conf
[server:main]
use = egg:zope.server
host = 0.0.0.0
port = 7080

Revision history for this message
Douglas Cerna (replaceafill) said :
#5

La configuración del paste.ini me parece correcta. No tengo experiencia con Google Cloud, pero pienso que puede tratarse de un bloqueo propio de la plataforma. Es decir, hay que habilitar el puerto 7080 desde la interfaz de control (como se hace con los grupos de seguridad en las consolas de administración EC2 de Amazon).

Google me refiere a:

http://stackoverflow.com/questions/21065922/how-to-open-a-specific-port-such-as-9090-in-google-compute-engine
https://cloud.google.com/compute/docs/protocol-forwarding/

Una alternativa es usar Apache (que según entiendo en la documentación de Google Cloud está habilitado por defecto) con SchoolTool como se explica en:

http://book.schooltool.org/apache.html

Revision history for this message
Francisco Cortes (kornho) said :
#6

Still no joy // nada que lo puedo poner accessible remotamente.

- I tried to open port 7080 // intente abrir puerto 7080

gcloud compute firewall-rules create allow-http --allow tcp:7080

- I tried to forward tcp:7080 to my instance called 'schooltool4icinstance'

$ gcloud compute forwarding-rules create schooltoolrule --region us-central1 --ip-protocol TCP --port-range 7080 --target-instance schooltool4icinstance

...and after this command I ended with 2 external ip's I tried with the original:7080 and the newip:7080 but it wouldn't load with either.
... y despues de este comando google me dejo con dos ip externas, intente cargar schooltool con ambas en el puerto por defecto pero ningun sirvio

will try the apache option and I'll report back // voy a intentar con apache y reporto cualquier cosa

ps. cargue un pc en donde tengo ubuntu y fue supreamente sencilllo ponerlo con acceso remoto (dentro de la red local), no entiendo porque con google es tan complicado. // I got working on pc and remote access within the network took 5 seconds to setup, I don't get it what it is so complicated on a google cloud. it shouldn't be

Gracias Douglas.

Revision history for this message
Francisco Cortes (kornho) said :
#7

***** english ******
Hello

Last night I tried to setup Apache to forward request to localhost:7080 on my ubuntu "instance" in gcloud and I finally got it working
this is what I did:

1. I did change the "paste.ini" to "host 0.0.0.0" and removed any firewall rules and forwarders (they didn't work as indicated in my previous post)

2. I went into the instance using gcloud compute ssh <instance_name> to issue to work remotely on the "instance console", although you could possibly do it to from the "ssh option" from "google cloud"

3. on the "instance console" I installed apache :
sudo apt-get install apache2
and confirm apache is working

4. on the "instance console" I followed the instruccionts on http://book.schooltool.org/apache.html but with a few tweaks:
I created a file under /etc/apache2/sites-available/<file_name>.conf (the .conf at the end is needed otherwise the sudo a2ensite ... command will not work)

5. I enter the expected configuration on the file as indicated in on http://book.schooltool.org/apache.html with a few changes:
<external instance ip address> as I don't have a domain name pointed to the instance.
"
<VirtualHost *:80>
  ServerName <external instance ip address>

  <Proxy *>
      order allow,deny
      allow from all
      deny from none
  </Proxy>

  ProxyPreserveHost on
  RewriteEngine On

  RewriteRule ^/schooltool.task_results(/?.*) http://127.0.0.1:7080/schooltool.task_results/$1 [P,L]
  RewriteRule ^(/?.*) http://127.0.0.1:7080/++vh++http:<external instance ip address>:80/++$1 [P,L]

</VirtualHost>
"
6. I added this line in etc/host

127.0.0.1 <external instance ip address>

* I don't know if this step is needed but that's how I have it at this time. try it without and let me know

7. change the apache2.conf:
find this line:
IncludeOptional sites-enabled/*.conf
a change into this:
IncludeOptional sites-enabled/*
then save

7. Issue the commands
$ sudo a2enmod proxy
$ sudo a2enmod proxy_http
$ sudo a2enmod rewrite
and made sure the modules were enabled. If you run into some issues with the locale, this command helped: "sudo locale-gen en_CA.UTF-8" (I'm in canada so I used en_CA, I think you can also use en_US.UTF-8 I guess

and then

$ sudo a2ensite <file_name>.conf
$ sudo service apache2 restart

and lo and behold ... went to the browser.. point it to my instance's ip address (no :7080) and schooltool loaded!!!!!

now the real test begins!!..

Thank you Douglas for the recommendations

****** spanish *****

hola

Anoche intenté configurar Apache para reenviar la solicitud a localhost: 7080 en mi ubuntu "instancia" en gcloud y finalmente conseguí que trabajara
esto es lo que hice:

1. si cambie _ "paste.ini" a "host 0.0.0.0" y quité las reglas y transitarios firewall (que no funcionan como se indica en mi post anterior)

2. Fui a la instancia utilizando gcloud compute ssh <nombre_instancia> para trabajar de forma remota en la "consola de instancia", a pesar de lo que pueda hacerlo a from la "opción ssh" de "google nube"

3. en la "consola de instancia" He instalado apache:
sudo apt-get install apache2
y confirmar apache está trabajando

4. en la "consola de instancia" Seguí las instruccionts en http://book.schooltool.org/apache.html pero con algunos retoques:
He creado un archivo bajo /etc/apache2/sites-available/<file_name>.conf (se necesita el .conf en el extremo de lo contrario el sudo a2ensite ... comando no funcionará)

5. entro en la configuración prevista en el archivo como se indica en el http://book.schooltool.org/apache.html con algunos cambios:
<dirección ip instancia externa> como no tengo un nombre de dominio señalado a la instancia.
"
<VirtualHost *: 80>
   ServerName <instancia externa dirección IP>

   <Proxy *>
       order allow,deny
       allow from all
       deny from none
   </ Proxy>

   ProxyPreserveHost en
   RewriteEngine On

   RewriteRule ^ / schooltool.task_results (/?.*) http://127.0.0.1:7080/schooltool.task_results/$1 [P, L]
   RewriteRule ^ (/?.*) http://127.0.0.1:7080/++vh++http:<external dirección ip instancia>: 80 / ++ $ 1 [P, L]

</ VirtualHost>
"
6. He añadido esta línea en etc / host

127.0.0.1 <instancia externa dirección IP>

* No sé si es necesario este paso, pero así es como lo tengo en este momento. probarlo sin y quiero saber

7. _ apache2.conf:
encontrar esta línea:
Sites-enabled IncludeOptional / *. Conf
un cambio en esto:
Sites-enabled IncludeOptional / *
a continuación, guarde

7. Emita los comandos
$ sudo a2enmod sudo
$ sudo a2enmod proxy_http
$ sudo a2enmod rewrite
y se aseguró de los módulos fueron habilitados. Si se encuentra con algunos problemas con la configuración regional, este comando ayudó: "sudo locale-gen en_CA.UTF-8" (estoy en Canadá, así que utiliza en_CA, creo que también se puede utilizar en_US.UTF-8 Supongo

y luego

$ sudo a2ensite <nombre_archivo> .conf
$ sudo restart apache2 servicio

y de repente ... fui al navegador .. apunte a la dirección de mi ejemplo ip (no: 7080) y SchoolTool cargo !!!!!

ahora empieza la verdadera prueba !! ..

Gracias Douglas de las recomendaciones