Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by ajoo

  1. Hi all ! Is it good practice to a have a separate database for a different group of people, say people in a different country. For e.g. If I run a franchisee business model in different countries, would it be a good thing to have a separate database based on the country? I was thinking of naming the database prepended by country name like USA_mydatabase, Canada_mydatabase and so on. Would that be ok ? What is the best practice in such cases. Thanks all !
  2. Hi Guru Barand !! Thanks, I got it working !! Regards.
  3. Hi Guru Barand ! A very happy new year ! Thanks for the response. Sir I have been trying to use the JOIN but I keep getting and 'ambiguous field' error.Could you please show me how it can be done? You are right about the tmp_admin table which I left out since I thought that would not be required for the answer. I do generate the tmp_admin table before this query is executed and yes the query works just fine. If you think that is relevant, I can post the query that generates the tmp_admin temporary table. Thank you and regards.
  4. Hi all ! The query below works great. However I have moved the table_1.city field into a new table, namely, table_3. $query = "SELECT xid, bb.fname, bb.lname, bb.city, bb.cell, bb.email, bb.fid, bb.cno, bb.total, bb.actic from tmp_table INNER JOIN ( SELECT table_1.fname, table_1.lname, table_1.free_id, table_1.city, table_1.cell, table_1.email, table_2.fid, table_2.cenno, count(fid) total, sum(case when scr = 'R' then 1 else 0 end) actic From table_2, table_1 WHERE table_2.fid = table_1.free_id GROUP by table_2.fid, table_2.cenno ORDER by actic DESC LIMIT ?, ? ) bb ON bb.free_id = tmp_admin.xid"; How can I change the query to incorporate this change ? i.e. I need to draw the value of city from table_3. Thanks & a very happy new year to all !
  5. ajoo

    entangled in GIT

    OK this seems to do it right: clone --depth 1 --branch <branch name> <git URL> Thanks requinix.
  6. ajoo

    entangled in GIT

    hmm it says and not that it's an Could it be that it's considering origin/<branch_name> as a path (as echoed by the message ) which it seems not to allow? Still stuck. Maybe I should just delete the copy of the repo on the server and then try and get the detached head from the repo as you suggested. What do you think ? Thanks.
  7. ajoo

    entangled in GIT

    Hi, The suggested command gives the following error : Thanks
  8. Hi all Below is an image of my git with labels. As you can see there are 3 branches and a master. I created the branch B3 from B2 and B2 from B1 but i guess for git all seem to come from the master ulimately ( I mean the trunk of the tree is common to all). The pen-ultimate commit comes from the production server. I then cloned that into my local machine where I wish to develop and test locally. That is the basic idea - to develop and test locally and then push to the repo. From there pull the changes to the server and run it there. Continue to develop and test locally and then push again to repo. Then pull the changes to the server and continue the cycle. So I made a small test change and pushed it to the repo. All is fine. However when I pull the branch into the server, it wants to merge B2 into B3 which is not what I intend to do. I just want to continue to develop along B3 and leave B2 alone where it is. Is this possible? Is there a better way to achieve what I am trying to? Thanks all.
  9. Hi requinix, I wonder what the $tmp is for ? Wouldn't he need to make changes to the code that takes care of the login as well once he uses the password_hash() ? Thanks.
  10. Hi requinix and Guru Barand ! Thanks for the reply. If you check the #1 of this thread, I had kept the two files invoke.php and Graph.php outside the root and under aboveroot. Unfortunately the graph fails to display. invoke.php uses the following bit of code to display the graph :- <?php echo "<img src='/graphs/Graph.php?caption=MyGRAPH&gd1=$data1&gd2=$data2&gd3=$data3' />"; ?> As you can see there is no way I can use "include" or "require" in this scenario. No jpg file is created or stored anywhere but it directly draws the graph which is actually convenient. However this creates another issue of sessions. I cannot bring this file, Graph.php, under a session because of the manner in which it is used. I tried adding session_start(); at the beginning of Graph.php, (which, in any case, I feel is probably wrong usage ) but that does not work since the graph fails to draw then. This means that, infact, Graph.php can be invoked and used by a user directly by passing GET data to it. Even though I don't see what harm that can cause, yet I feel that such access should be prevented if it can be ! Any comments, clarification and suggestions welcome. Thanks loads to you both !
  11. Yes I have read that ! However my concern is more for security threats that may arise by putting my code under the root than for the other benefits that come with a static host. Thanks loads !
  12. Hi requinix ! Thanks for the reply !! And what could be a security risk, if any, of keeping them on the regular host and under the document root. Thanks !
  13. Hi all ! I am pulling out this old post since there was no answer to the last thread. I really need to know, what should I do to handle some of my scripts that I feel should lie somewhere safe. Namely the script that generates the graph as mentioned in the last thread. Thanks all !
  14. Hi all ! I have been trying to automate some simple tasks using the configuration files. However, while i do not get any errors in my log files and the application is deployed successfully, the configuration files are not executed or so it seems ( else I would get an error if they failed). Here is two files configuration files that I was just trying out. 21_copy_xsendfile_conf.config: files: "/home/ec2-user/21_copy_xsendfile_conf.sh": mode: "000750" owner: root group: root content: | #!bin/bash cp scripts/activate_xsendfile.conf /etc/httpd/conf.d/ another version of the same as above ( since I was not sure which was correct ) :- 21_copy_xsendfile_conf.config: files: "/home/ec2-user/21_copy_xsendfile_conf.sh": mode: "000750" owner: root group: root content: | #!bin/bash cp scripts/activate_xsendfile.conf /etc/httpd/conf.d/ and then the 2nd config file to install the xsendfile module: 22_copy_to_conf.config: container_commands: 21_copy_to_conf: command: "/home/ec2-user/21_copy_xsendfile_conf.sh" All the config files are placed in the .ebextensions folder. Both versions of the 1st file and the 2nd file seem not to work. I do not get any error either. I am assuming that the code in these files is correct since I do not get any error either. Please can someone point what the mistake or how i may go about it. The folder structure is myprojects |-------- .ebextensions |---------- .config files |--------- project |----------index.php |---------scripts | |------ activate_xsendfile.conf Thanks all !!
  15. Hi Requinix and Gizmola, Thanks loads for your inputs. Gizmola you were right about not changing the default ownership. My permissions, as depicted in the mails above worked as is though i could not pin point the reason for their not working initially. There was probably some error on my part. Thank you both for the replies !
  16. Hi Gizmola, . That's correct and I was loth to change it. . I did find the webapp user and group there. So would the webapp user also belong to the apache group ? Else how would webapp be serving pages ! right ?! if so, doesn't that go against what was suggested by Guru Jacques in this old thread of mine in #2? Thanks loads !
  17. Hi requinix and gizmola, Thanks for the responses ! @requinix : That's correct. Actually I try out things locally on a VM ( ubuntu : www-data) and in this case I had tried the permissions on Amazon linux too (ec2-user:apache). Unfortunately I lost the VM and the EC2 instance on AWS as well since I keep trying out different things. However I had retained the permissions snapshots of my VM which I have and which I checked and confirmed that they were indeed the same as I have labelled them in my earlier replies. @Gizmola : That's the dilemma ! whether I should change the ownership and permission here or not. WWW_USER=`ps axo user,group,comm | egrep '(apache|httpd)' | grep -v ^root | uniq | cut -d\ -f 1` gives me the apache user as webapp while WWW_GROUP=`ps axo user,group,comm | egrep '(apache|httpd)' | grep -v ^root | uniq | cut -d\ -f 2` gives me a blank ! Why doesn't this show the group as webapp as does the following command? groups webapp webapp : webapp groups ec2-user wheel shouldn't webapp group too be listed by the groups command ? Why isn't there an apache group as well? So what is the right approach to change the permissions now? Thanks all !
  18. Hi requinix, Sorry for the delay. Unfortunately, I have lost my instances that ran with these permissions. I had actually run this on an ec2 instance on AWS. However I had taken their screen shots and so I can confirm that my project ran with the same ownership and permissions as above and ran great with no issues and user : apache was running as the ubuntu : www-data group. I have hunted the EB console but could not find any user webapp defined anywhere by the EB. Nor could I find any group with that name. I thought if I could find them I would have changed them there but i am quite sure the changes have to be effected via the configuration files. I am also not sure if I would need to define a user before I can make any changes. By default the user is ec2-user when I log in using putty. I wonder what's the right way and sequence to follow to make these changes. Thank you.
  19. hmm ! Are you saying that if everything is owned by ec2-user:apache, then with the values given, apache will not be able to read the scripts and includes ?? ! if so, then how come it works just great on my VM?! no issues at all there. Or am I reading your reply incorrectly? Thanks !
  20. Hi requinix, Thanks for the response. Well the application needs to have access to it. For example it requires the image and other data to, say, repopulate the forms so that they may be edited and saved again. So i guess that ( fetching information and storing it ) would be handled by apache. (That's what I think!) Only valid logged in users have access to the forms. Hope that helps.
  21. Hi all ! I have launched my project using the aws EB CLI and its installed as desired. After the installations I needed to change the folder and file permissions and so I logged into the EC2 instance using putty ( I have not yet explored the configuration files enough to set the permissions from there ), as ec2-user and found my project under var/app/current symlinked to the HTML folder. Further all my folders and files under the current folder have the user : group set as webapp : webapp. Now I am not sure what this webapp is but i guess its a user that was created by the elastic beanstalk. Here is my working project structure on my VM. All folders have user:group as ec2-user : apache and the permissions of each folder are as labelled: |--project(root) ---- index.php | 775 644 | |--hidden(below root) --- scripts (710) | 710 --- includes (710) | ---- images ----image1.png (660) | (730) ----image2.png (660) | When I set the permissions same as above in the EC2 instance, My hidden folders become inaccessible. I guess this is because of the wrong user:group settings. So how do I set the correct ownership and settings with the aws elastic beanstalk to make this work with the settings that I have mentioned above. Thanks all !
  22. Hi guys ! thanks for all the replies. @requinix. I think i understand now your previous reply in #4. I am using the VMs for both development and deployment on aws using aws cli. I can do the development on the VM, test my code there and if I think its ok, i can commit it and then deploy it from there to the aws which would be the production server. Right now I am only testing and trying out. You see any flaw in that? The thing is that I started off using a single VPS model and had my DB etc all on one server. I developed code on the VM ,committed changes to the local machine and then pushed it to the remote repo on bitbucket. I could then deploy the code to aws from the bitbucket repo. This was the first VM. It also has code for provisioning the server and the DB which is not there if I use EB. Then, as advised by some of you guys, I decided to use the elastic beanstalk (EB) on aws that separates the database from the web server. It has a different deployment procedure as I explained in the first para above. namely, make changes, test locally, commit and the use the deploy from there itself using the cli. It does not require me to push the changes to bitbucket. @All The EB creates some folder with environment configuration information which should be versioned as well. These do not contan any libraries etc. as Gizmola pointed. So I am not versioning any of them. @Kicken : That does seem like a good solution had I started off with it. Now after about 40 odd commits, i think it would be a bit difficult. I'll, however, still give it a go maybe. Thanks !
  23. Hi requinix, I am not sure what you mean. I would just like to clarify. Which machines are you referring to ? aws or the VM's ? Where ? My repository is on bitbucket. Like where do you mean ? Sorry but I am totally confused by your reply. Thanks ! P.S. Hi Kicken, just saw your reply. Thanks ! Will revert soon.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.