2

I have built a flask application on my ubuntu desktop, within virtual environment.

However now I am attempting to upload it to a live ubuntu server 16.04.

I have installed all the dependencies and my enable site apache file looks like this;

<VirtualHost *:80>
                ServerName xx.xxx.xxx.xxx

                WSGIDaemonProcess /var/www/WebScraper/WebScraper user='user' group='group' threads=5
                WSGIScriptAlias / /var/www/WebScraper/webscraper.wsgi
                <Directory /var/www/WebScraper/WebScraper/>
                        WSGIProcessGroup WebScraper
                        WSGIApplicationGroup %{GLOBAL}
                        Order deny,allow
                        Allow from all
                </Directory>



</VirtualHost>

The x are my ip address for my server and I have replaced, the user and group with my user and group names.

My wsgi looks like this;

#!/usr/bin/python3
import sys
sys.path.insert(0,'/var/www/WebScraper/')


from WebScraper import app as application

But each time I type my ip address into the search bar, it returns this took too long

UPDATE

After reading the part at the bottom of docs here I have added the following to my wsgi file

#!/usr/bin/python3
import sys
activate_this = '/var/www/WebScraper/WebScraper/venv/bin/activate_this.py'
with open(activate_this) as file_:
        exec(file_.read(), dict(__file__=activate_this))
sys.path.insert(0,'/var/www/WebScraper/')


from WebScraper import app as application

UPDATE 2

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1417/mysqld     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1446/sshd       
tcp6       0      0 :::80                   :::*                    LISTEN      5902/apache2    
tcp6       0      0 :::22                   :::*                    LISTEN      1446/sshd 

UPDATE 3

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.0.4. Set the 'ServerName' directive globally to suppress this message
[Tue Mar 28 16:26:50.943638 2017] [wsgi:warn] [pid 5902] mod_wsgi: Compiled for Python/3.5.1+.
[Tue Mar 28 16:26:50.943644 2017] [wsgi:warn] [pid 5902] mod_wsgi: Runtime using Python/3.5.2.
[Tue Mar 28 16:26:50.943835 2017] [mpm_prefork:notice] [pid 5902] AH00163: Apache/2.4.18 (Ubuntu) mod_wsgi/4.3.0 Python/3.5.2 configured -- resuming normal operations
[Tue Mar 28 16:26:50.943844 2017] [core:notice] [pid 5902] AH00094: Command line: '/usr/sbin/apache2'
mp252
  • 161
  • Is there a firewall? – pa4080 Mar 28 '17 at 16:03
  • no, no firewall – mp252 Mar 28 '17 at 16:06
  • It sounds like apache isn't running, you should at least get an error. What do you get from the following commands: sudo netstat -lptn and sudo service apache2 status – wildintellect Mar 28 '17 at 16:16
  • @wildintellect Above is the output. I ran sudo service apache2 status and got the green light it is running, so not sure what the problem is – mp252 Mar 28 '17 at 16:24
  • check the apache logs in /var/log/apache2/ to see if there's an error message – wildintellect Mar 28 '17 at 16:33
  • @wildintellect Update 3 shows the results on the error log from an hour ago. However now the page just doesn't stop loading, normally is loads this took too long page but this time it didn't load anything – mp252 Mar 28 '17 at 16:44

0 Answers0