Should I add the user www-data? Trying to get Rails off the ground

152

You can find the user that your webserver is using by executing ps aux | grep httpd

if httpd doesn't show any information, you can try using ps aux | grep apache

There should also be a user defined in your httpd.conf file.

One way to find this is egrep -iw --color=auto 'user|group' /path/to/httpd/conf

Share:
152

Related videos on Youtube

Adi
Author by

Adi

Updated on September 18, 2022

Comments

  • Adi
    Adi almost 2 years

    I have the following tables

    f_orders

    ORDER_NUMBER    NUMBER(5,0)
    ORDER_DATE      DATE
    ORDER_TOTAL     NUMBER(8,2)
    CUST_ID         NUMBER(5,0)
    STAFF_ID        NUMBER(5,0)
    

    with the following data

      ORDER_NUMBER  ORDER_DATE  ORDER_TOTAL CUST_ID STAFF_ID
        5678         10-Dec-2017    103.02     123    12
        9999         10-Dec-2017       10      456    19
        9997         09-Dec-2017       3       123    19
        9989         10-Dec-2016       3       123    19
    

    and

    f_customers

    ID          NUMBER(5,0) 
    FIRST_NAME  VARCHAR2(25)    
    LAST_NAME   VARCHAR2(35)    
    ADDRESS     VARCHAR2(50)    
    

    with the following data

    ID  FIRST_NAME  LAST_NAME   ADDRESS
    123     Cole       Bee    123 Main Street
    456      Zoe       Twee   1009 Oliver Avenue
    

    I'm supposed to display the name of the customer wthi the most orders placed in the year 2017.

    My query looks like this

    SELECT f_customers.first_name, 
           f_customers.last_name, 
           count(order_total)
    FROM f_orders JOIN f_customers 
    ON f_customers.id = f_orders.CUST_ID
    WHERE TO_CHAR(order_date, 'DD-Mon-YYYY') LIKE '%2017'
    GROUP BY f_customers.first_name,  f_customers.last_name
    HAVING count(order_total) = (SELECT max(count(cust_id)) 
                                 FROM f_orders 
                                 GROUP BY cust_id)
    

    The problem is that whenever I insert the where statement it returns no data found, even though it should return the name Cole Bee with 2 orders If I remove the where statement it will show that Cole Bee has placed 3 orders

    I can't figure out why I get the no data found result. Any ideas?

  • JellicleCat
    JellicleCat over 11 years
    I get the same message for httpd: chown: invalid user: `httpd:httpd'.
  • Lucas Kauffman
    Lucas Kauffman over 11 years
    Like I said it depends on your webserver, operating system and configuration. What webserver are you running?
  • JellicleCat
    JellicleCat over 11 years
    Apache + Phusion Passenger. (I looked in http-manual.conf for a clue as to the user name, but don't see anything that looks like a user name.)
  • Lucas Kauffman
    Lucas Kauffman over 11 years
    check what user your Apache is using by using ps aux|grep -i 'apache'
  • Lucas Kauffman
    Lucas Kauffman over 11 years
    Try to see if the user apache exists
  • JellicleCat
    JellicleCat over 11 years
    Okay. daemon shows up in the first column for all the results except the first, which reads root. Is daemon the owner?
  • JellicleCat
    JellicleCat over 11 years
    There is a user named apache in my /etc/passwd file, but what shows up when I grep ps is root and daemon.