Current time: 11-17-2024, 01:45 AM Hello There, Guest! (LoginRegister)


Post Reply 
Creating user seems to be stalled
Author Message
mike548141 Offline
Junior Member
*

Posts: 49
Joined: Nov 2009
Reputation: 0
Post: #1
Creating user seems to be stalled
Hi,

First off this question is for VHCS and yes I know this is a separate fork but as they are still fairly similar I was hoping someone may be able to help.
I'm using VHCS because its available as a RPM for openSuSE making my life much easier...

So VHCS 2.4.8 installs normally on openSuSE 11.1, I create the database and configure VHCS. I can login as admin and create a reseller account. I can change settings in VHCS and create hosting plans etc..
In short VHCS appears to be working normally.

But when I create a user (logged in as the reseller) I can't login or change user to be the user. It is like the user needs to be activated?
In the user overview (logged in as admin) the user has two arrows going in a circle next to it.

So my question is should I be able to just create a user and login as them much like I can a reseller or is there a step in user creation I'm missing.

Many thanks,

MC
P.S> this is a snippet of the bash script I use to configure VHCS once the RPM has installed, the rest of the LAMP stack is already installed on the appliance.

Code:
configureInterfaceVHCS() {
  # Modify the init vhcs2_network script to include the init headers so that it does not cause LSB errors
  sed -i -e '/\#\!\/bin\/bash/ a \#\#\# BEGIN INIT INFO\n\# Provides: vhcs2_network\n\# Required-Start: \$network \$remote_fs\n\# Required-Stop: \$network \$remote_fs\n\# Default-Start: 3 5\n\# Default-Stop: 0 1 2 6\n\# Description: Start the vhcs2_network\n\#\#\# END INIT INFO\n' /etc/init.d/vhcs2_network
  # Start the vhcs service at init 3
  chkconfig vhcs2_daemon on
##chkconfig vhcs2_network on
  # Modify the database script to include the database name
  cp -pv /etc/vhcs2/database/database.sql /studio/sql-db/vhcs2.sql
  sed -i "s/{DATABASE_NAME}/$vhcs_db_name/g" /studio/sql-db/vhcs2.sql
  # Make a copy of the VHCS script that sets the database password and create symbolic links for the scripts it references
  cp -pv /srv/www/vhcs2/engine/vhcs2-db-passwd /studio/script/vhcs-db-passwd-cli.pl
  ln -s /srv/www/vhcs2/engine/vhcs2_common_code.pl /studio/script/vhcs2_common_code.pl
  ln -s /srv/www/vhcs2/engine/vhcs2-db-keys.pl /studio/script/vhcs2-db-keys.pl
  # Modify the VHCS script so that it will get the passwords from the CLI rather than interactively
  sed -i "s/$upass = read_password('Please Enter Your New Database Password:');/$upass = \$ARGV[0];/g" /studio/script/vhcs-db-passwd-cli.pl
  sed -i "s/$upass_check = read_password('Please Repeat Your New Database Password:');/$upass = \$ARGV[0];/g" /studio/script/vhcs-db-passwd-cli.pl
  sed -i "s/$upass_current = read_password('Please Enter Your Current Password:');/$upass = \$ARGV[1];/g" /studio/script/vhcs-db-passwd-cli.pl
  # Remark the icons alias out of the Apache default configuration so that it does not conflict with the VHCS awstats configuration
  sed -i 's|^Alias /icons/ "/usr/share/apache2/icons/"|\#Alias /icons/ "/usr/share/apache2/icons/"|g' /etc/apache2/default-server.conf
  # Modify the default VHCS configuration to include the host name and support email address
  sed -i "s/^SERVER_HOSTNAME = debian/SERVER_HOSTNAME = $public_host_name\.$public_domain_name/g" /etc/vhcs2/vhcs2.conf
  sed -i "s/^DEFAULT_ADMIN_ADDRES = $/DEFAULT_ADMIN_ADDRES = $support_email_address/g" /etc/vhcs2/vhcs2.conf
  # Modify the VHCS config to use the selected MySQL server
  sed -i "s/^DATABASE_HOST = localhost/DATABASE_HOST = $vhcs_db_host/g" /etc/vhcs2/vhcs2.conf
  # Modify the VHCS config to use the VHCS database name
  sed -i "s/^DATABASE_NAME = vhcs2/DATABASE_NAME = $vhcs_db_name/g" /etc/vhcs2/vhcs2.conf
  # Modify the VHCS config to use the VHCS SQL user
  sed -i "s/^DATABASE_USER = root/DATABASE_USER = $vhcs_db_username/g" /etc/vhcs2/vhcs2.conf
  # Modify the VHCS config to use the SQL directory
  sed -i "s/^DATABASE_DIR = \/var\/lib\/mysql/DATABASE_DIR = \/srv\/sql/g" /etc/vhcs2/vhcs2.conf
  # Execute the customised script to set the database password in /etc/vhcs2/vhcs2.conf
  /studio/script/vhcs-db-passwd-cli.pl $vhcs_db_password
  # Ensure MySQL is running
  rcmysql restart
  # Create the VHCS database and import the required tables
  mysql --host=$vhcs_db_host --user=root --pass=$mysql_root_password < /studio/sql-db/vhcs2.sql
  mysql --host=$vhcs_db_host --user=root --pass=$mysql_root_password --database=$vhcs_db_name < /etc/vhcs2/database/htaccess.sql
  mysql --host=$vhcs_db_host --user=root --pass=$mysql_root_password --database=$vhcs_db_name < /etc/vhcs2/database/languages.sql
  # Create a MySQL user for VHCS and grant it the required database rights
  mysql --host=$vhcs_db_host --user=root --pass=$mysql_root_password --database=mysql --execute="grant all privileges on $vhcs_db_name.* to '$vhcs_db_username'@'$vhcs_db_host' identified by '$vhcs_db_password' with grant option;"
  # Encrypt the Linux admin password using perl crypt
  export admin_password_crypt=`/studio/script/vhcs-user-password-encryption.pl $admin_password`
  # Create a admin user in the VHCS database, login details are username admin with the linux admin password
  mysql --host=$vhcs_db_host --user=$vhcs_db_username --pass=$vhcs_db_password --database=$vhcs_db_name --execute="insert into admin values (1, 'admin','$admin_password_crypt', 'admin', 0, '', 0, '', '', '', '', '', '','$support_email_address', '', '', '', '', '', '');"
}
(This post was last modified: 04-06-2010 10:56 PM by mike548141.)
04-06-2010 10:53 PM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #2
RE: Creating user seems to be stalled
Hi

