sean We trying without building a new Apache, We imported the app from Webfaction and we made the changes.

The structure that App had in Webfaction was:

~/webapps/project:
  --~/webapps/project/apache2
  -- ~/webapps/project/bin
   -- ~/webapps/project/lib
    -- ~/webapps/project/django_project1
    -- ~/webapps/project/django_project1

When we ran the follow commands we got this:

~/apps/myapp/apache2/bin/ start  -bash:: command not found
 -bash:  ~/apps/myapp/apache2/bin/: Is a directory
-bash: -bash:: command not found
 ~/apps/myapp/apache2/bin/apachectl start
-bash: : command not found
  ~/apps/myapp/apache2/bin/apachectl: No such file or directory
-bash: -bash:: command not found
~/apps/myapp/apache2/bin/apachectl: No such file or directory

Our wefaction mod_wsgi =3.4.

Sorry, but we don't know how to migrate correctly.





  • sean replied to this.

    joshuccr you've got a space in your command before start: ~/apps/myapp/apache2/bin/ start

    Try it like this: ~/apps/myapp/apache2/bin/start

      sean I tried and obtain this:

      -bash: /home/opaluser/apps/myapp/apache2/bin/start: Permission denied

      • sean replied to this.

        joshuccr do chmod u+x ~/apps/myapp/apache2/bin/* and try again.

          sean Thank you very much Sean.
          Apache server is running, but we checked and we obtained a 500 error.

          When we checked logs we saw this:

          [Tue Dec 15 23:05:13.939600 2020] [wsgi:error] [pid 129026:tid 140655410722560] [remote ::1:40646] from zinnia.models.entry import Entry
          [Tue Dec 15 23:05:13.939604 2020] [wsgi:error] [pid 129026:tid 140655410722560] [remote ::1:40646] File "/home/{OpalUser}/apps/{myapp}/lib/python2.7/django_blog_zinnia-0.12.3-py2.7.egg/zinnia/models/entry.py", line 24, in <module>
          [Tue Dec 15 23:05:13.939612 2020] [wsgi:error] [pid 129026:tid 140655410722560] [remote ::1:40646] from zinnia.models.category import Category
          [Tue Dec 15 23:05:13.939616 2020] [wsgi:error] [pid 129026:tid 140655410722560] [remote ::1:40646] File "/home/{OpalUser}/apps/{myapp}/lib/python2.7/django_blog_zinnia-0.12.3-py2.7.egg/zinnia/models/category.py", line 5, in <module>
          [Tue Dec 15 23:05:13.939624 2020] [wsgi:error] [pid 129026:tid 140655410722560] [remote ::1:40646] from mptt.models import MPTTModel
          [Tue Dec 15 23:05:13.939635 2020] [wsgi:error] [pid 129026:tid 140655410722560] [remote ::1:40646] ImportError: No module named mptt.models

          When we checked the dependances at
          /home/{OpalUser}/apps/{myapp}/lib/python2.7
          we saw that we have that dependances:

          django_blog_zinnia-0.12.3-py2.7.egg
          django_mptt-0.5.4-py2.7.egg-info

          PD: Sorry for my explanation I don't use to write in english, my mother tongue is spanish.

          • sean replied to this.

            joshuccr WebFaction did a lot of weird non-standard stuff with Python search paths so your default library setup isn't going to work here.

            The first two steps in the procedure are intended to cover that:

            1. Make a Python 2.7 environment for your Python dependencies: Python Virtual Environments | Opalstack Support Center
            2. Install your Python dependencies into the new environment.

            You'll need to install any packages that were in your appname/lib/python2.7 and in your ~/lib/python2.7 directory at WF.

              sean Thanks a lot. It is very hard for us to migrate all django projects, because have the same Webfaction Structure in all of them.
              Sean, we have already created python 2.7 virtual environment.
              Is it possible to move with filezilla all dependances that we have in appname/lib/python2.7 and ~/lib/python2.7, directly in env/lib/python2.7/site-packages?

              The projects don't have a requirements.txt file for use pip.

              • sean replied to this.

                joshuccr no, sorry - they must be installed with pip. If you're not sure how to do this feel free to email support so that we can look at exactly what you have.

                  sean Sorry, Sean I checked the backups again and we have two requiriments files :
                  /appname/lib/python2.7
                  ~/lib/python2.7
                  We are going to try to install using pip.

                  And again, Thank you a lot.

                    sean Thanks 😃

                    Well we created a virtual env and install all dependances of both projects and we obtained this error when we run Apache2 (we changed in httpd.conf this:
                    /home/{OpalUser}/apps/{myapp}/lib/python2.7 -> /home/{OpalUser}/apps/{myapp}/env)

                    [Wed Dec 16 01:01:53.723176 2020] [wsgi:error] [pid 240845:tid 140655410722560] [remote ::1:41240] from django.core.wsgi import get_wsgi_application
                    [Wed Dec 16 01:01:53.723196 2020] [wsgi:error] [pid 240845:tid 140655410722560] [remote ::1:41240] ImportError: No module named django.core.wsgi
                    [Wed Dec 16 01:01:53.816825 2020] [wsgi:error] [pid 240845:tid 140655263209216] [remote 127.0.0.1:49356] mod_wsgi (pid=240845): Target WSGI script '/home/ccr/apps/django_ccr_apache/ccr-web/wsgi.py' cannot be loaded as Python module.
                    [Wed Dec 16 01:01:53.816866 2020] [wsgi:error] [pid 240845:tid 140655263209216] [remote 127.0.0.1:49356] mod_wsgi (pid=240845): Exception occurred processing WSGI script '/home/{OpalUser}/apps/{myapp}/{myproject}/wsgi.py'.
                    [Wed Dec 16 01:01:53.816915 2020] [wsgi:error] [pid 240845:tid 140655263209216] [remote 127.0.0.1:49356] Traceback (most recent call last):
                    [Wed Dec 16 01:01:53.816964 2020] [wsgi:error] [pid 240845:tid 140655263209216] [remote 127.0.0.1:49356] File "/home/ccr/apps/django_ccr_apache/ccr-web/wsgi.py", line 23, in <module>
                    [Wed Dec 16 01:01:53.817029 2020] [wsgi:error] [pid 240845:tid 140655263209216] [remote 127.0.0.1:49356] from django.core.wsgi import get_wsgi_application
                    [Wed Dec 16 01:01:53.817071 2020] [wsgi:error] [pid 240845:tid 140655263209216] [remote 127.0.0.1:49356] ImportError: No module named django.core.wsgi

                    We didn't install this dependance in our requiriment file.

                    • sean replied to this.

                      joshuccr either Django is not installed, or the wrong version of Django is installed.

                      Check your WF libs to get the Django version from there, then make sure you have that version installed into your env.

                        sean THANK YOU VERY MUCH, WE ACHIVED
                        Finally we get one place working.
                        So now I can replicate the proccess with other projects.

                        Thank you very much and sorry for all questions. 😃

                          Mastodon