Announcement

Collapse
No announcement yet.

Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

    Well, if you followed the "Perfect Ubuntu Server tutorial", you installed your own DNS server (bind9). Now, in order to use it, you need to change your Windows network settings. On your connection you have the possibility to change default DNS by setting your own IP. More about here: http://www.opennicproject.org/config...-in-windows-7/

    So, your first DNS ip would be the IP of your newly installed server : 125.215.193.50 . And I'd add 2 more, just in case your VirtualBox is off: 208.67.220.220 and 208.67.222.222 (those are the DNS of OpenDns: http://www.opendns.com/opendns-ip-addresses/)

    Hope it helps
    Emma

    Zen Radio : Relax :) : www.zenradio.fm
    MivaScript Tutorials & Scripts : www.mivascript.org

    Comment


      #32
      Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

      Gotcha. Getting closer. When I put my server ip, http://125.215.193.50/, into a browser in windows, I get the the Apache2 Ubuntu Default Page.

      I added my server IP to the DNS in windows 7 and moved it to the top of the list (server IP, and two open DNS entries).

      The IPSconfig is the same as in your article except for the server (example1.server.com) and domain (test.example.com)

      However, when I put in "test.example.com" (my server is server1.example.com, based off the ubuntu install guide - didn't want to change anything, at least until I figure this out) I get the OpenDNS guide page because "test.example.com" is not loading.

      Also, following your example of bringing up to \\MV\test.se.com in the file browser, I put in \\EXAMPLE1\test.example.com but get a popup saying windows can not access it.

      I see that I have test.example.com and web1 folders inside var/www/clients/client1 - guessing that is normal?

      Thanks again for the help. I'm going to keep messing with this and see if there's anything simple I missed in the tutorial.
      M.A.D.* since 1997

      http://www.scotsscripts.com

      *miva application developers

      Comment


        #33
        Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

        Note- I figured out the sharing, I go there via the IP address and then I can get to all the files in windows.
        M.A.D.* since 1997

        http://www.scotsscripts.com

        *miva application developers

        Comment


          #34
          Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

          Ok, final note, it's WORKING.

          After reading up on this stuff, most people edit their windows hosts file so I figured I would try this, and what do you know, not only did the test page come up, but the miva diag file worked as well.

          I'm blown away that this works. It's like a wish come true.

          Thanks very much.

          The only thing I'd add to your tutorial is a more detailed description of the ip address stuff as it relates to windows and the perfect ubuntu install page, that part was kind of confusing. Also maybe include a note that editing the windows hosts file appears to be an easier way of getting things to work.

          Another note, I can only access the ISPconfig screen by bringing up a browser in ubuntu and going to https://server1.example.com:8080/index.php# - using a windows browser brings up an ssl connection error. Maybe that's how it's supposed to work, but it could be confusing for someone.

          One last question- This might be out of the scope of what you're doing here, but the perfect server docs say I should be able to access phpmyadmin with http://server1.example.com:8081/phpmyadmin or http://server1.example.com:8081/phpMyAdmin.

          However they both come up as Not Found. Any ideas?

          Thanks again!

          Scot
          Last edited by Scot - ScotsScripts.com; 05-22-14, 03:34 AM.
          M.A.D.* since 1997

          http://www.scotsscripts.com

          *miva application developers

          Comment


            #35
            Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

            Having one more problem. The mivadiag.mvc file runs, but if I copy a mivascript from my windows environment in there, I get an error like:

            Configuration Error: 'scot' is not authorized to use Miva Script

            The error above is when I used my ubuntu account to copy the file, if I copy it right from windows, I get:

            Configuration Error: 'nobody' is not authorized to use Miva Script

            How do I add names to the authorized list?

            Thanks,

            Scot
            M.A.D.* since 1997

            http://www.scotsscripts.com

            *miva application developers

            Comment


              #36
              Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

              A hack for this seems to be to use 'chgrp' to change it to "client1" and it works.

              However it looks like I have to do this for every new mivascript I make, which is a pain because all the files default to the "nobody" as an owner and "nogroup" as the group.

              Trying to figure out the miva authfile which it seems like it might be able to help, but the docs are broken on miva's site right which makes that a little difficult.
              M.A.D.* since 1997

              http://www.scotsscripts.com

              *miva application developers

              Comment


                #37
                Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

                Just a quick note, looks like if I the following to the miva.authfile I can edit and compile mivascripts normally and run them from the local server. The only hassle is manually adding this to the file for each domain I create, but at the same time, that's not really a hassle. For anyone that's interested, and new at this, the miva.authfile is located in the /etc directory.

                <AUTH ACCESS = "allow" type="login">
                nobody=/var/www/clients/client1/web2/mivadata
                </AUTH>
                M.A.D.* since 1997

                http://www.scotsscripts.com

                *miva application developers

                Comment


                  #38
                  Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

                  Hi Scot

                  I'm glad you could make it work. Indeed there is a line I forgot to specify. If you add a file from your network, it will get "nobody" uid becasue the sharing is done with anonymous account. So, in order to make this work in miva, you'll have to use a small script that will give the right uid to your files. Just paste those lines in a file named updateuid.sh at the root of your virtual host (just below the mivadata and web folder). Please change the uid with your own (web35 and client1 are just an example) :

                  Go to your folder

                  cd /var/www/yourvirtualhost.com/
                  nano updateuid.sh
                  paste this :

                  #! /bin/bash


                  # Change UID & GID for the files newly added from your network
                  chown -R web35:client1 web
                  # Share newly added files so you can modify them from your network (not to use on a production webserver)
                  chmod -R 777 web
                  chown -R web35:client1 mivadata
                  chmod -R 777 mivadata
                  Save and after that just do a :

                  chmod +x updateuid.sh
                  Now when you add new files, you'll just have to do a small :

                  cd /var/www/yourvirtualhost.com/
                  ./updateuid.sh
                  Thank you for your suggestions, I'll try and make the DNS IP part a little more clear.
                  The trick with adding the nobody in the auth file will work only for one virtual host. If you add another one, you'll have the same problem.

                  I updated the script installmiva.sh so it will create the "updateuid.sh" file automatically, when you install miva empresa on a new virtual host. So you might want to update it :

                  cd /home
                  rm -Rf installmiva.sh
                  wget http://mivascript.org/download/installmiva.sh
                  chmod +x installmiva.sh
                  PS: There is a solution for the UID problem. I'll make some tests and let you know, but we might be able to avoid this problem when we add new files on the server from the network.

                  Best regards,
                  Emma
                  Zen Radio : Relax :) : www.zenradio.fm
                  MivaScript Tutorials & Scripts : www.mivascript.org

                  Comment


                    #39
                    Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

                    Thanks for that stuff, I will update my files in the morning.

                    On the phpmyadmin thing, can you think of any reasons why it's not coming up like the server install post said it would? The docs say it should come up by putting in either

                    http://server1.example.com:8081/phpmyadmin
                    or
                    http://server1.example.com:8081/phpMyAdmin

                    They both come up with page not found. I've tried using the ip address with the same result. Any ideas?
                    M.A.D.* since 1997

                    http://www.scotsscripts.com

                    *miva application developers

                    Comment


                      #40
                      Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

                      Ok, I finally figured out the PHPMyadmin stuff. This might be useful in the tutorial as well because they don't have this in the "perfect server setup" tutorial. Once everything is up and running, to get phpmyadmin working you go to the terminal and put this stuff in:



                      ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf


                      a2enconf phpmyadmin

                      service apache2 reload



                      Once I did that, I could access the phpmyadmin panel using my ip address: xxx.xxx.xxx.xxx:8081/phpmyadmin

                      The last hurdle was figuring out how to log in, and that's by using "root" (no quotes) as the login and the password you put in when setting everything up.
                      M.A.D.* since 1997

                      http://www.scotsscripts.com

                      *miva application developers

                      Comment


                        #41
                        Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

                        Now I've hit a wall. I got phpmyadmin working and created a mysql database. I have a test script that works on a "real" site but is giving me this cryptic looking error:

                        MvOPEN: Unable to connect to database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

                        So I looked around and found your post from 2010:

                        http://extranet.mivamerchant.com/for...sql-mysql-sock

                        and followed those steps. Unfortunately now I can't start/stop/restart mysql and of course phpmyadmin can't connect either.

                        So I changed the values back to what they were originally, but mysql is still broken, but the error number is now a (2) instead of a (13) (and changed them back and forth several times trying to troubleshoot.)

                        One interesting thing I noticed is that before I made those changes, there was no mysql.sock file, only a mysqld.sock file, now there's a mysql.sock file and no mysqld.sock file. Don't know what that means.

                        Did I totally mess things up? Do I have to do the whole server reinstall over again? This process is like a roller coaster!
                        M.A.D.* since 1997

                        http://www.scotsscripts.com

                        *miva application developers

                        Comment


                          #42
                          Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

                          Ok, I decided to load up a new server. I'm an expert now. And I've created copies of the virtual machine so when I mess it up I don't spend three hours making a new one.

                          Now the question is, now that miva script works, how do I get mysql to work? When I create a database in phpmyadmin there isn't any place to create a user or put a password, so I'm wondering what the next step is? One of the main reasons for doing this was to be able use to mysql in a "real" miva environent so I hope this part can be worked out.

                          The error I get is:

                          MvOPEN_Error: Unable to connect to database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

                          I've tried many many solutions but all they do is break the system.

                          Do I have to install phpmyadmin into the site I created and run it from there? Any tips on how to do that right if I do?

                          Thanks-

                          Scot
                          M.A.D.* since 1997

                          http://www.scotsscripts.com

                          *miva application developers

                          Comment


                            #43
                            Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

                            Did you look at your mysql logs to see what they are saying? In the mysql/php world that usually means a bad .cnf file or mysql isn't running.

                            From a command line try "mysqladmin -u root -p admin" and it should ask for a root mysql password if it's running.

                            Also, check the permissions on your mysql folder. That's my biggest "doh" moment.

                            Comment


                              #44
                              Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

                              Mysql is definitely running, there is no doubt about that.

                              I've changed the permissions to the mysql folder to 777 just to make sure.

                              Still get:

                              MvOPEN: Unable to connect to database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

                              Is that file, /var/lib/mysql/mysql.sock, supposed to exist? It's not there, although in my research I've read that it's not always there, that it comes and goes as mysql needs it.

                              In another post Emma said to edit the my.cnf file - "search for 'socket = /var/run/mysqld/mysqld.sock' occurences and change with 'socket = /var/lib/mysql/mysql.sock'"

                              I tried that earlier but all it did was make it so I couldn't start or stop mysql and broke ispconfig and phpmyadmin. Although I'm tempted to try it again and this time stop mysql before I make those changes to see if there's any difference.

                              Mysql logs: there are no entries in the /var/log/mysql/error.log file that pertain to this; I just tried the miva script after changing permissions but the latest error log entry comes from 20 minutes before when I turned the machine on, and it's a [Note] entry that says "/usr/sbin/mysqld: ready for connections."

                              Any more troubleshooting, ideas, tips are more than welcome. Keep in my that I'm learning ubuntu from scratch here and I've only been messing with it for a week.
                              M.A.D.* since 1997

                              http://www.scotsscripts.com

                              *miva application developers

                              Comment


                                #45
                                Re: Install Miva Empresa + Mysql5 + Apache2 Suexec + Php5 on Ubuntu

                                I finally got it to work.

                                First, I followed Emma's instructions (part 1) from this post:

                                http://extranet.mivamerchant.com/forums/showthread.php?102728-Tip-Can-t-connect-to-local-MySQL-server-through-socket-var-lib-mysql-mysql-sock

                                One note, I think it's important to first turn off mysql then restart it after the editing of the file is done. The first time I tried this and and tried to restart it after I updated the file all sorts of bad things happened.

                                service mysql stop
                                [ edit the file ]
                                service mysql start

                                Good Result- the miva script appears to be able to interact with the mysql table I created in phpmyadmin.

                                Bad Result - phpmyadmin and ispconfig are now both broken, however...

                                Fixing PHPMyAdmin:

                                Follow Emma's instructions for fixing PHPMyAdmin from this post (part 2):

                                http://extranet.mivamerchant.com/forums/showthread.php?102728-Tip-Can-t-connect-to-local-MySQL-server-through-socket-var-lib-mysql-mysql-sock

                                The only difference is that you want to edit a different file:

                                nano /usr/share/phpmyadmin/config.inc.php

                                and copy the following into it, changing 'localhost' with your server IP address:

                                /**
                                * MySQL hostname or IP address
                                *
                                * @global string $cfg['Servers'][$i]['host']
                                */
                                $cfg['Servers'][$i]['host'] = 'localhost';

                                (simple things can be confusing to someone new to this like me, such as, do you leave the single quotes in or not? Yes. For example, if your ip is 123.123.123.123, it looks like '123.123.123.123')


                                Fixing ISPConfig:

                                And I feel pretty good being able to add something useful to this conversation all on my own.

                                Create (or edit if you have it) this file:

                                nano /usr/local/ispconfig/server/lib/config.inc.local.php

                                and add this line to it:

                                $conf['db_host'] = 'localhost';

                                change 'localhost' to your ip, in my case:

                                $conf['db_host'] = '125.215.193.50';

                                Then reload ISPConfig in your browser and it should work (it did for me.)

                                So now after a week of this stuff, it looks like I have a working miva server where everything is operating normally. I'm going head off to a tequila bar now.

                                One last note: when I restarted the server ISPConfig and PHPMyAdmin were broken again. I had to apply Emma's symlink again to get them to work (ln -s /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.sock)

                                I was able to make this link appear permanent by editing the rc.local file like this:

                                nano /etc/rc.local

                                Then add the symlink line to it and save:

                                ln -s /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.sock

                                Noobie Observation: After you restart the server and everything looks like it's done restarting, it actually takes a few more moments before everything works, around 30 seconds in my case. I tried to load ispconfig and phpadmin right after the server went up and the IP was not found. After a few moments of "what?" I tried again and all was well.
                                Last edited by Scot - ScotsScripts.com; 05-23-14, 08:40 PM.
                                M.A.D.* since 1997

                                http://www.scotsscripts.com

                                *miva application developers

                                Comment

                                Working...
                                X