TACTIC Open Source
Some difficulty installing v4.7.0.b02 in Ubuntu Server 18.04 LTS AWS EC2 instance - Printable Version

+- TACTIC Open Source (http://forum.southpawtech.com)
+-- Forum: TACTIC Open Source (http://forum.southpawtech.com/forumdisplay.php?fid=3)
+--- Forum: TACTIC Discussion (http://forum.southpawtech.com/forumdisplay.php?fid=4)
+--- Thread: Some difficulty installing v4.7.0.b02 in Ubuntu Server 18.04 LTS AWS EC2 instance (/showthread.php?tid=117)

Pages: 1 2


RE: Some difficulty installing v4.7.0.b02 in Ubuntu Server 18.04 LTS AWS EC2 instance - remkonoteboom - 05-22-2020

Also, for those of you just trying to run TACTIC and give it a try, you don't have to go through the entire Apache setup. A full featured webserver is highly recommended for a production server, but it is not strictly necessary just to give TACTIC a try. TACTIC runs on top of CherryPy, which is, in itself, a webserver.

So, in order to run TACTIC, all you have to do is go to <TACTIC_INSTALL_DIR>/src/bin

# python3 startup_dev.py -s <IP_or_DOMAIN> -p <PORT>

This will run TACTIC in dev mode and all output will go to the command line.

Just go to the browser:

http://<IP_or_DOMAIN>:<PORT>/tactic/

This is not only great for debugging, but it allows you see TACTIC without the need for Apache set and all of its headaches. You have access to all of TACTIC functionality and can setup at will and delay until you actually need to deploy to a real server for production to set up Apache.


RE: Some difficulty installing v4.7.0.b02 in Ubuntu Server 18.04 LTS AWS EC2 instance - FordSubmariner - 05-25-2020

(05-20-2020, 02:02 AM)remkonoteboom Wrote: The logs should give some more information.  From what I see, that you have looks correct.  Note that this is the apache direct that you do want to use: <Directory "/home/apache/tactic" >

It may also be file permissions.  The user www-data is not usually a user you can log in to, but you can temporarily change that in the /etc/passwd file:

For example (for an apache user):

apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin

you can switch it to:

apache:x:48:48:Apache:/usr/share/httpd:/bin/bash

This will allow you to su from root user:

# su apache
(in your case, it would be www-data).

Then try to navigate to the context folder and see if the user is permitted.

Thank you again. Smile

I login as "www-data" like this (after initially logging in as the AWS initial user):

$ sudo su -s /bin/bash www-data

I think that comes from TACTIC documentation. Using the shell, I am able to navigate to the context folder as www-data:

$ sudo su -s /bin/bash www-data
www-data@x.x:/home/ubuntu$ cd /home/apache/tactic
www-data@x.x:/home/apache/tactic$ ls
3rd_party  LICENSE  README.md  VERSION doc  epl-v10.html  src
www-data@x.x:/home/apache/tactic$ whoami
www-data
www-data@x.x:/home/apache/tactic$ cd src
www-data@x.x:/home/apache/tactic/src$ ls
__init__.py   client  context install  pyasm       test
asset_security.py  config  contrib java tactic
bin   config2  deprecated plugins  tactic_sites
www-data@x.x:/home/apache/tactic/src $ cd context
www-data@x.x:/home/apache/tactic/src/context$ ls
VERSION      client   icons  javascript  style       test utility
VERSION_API  favicon.ico  images  spt_js      tactic_logo.png  themes2
www-data@x.x:/home/apache/tactic/src/context$ ls -l
total 56
-rw-rw-r--  1 www-data root    9 Dec  5 18:47 VERSION
-rw-rw-r--  1 www-data root    9 Dec  5 18:47 VERSION_API
drwxrwxr-x  4 www-data root 4096 Dec  5 18:47 client
-rw-rw-r--  1 www-data root  894 Dec  5 18:47 favicon.ico
drwxrwxr-x 14 www-data root 4096 Dec  5 18:47 icons
drwxrwxr-x  2 www-data root 4096 Dec  5 18:47 images
drwxrwxr-x  2 www-data root 4096 Dec  5 18:47 javascript
drwxrwxr-x 14 www-data root 4096 Dec  5 18:47 spt_js
drwxrwxr-x  2 www-data root 4096 Dec  5 18:47 style
-rw-rw-r--  1 www-data root 5132 Dec  5 18:47 tactic_logo.png
drwxrwxr-x  2 www-data root 4096 Dec  5 18:47 test
drwxrwxr-x  4 www-data root 4096 Dec  5 18:47 themes2
drwxrwxr-x  3 www-data root 4096 Dec  5 18:47 utility
www-data@x.x:/home/apache/tactic/src/context$

Does all this look like it should to you?


RE: Some difficulty installing v4.7.0.b02 in Ubuntu Server 18.04 LTS AWS EC2 instance - remkonoteboom - 05-26-2020

Yes, this looks like it should. Can you now run TACTIC (as user apache) from the command line:

First stop apache so it frees up port 80


cd /home/apache/tactic/src/bin
python startup_dev.py -p 80 -s <IP_OR_DOMAIN>

This will run TACTIC without apache:

http://<IP_OR_DOMAIN>/tactic/

You can use any port, but then you would have to make sure that port is open. If you can see all the images, then this is an Apache config issue (which I believe it is anyway).

Also look at the Apache logs: for Ubuntu, I believe they are located in:

/var/log/apache2/error.log

And find any permission denied lines.


RE: Some difficulty installing v4.7.0.b02 in Ubuntu Server 18.04 LTS AWS EC2 instance - FordSubmariner - 05-28-2020

ubuntu@x.x:~$ lynx http://localhost
[this did connect to apache]
ubuntu@x.x2:~$ sudo systemctl stop apache2
ubuntu@x.x:~$ lynx http://localhost

Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/
ubuntu@x.x:~$ sudo su -s /bin/bash www-data
www-data@x.x:/home/ubuntu$ cd /home/apache/tactic/src/bin
www-data@x.x:/home/apache/tactic/src/bin$ python3 startup_dev.py -p 80 -s http://x.x

Data Directory [/home/apache/tactic_data]
Asset Directory [/opt/tactic/assets]
Temp Directory [/opt/tactic/tactic_temp]
Config path [/home/apache/tactic_data/config/tactic-conf.xml]
Registering project ... admin
Registering project ... default
Initializing Workflow Engine
Starting Scheduler ....

Starting TACTIC v4.7.0.b02 ...
[But should it stay running and hang on to the command prompt (as a foreground process)? Instead, it immediately returned the command line as shown below... I tried connecting using a remote browser to the http://x.x/tactic URL but nothing is listening on port 80, and the browser found no connection.]
www-data@x.x:/home/apache/tactic/src/bin$
www-data@x.x:/home/apache/tactic/src/bin$ ps aux|grep startup_dev
www-data 22354  0.0  0.1  14856  1100 pts/0    S+  10:35  0:00 grep startup_dev
www-data@x.x:/home/apache/tactic/src/bin$
$ netstat -lpn|grep 80
(No info could be read for "-p": geteuid()=33 but you should be root.)
unix  2      [ ACC ]    STREAM    LISTENING    12801    -                    /run/lvm/lvmpolld.socket
www-data@x.x:/home/apache/tactic/src/bin$ exit
ubuntu@x.x:~$ sudo netstat -lpn|grep 80
unix  2      [ ACC ]    STREAM    LISTENING    12801    1/init              /run/lvm/lvmpolld.socket


$ sudo systemctl start apache2
ubuntu@x.x:~$ sudo netstat -lpn|grep 80
tcp6      0      0 :::80                  :::*                    LISTEN      22405/apache2     
unix  2      [ ACC ]    STREAM    LISTENING    12801    1/init              /run/lvm/lvmpolld.socket
ubuntu@x.x:~$


RE: Some difficulty installing v4.7.0.b02 in Ubuntu Server 18.04 LTS AWS EC2 instance - remkonoteboom - 05-28-2020

If TACTIC (or rather the underlying CherryPy module) exits immediately, that means it cannot bind to that port. CherryPy is pretty sensitive to the domain name that is passed through. It may be the "http://" part after -s

Try:

python3 startup_dev.py -p 80 -s <DOMAIN_NAME>

withouth the "http://" on the domain name.


RE: Some difficulty installing v4.7.0.b02 in Ubuntu Server 18.04 LTS AWS EC2 instance - FordSubmariner - 05-30-2020

(05-28-2020, 01:52 PM)remkonoteboom Wrote: If TACTIC (or rather the underlying CherryPy module) exits immediately, that means it cannot bind to that port.  CherryPy is pretty sensitive to the domain name that is passed through.  It may be the "http://" part after -s

Try:

python3 startup_dev.py -p 80 -s <DOMAIN_NAME>

withouth the "http://" on the domain name.

Thank you, and good catch, to have noticed that I mistakenly included http:// in my command. I made that attempt early in the morning before going to work, and my brain was apparently not yet fully engaged. :/

However, I've retried several times this morning (Saturday, so no time constraints), following your original instructions (python startup_dev.py -p 80 -s <IP_OR_DOMAIN>).

I stopped apache, verified that no process is listening on port 80 (using lpn and also trying to connect to port 80 from a remote web browser). I verified that I'm using the correct hostname (that I've mapped to the correct IP address), and I've tried invoking:

python3 startup_dev.py -p 80 -s tactic.sootherapy.bid (correct hostname; NB no http:// in command line this time)
python3 startup_dev.py -p 80 -s sootherapy.bid (I am aware that sootherapy.bid maps to a different IP address than my host tactic.sootherapy.bid; I just tried this to see if TACTIC or CherryPy would continue running, rather than exiting immediately, but still no joy)
python3 startup_dev.py -p 80 -s 18.191.182.243

All of these commands exit immediately. Sad

www-data@ip-172-31-24-182:/home/apache/tactic/src/bin$ python3 startup_dev.py -p 80 -s 18.191.182.243

Data Directory [/home/apache/tactic_data]
Asset Directory [/opt/tactic/assets]
Temp Directory [/opt/tactic/tactic_temp]
Config path [/home/apache/tactic_data/config/tactic-conf.xml]
Registering project ... admin
Registering project ... default
Initializing Workflow Engine
Starting Scheduler ....

Starting TACTIC v4.7.0.b02 ...

www-data@ip-172-31-24-182:/home/apache/tactic/src/bin$

You'll notice that the hostname as represented in /etc/hostname and present in the command prompt seems to indicate that the correct IP address for this server is 172.31.24.182, but that's actually incorrect (I verified this using ssh to try and login to that IP address; the correct IP address is indeed 18.191.182.243).

It's clear to me that this way of trying to get TACTIC to run bypasses apache config files (great idea for troubleshooting!), but it seems to still be processing some TACTIC config information (eg. /home/apache/tactic_data/config/tactic-conf.xml)? Perhaps I've unwittingly misconfigured TACTIC? I don't think I modified /home/apache/tactic_data/config/tactic-conf.xml at all, but I've been reviewing it just in case I did so and forgot, looking for filenames present in it that are not actually present at the paths given in that file).

I verified (using ls) that the directories (Data, Asset, Temp) and the Config path listed in the output from startup_dev.py are actually there. One thing I noticed:

This section of /home/apache/tactic_data/config/tactic-conf.xml:
<!-- external services -->
<services>
    <mailserver></mailserver>
    <python>python</python>
    <python_path></python_path>
    <render_submit_class></render_submit_class>
    <render_dispatcher></render_dispatcher>
    <system_class></system_class>
    <process_count>3</process_count>
    <thread_count>50</thread_count>
    <process_time_alive></process_time_alive>
</services>
...lists "python" as an external service. On this server, "python" invokes Python 2.7.17 (default, Apr 15 2020, 17:20:14) whereas "python3" invokes Python 3.6.9 (default, Apr 18 2020, 01:56:04). Could this be a problem for TACTIC or CherryPy?

Thank you for all the patient assistance you've been offering. I'm very grateful. Unfortunately though, these steps aren't working for me. By chance, any other suggestions? Does CherryPy require that the host be accessible via just the domain name (which is not the case for this server at this moment)?

I'd happily give you access to this server via ssh if you think that would help you help me troubleshoot this problem?

Thanks again. Smile