first: its 3 years when ispcp 1.0 rc1 was released - so about 3.5 years of programming in different directions from vhcs...
ok, since vhcs has no forum on their page, we may try to help.

the two circling arrows mean: user creation is going on.
And if this is still the case after reloading the user list I think theres a problem.

You are right: you should be able to create a user and then use it (switch to the user or login...).

Now it's important to find the error: you need to have a look at the log files - maybe in /var/log/vhcs/*
Or have a look at the status filed in the vhcs database.

And...: your release is already 1 year old... consider switching to ispcp :-)

/J
04-06-2010 11:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
mike548141 Offline
Junior Member
*

Posts: 49
Joined: Nov 2009
Reputation: 0
Post: #3
RE: Creating user seems to be stalled
Thanks for the speedy reply! Would love to swap (in fact ispcp was my original preference) but for it to work in my server build it must be a RPM and I suspect I don't have the skill to compile a RPM of ispcp for openSuSE.

Quote:since vhcs has no forum on their page
Yeah that is a pain

I'm not here to defend them but I see VHCS 2.6 is in beta, due release "soonish" so at least some one is working on it.

Quote:And if this is still the case after reloading the user list I think theres a problem.
Can confirm it still happens after reloading the user list

Quote:you need to have a look at the log files - maybe in /var/log/vhcs/*
Unfortunately there are no log files there. The folder is there (/var/log/vhcs2/vhcs2-arpl-msgr) but there are no files in vhcs2 or its sub-dirs.
Looking in messages I just see cron job log entries executing /srv/www/vhcs2/engine/tools/vhcs2phptemp.sh

One thing I (stupidly) forgot to mention before. When creating the user it goes through the first two steps without issue but when you press "Add user" on the third step it leaves you on a blank page, the URL of the blank page is "http://www.clements.org.nz/reseller/rau3.php".
The first step is specifying the domain name, step 2 you specify the limits in traffic, users etc and step 3 is the user details, password etc...

Even through it leaves me on a blank page if I go back to the control panel the user shows in the list properly and all the details I configured are there. So maybe a coding error in the PHP of rau3.php?

If it helps I have a play system that is online, I would prefer to not publish the URL, username & password here through. So I can give access if its helpful

MC
04-07-2010 03:38 AM
Find all posts by this user Quote this message in a reply
pgentoo Offline
Member
*****
Dev Team

Posts: 326
Joined: Mar 2007
Reputation: 0
Post: #4
RE: Creating user seems to be stalled
Why must ispcp be offered as an RPM for you to adopt it?
04-07-2010 04:37 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #5
RE: Creating user seems to be stalled
Did you have a look at the vhcs2-database? table domains or admin...

somewhere the status field should give more info...

/J
04-07-2010 08:04 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mike548141 Offline
Junior Member
*

Posts: 49
Joined: Nov 2009
Reputation: 0
Post: #6
RE: Creating user seems to be stalled
(04-07-2010 04:37 AM)pgentoo Wrote:  Why must ispcp be offered as an RPM for you to adopt it?

Its easier to distribute to numerous servers but more importantly we don't allow compilers on production servers i.e. no make, no gcc etc...

MC
(04-07-2010 08:04 AM)joximu Wrote:  Did you have a look at the vhcs2-database? table domains or admin...
somewhere the status field should give more info...

Looking at the domain table the status appears to be 'toadd'. I've looked at all the other tables and no clues there either (most are empty).

Code:
+----------+-----------------+----------------------------------+------------+----------------+-------------+------------+-------+-------+------+------+------+---------+--------------------------------+-------+------+---------+---------+---------+---------------------+
| admin_id | admin_name      | admin_pass                       | admin_type | domain_created | customer_id | created_by | fname | lname | firm | zip  | city | country | email                          | phone | fax  | street1 | street2 | uniqkey | uniqkey_time        |
+----------+-----------------+----------------------------------+------------+----------------+-------------+------------+-------+-------+------+------+------+---------+--------------------------------+-------+------+---------+---------+---------+---------------------+
|        1 | admin           | iqiOg2uXWs75E                    | admin      |              0 |             |          0 |       |       |      |      |      |         | systems.management@example.com |       |      |         |         |         | 0000-00-00 00:00:00 |
|        2 | reseller        | 6cb75f652a9b52798eb6cf2201057c73 | reseller   |     1270573530 | NULL        |          1 |       |       |      |      |      |         | root@server.example.com    |       |      |         |         | NULL    |                NULL |
|        3 | junkme.gov | 6cb75f652a9b52798eb6cf2201057c73 | user       |     1270573586 |             |          2 |       |       |      |      |      |         | root@server.example.com    |       |      |         |         | NULL    |                NULL |
+----------+-----------------+----------------------------------+------------+----------------+-------------+------------+-------+-------+------+------+------+---------+--------------------------------+-------+------+---------+---------+---------+---------------------+

+-----------+-----------------+------------+------------+-----------------+-------------------+----------------+----------------------+----------------------+---------------------+----------------------+-------------------+-------------------+---------------+--------------------+-------------------+--------------+-------------------+-------------------+------------+------------+
| domain_id | domain_name     | domain_gid | domain_uid | domain_admin_id | domain_created_id | domain_created | domain_last_modified | domain_mailacc_limit | domain_ftpacc_limit | domain_traffic_limit | domain_sqld_limit | domain_sqlu_limit | domain_status | domain_alias_limit | domain_subd_limit | domain_ip_id | domain_disk_limit | domain_disk_usage | domain_php | domain_cgi |
+-----------+-----------------+------------+------------+-----------------+-------------------+----------------+----------------------+----------------------+---------------------+----------------------+-------------------+-------------------+---------------+--------------------+-------------------+--------------+-------------------+-------------------+------------+------------+
|         1 | junkme.gov |          0 |          0 |               3 |                 2 |     1270573586 |                    0 |                    0 |                   0 |                   10 |                 0 |                 0 | toadd         |                  0 |                 0 |            9 |                10 |                 0 | yes        | yes        |
+-----------+-----------------+------------+------------+-----------------+-------------------+----------------+----------------------+----------------------+---------------------+----------------------+-------------------+-------------------+---------------+--------------------+-------------------+--------------+-------------------+-------------------+------------+------------+
(This post was last modified: 04-07-2010 08:45 AM by mike548141.)
04-07-2010 08:31 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #7
RE: Creating user seems to be stalled
ok, status = "toadd"... this may be an indicator that the request manager did not run since creation of the user.

Normally there is a daemon running (port localhost:9876) and when there are changes to be done, the daemon is called and the daemon kicks the request manager, which looks at the status fields and decides which engne script has to be kicked...

ok, check if the daemon is running and start the rewuest manager for one time manually (engine/vhcs2-rqst-mngr).

/J
04-07-2010 05:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
mike548141 Offline
Junior Member
*

Posts: 49
Joined: Nov 2009
Reputation: 0
Post: #8
RE: Creating user seems to be stalled
@joximu - You are da man!

(04-07-2010 05:49 PM)joximu Wrote:  Normally there is a daemon running (port localhost:9876) and when there are changes to be done, the daemon is called and the daemon kicks the request manager, which looks at the status fields and decides which engne script has to be kicked...

Using netstat I can confirm the daemon is listening
Quote:tcp 0 0 127.0.0.1:9876 0.0.0.0:* LISTEN 8007/vhcs2_daemon

Quote:ok, check if the daemon is running and start the rewuest manager for one time manually (engine/vhcs2-rqst-mngr).

I ran the request manager script manually, it took about 60 seconds. I found Apache had stopped after and would no longer load, checking the apache logs showed I needed to manually create the directory /var/log/apache2/users/.
After creating that directory apache loads normally and I can now browse to the domain (i.e. a virtual host now exists!!).

Question 1) I need to fix this so that the request manager runs automatically

Now when I log in to VHCS control panel the user has a red square stop button next to it so a step forward. If I click on it I get the user's status which is "setfmode() | ERROR: Unknown user 'vmail' !".

From that I assume I need to create a user in the database/postfix?

Question 2) I need to get the user to a 'green' status

Thanks again for your help!

MC
04-08-2010 01:28 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #9
RE: Creating user seems to be stalled
User vmail is a linux system user (at least in ispcp) - it's used for the mail folders...

Add it, maybe adopt som configs (postfix and vhcs - the correct user id), then set the status to "change" and rerun the request manager.

I don't know why the daemon did not kick the request manager... this should really work!




I think you also could "compile" ispcp (it's the daemon to be compiled, nothing else) on a similar machine and then copy the things to the production server...

/J
04-08-2010 07:56 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mike548141 Offline
Junior Member
*

Posts: 49
Joined: Nov 2009
Reputation: 0
Post: #10
RE: Creating user seems to be stalled
Creating the vmail user seems to have cleared up that issue, for anyone that needs it this is what I did...
Quote: # Generate a random password for the vmail user
export vmail_password=`dd if=/dev/urandom count=128 bs=1 2>&1 | sha512sum | cut -b-50`

# Get the group ID (GID) of the mail group
export mail_gid=`cat /etc/group | grep 'mail:' | sed '; s/mail:x://; s/://;'`

# Create the user vmail for VHCS
useradd -g $mail_gid -p $vmail_password --system vmail

No luck getting the request manager to run automatically so far... Hoping to get this sorted but I can't see any logs that are helpful, so things I have to fix...
1) Get request manager to run automatically
2) Fix the work flows that leave the control panel on a blank page (rau3.php)
3) Seems that a bunch of things like the traffic counters are not working...
VHCS is looking worse and worse as a viable option...

(04-08-2010 07:56 AM)joximu Wrote:  I think you also could "compile" ispcp (it's the daemon to be compiled, nothing else) on a similar machine and then copy the things to the production server...

Hmm I'm interested... Do you happen to know if there are any 'how to's', manuals or general info that I can look at to achieve this?
I'm happy to attempt compiling a RPM but I would say I would need the forums help... If its achievable I can post it back here for others of course.

Thanks,

MC
04-09-2010 02:52 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)