Really need help

41 posts / 0 new
Last post
#1 Mon, 12/16/2013 - 07:49
PatTzZ

Really need help

Hi!

First of all, i'm a french guy. I understand english but i'm not perfectly bilingual, so, please be patient and dont hesitate to ask me clarifications if something is hard to understand.

I dont know what to do but few things are mixed up now. I'm ready to take pro version (i wanted to do it anyway) and to pay to be helped fast by your team if it's possible.

I explain you the case.

After many problems with my hosting company, i decided to take a dedicated server and to setup virtualmin for hosting websites by myself.

Because some customer websites were disabled, i tried to do it as fast and clean as possible, so, i didnt used migration option but transfered everything manually to change all passwords and to be sure that sites are clean. It took me a big week with around 80 hours of work.

I dont remember if it was before or after i had setup my first virtual servers there but i installed apf, bfd, ddos deflate, Linux Malware Detect and Linux Environnment Security.

I say that i dont remember if it was before or after i had setup my first virtual servers because almost everything was running great before and after but some strange problems appeared at random moment. (Yes it's my fault to didnt write list of things i did step by step but everything happened in a really bad moment (my programmer needed to leave for a trip in another country for few weeks and many projects to finalise). Anyway, i explain you what is not working now and i can not say what is the reason and when it happened (if so, everything should be fixed now).

  1. When i try to make some modifications to php config for a specific virtual server, nothing is changing (like increasing max_file_size or things like that). BUT, if i change it to another virtual servers, it's changing. Like if the virtual server Y is taking the php value of the virtualserver X.

  2. My dedicated is setup under domain name like myserver.server.com but now, if i acces myserver.server.com , i reach one of my virtual server website, the same thing for https. (it was not like that before i unintentionnaly changed ALL server ips when i wanted to only change 1 or 2 websites ip under network and configuration / change ip addresses). I changed it back after that and ips are pointing at right place but created this problem.

Exemple, now we can not reach myserver.server.com/phpmyadmin .... we are reaching a 404 page on virtual server ABC.

Like we are in production mode now, i panic a little bit and i would be able to take a break in hollidays.

If you can help me guys ( and i dont ask for charity here ) i will really appreciated. I tried to look everywhere i can but i dont have your knowledge in virtualmin.

Thanks in advance!

Mon, 12/16/2013 - 08:05
Locutus
  1. How and where exactly are you changing PHP parameters? Are you using mod_fcgi? Only then will each domain get its own PHP config file in /home/DOMAIN/etc/php.ini. Domains in mod_php mode will use the default PHP ini in /etc/php5. Also, a restart of Apache might be required for PHP ini changes to become effective.

  2. Apache will always serve a website when it receives a request. When it's for an unknown hostname, it will serve the alphabetically first website. To avoid that, create a dummy domain and assign it as "default for this IP address".

Mon, 12/16/2013 - 08:21
PatTzZ
  1. I dont know if i'm using mod_fcgi (how can i know it?)

I tried to change parameters directly in etc/php5/php.ini and didnt changed nothing.

For the other option, i used the menu under virtualmin (services/php 5 configuration) in some specific virtual servers.

I restarted apache but things are only changing when i modify another virtual server.

Is it possible that it's when i change the values from the first virtual server in the list that it's changing on other site?

  1. It seems to serve the first website in the apache config list but it was not doing it before. Do you see a reason why it changed? (Anyway, i will create a dummy domain but where is that option "default for this ip adress) ?

Many thanks for your help!

Mon, 12/16/2013 - 08:50
PatTzZ

Sorry for php.. i didnt explained well.

I tried to modify /etc/php.ini and also to use the option along each domain for modifying /domain/etc/php5/php.ini but one and other dont work.. it's just changing when i change it on a specific virtual server.

Ps: I just tried to use mod_php in server configuration / website option and it's changing nothing. My php values are not taken.

Now i had setup a domain and use it as default for ip adress. Thats good but now, how can i acces phpmyadmin from root?

Sorry for these many questions... I would delete my post and edit the first one but was already posted.

Mon, 12/16/2013 - 09:19
andreychek

Howdy,

By default, your domains would be setup to use FCGID or CGI, when using PHP.

Both of those have a php.ini file for each domain... that is located in $HOME/etc/php.ini.

The file /etc/php.ini is only used when a domain is configured to use mod_php. It is not used when the domain is using FCGID or CGI.

You can verify that you are using FCGID, by logging into Virtualmin, and clicking Server Configuration -> Website Options, and looking at the "PHP Execution Mode".

We recommend using FCGID or CGI, as they are more secure.

Also, you can set the default IP by going into Server Configuration -> Website Options, and selecting "Default website for IP address".

-Eric

Mon, 12/16/2013 - 09:25
Locutus

How do you determine that the PHP ini changes don't take effect?

After all I know, either the file in /etc or the one in /home/DOMAIN/etc should work, depending on mode (mod_php/fcgi). I wouldn't really know where else the PHP ini should be located.

Of course, with those custom softwares you have installed (like "DDoS Deflate" and "Linux Environment Security"), it's possible that they interfere with Virtualmin in some way. Can't really say, because I don't know those programs.

Can you give details? Like what servers do you have created, and which one do you have to modify to have an effect elsewhere? IIRC the PHP command "php_info();" displays an extensive list of PHP settings; you can put that in a PHP file on the domain in question to see which INI files it effectively uses.

Mon, 12/16/2013 - 10:54
PatTzZ

Thanks for your support guys. I'll come back to you on it asap but now i created a bigger problem... :(

I wanted to reach phpmyadmin from mysever.server.com/phpmyadmin (the dummy domain i created to use by default for the ip) but like it was not working, i went into webmin/servers/mysql and i did a change that i didnt really thinked to be dramatical like that.

Mysql was listening to localhost and i changed it for any... as soon as i did it, i got an error about my password.

Whatever i'm trying to do now, it's not working.

I changed root password from safe mode in ssh and when i try to login, it refuse.

When i try to change my password from webmin/mysql , it does not affect nothing. Always saying "No password".

I tried many things and nothing is working and now i have some customers wanting their email passwords and i can not acces nothing from their account or main account.

I'm really desesperate now.. I dont know what to do. :(

Ps: It seems that i dont have mysql root password and i can not setup any.

If i try to setup a password from webmin, it says:

Failed to change administration password : DBI connect failed : Access denied for user ''@'localhost' to database 'mysql'

If i try to do it from ssh, i get:

ERROR 1133 (42000): Can't find any matching row in the user table.

So.. i dont know what to do but i'm affraid to break other things now..

Any clues?

Mon, 12/16/2013 - 11:25
Locutus

Yeah that's a pitfall that happened to me before too (not with root luckily ;) ).

"Any" in MySQL does not include "localhost". You need privilege entries for both in that case. To connect as root to your MySQL now, simply connect to the server's ethernet IP address instead of "localhost" or "127.0.0.1".

If that fails as well, you can reverse your change by editing MySQL's config file directly (change the listen address back to 127.0.0.1) and then restarting the service.

Mon, 12/16/2013 - 11:50
PatTzZ

From ssh i'm connecting to the ip and it work but it seems that mysql root dont have any password and i can not set one.

(I can not acces it thru localhost or 127.0.0.1 because it's a dedicated server and i dont have physical acces to the box. I can just acces it thru ssh or webmin).

All customer sites are running now, so, i'm really affraid to make a change that will break customer sites/databases.

Mon, 12/16/2013 - 12:00
Locutus

You don't need physical access to connect to 127.0.0.1, just use your regular old SSH to log in. Localhost doesn't mean "console" or so, but the loopback interface of the OS' network stack.

As I said, if you were able to login to MySQL before, you should reverse the change you made by editing MySQL's config file, then restart the service, and connect as usual. Apparently MySQL allows root login without password from localhost by default. (You should definitely change that by the way! Virtualmin e.g. asks you for a MySQL root password to set during its first-run wizard.)

Mon, 12/16/2013 - 13:55
PatTzZ

If you're talking about etc/my.cnf , there's nothing about host inside.

In usr/share/mysql , there's many files. I guess that if i'd setup virtualmin using 2g memory, for mysql, it used my huge config file.

What you suggest me?

About taking virtualmin pro. I guess that if i have something like 25 virtual servers, i need to take the package "virtualmin 50 annual license" ?

If i do it, will you help me fast with all these things?

Sorry to look a little bit noob with my questions but with customers already in production mode there, i'm stressing a lot and i dont want to put them out of work by doing a wrong moove.

Thanks in advance!

Ps: I changed mysql server configuration to listen to 127.0.0.1 but get the same results. I can not change root password and i can not see nothing.. Always get the error can not connect using user @localhost etc...

Mon, 12/16/2013 - 14:23
andreychek

Howdy,

How are you attempting to connect to MySQL?

If you aren't using the "mysql" command line tool, I'm curious what happens if you attempt to access MySQL using the following:

mysql -u root -p

And then enter your MySQL root password when prompted.

If you try the above, does that allow you to access MySQL?

Or, if there isn't a password set, you could just type this:

mysql -u root

That will connect without a password.

And are you saying that your sites are working at the moment, the problem is just in accessing your server as the root user?

What distribution and version is it that you're using?

If you wanted Virtualmin Pro, you would need a Virtualmin 50 if you have 25 domains.

-Eric

Mon, 12/16/2013 - 14:36
Locutus

Here's instructions how to reset your MySQL root password if one is set and you forgot it:

http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

Scroll down to section C.5.4.1.3 for an easy way to reset the root password.

Mon, 12/16/2013 - 14:43
PatTzZ

I tried many things at the moment.

Yes i can connect with command line tool using

mysql -u root

(there's no password)

I tried to setup a password but it's not working.

The problem is that i can not manage virtual servers and most of the parameters like users and so on... i can not do backups, i can not do nothing now.... I always have this error:

DBI connect failed : Access denied for user ''@'localhost' to database 'mysql'

I tried setting password using: mysqld_safe --skip-grant-tables &

When i login after that, there's no password again

If i try this:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypassword');

I get this:

ERROR 1133 (42000): Can't find any matching row in the user table

I tried almost everything i'd read on the web but always getting stucked.

I'm using:

Operating system CentOS Linux 6.5

Webmin version 1.660

Virtualmin version 4.04.gpl GPL

If it was a testing server, i would not be really woried and i would test many things, creating mysql root user, deleting this and adding that but now, everything is working... i'm totaly affraid of shutting down services for my customers.. It took me around 80 hours to setup it properly (without talking about all the problems that i had talking with them, setuping their email with a new username structure and so on... that has been a really hard week... I can not break their services for days... it will be terrible)..

Mon, 12/16/2013 - 15:00
Locutus

What output do you get for this SQL query:

use mysql; select host,user,password from user where User = "root"

(Modify the password row if it's not empty before posting.)

Mon, 12/16/2013 - 14:59
PatTzZ

In case it help you

this is the safemode output of mysql> SELECT * FROM mysql.user WHERE User='root'\G

*************************** 1. row *************************** Host: % User: root Password: a_long_string_here Select_priv: Y Insert_priv: Y Update_priv: Y Delete_priv: Y Create_priv: Y Drop_priv: Y Reload_priv: Y Shutdown_priv: Y Process_priv: Y File_priv: Y Grant_priv: Y References_priv: Y Index_priv: Y Alter_priv: Y Show_db_priv: Y Super_priv: Y Create_tmp_table_priv: Y Lock_tables_priv: Y Execute_priv: Y Repl_slave_priv: Y Repl_client_priv: Y Create_view_priv: Y Show_view_priv: Y Create_routine_priv: Y Alter_routine_priv: Y Create_user_priv: Y Event_priv: Y Trigger_priv: Y ssl_type: ssl_cipher: x509_issuer: x509_subject: max_questions: 0 max_updates: 0 max_connections: 0 max_user_connections: 0 *************************** 2. row *************************** Host: server.myserver.com User: root Password: a_long_string_here Select_priv: Y Insert_priv: Y Update_priv: Y Delete_priv: Y Create_priv: Y Drop_priv: Y Reload_priv: Y Shutdown_priv: Y Process_priv: Y File_priv: Y Grant_priv: Y References_priv: Y Index_priv: Y Alter_priv: Y Show_db_priv: Y Super_priv: Y Create_tmp_table_priv: Y Lock_tables_priv: Y Execute_priv: Y Repl_slave_priv: Y Repl_client_priv: Y Create_view_priv: Y Show_view_priv: Y Create_routine_priv: Y Alter_routine_priv: Y Create_user_priv: Y Event_priv: Y Trigger_priv: Y ssl_type: ssl_cipher: x509_issuer: x509_subject: max_questions: 0 max_updates: 0 max_connections: 0 max_user_connections: 0 *************************** 3. row *************************** Host: 127.0.0.1 User: root Password: a_long_string_here Select_priv: Y Insert_priv: Y Update_priv: Y Delete_priv: Y Create_priv: Y Drop_priv: Y Reload_priv: Y Shutdown_priv: Y Process_priv: Y File_priv: Y Grant_priv: Y References_priv: Y Index_priv: Y Alter_priv: Y Show_db_priv: Y Super_priv: Y Create_tmp_table_priv: Y Lock_tables_priv: Y Execute_priv: Y Repl_slave_priv: Y Repl_client_priv: Y Create_view_priv: Y Show_view_priv: Y Create_routine_priv: Y Alter_routine_priv: Y Create_user_priv: Y Event_priv: Y Trigger_priv: Y ssl_type: ssl_cipher: x509_issuer: x509_subject: max_questions: 0 max_updates: 0 max_connections: 0 max_user_connections: 0 3 rows in set (0.00 sec) <blockcode>     If i do it for root@localhost, i get this:   Empty set (0.01 sec)       I dont know if it help
Mon, 12/16/2013 - 15:06
PatTzZ

I did what you asked Locutus but like almost everything, it's only working in safe mode,, i ended with an -> ... that's it.. You can see here

mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A   Database changed mysql> select host,user from user where User = "root" -> <blockcode>
Mon, 12/16/2013 - 15:09
Locutus

Indeed there seems to be no root user entry for "localhost" for you. The result should look like this:

mysql> select host,user,password from user where User = "root"; +-----------+------+-------------------------------------------+ | host | user | password | +-----------+------+-------------------------------------------+ | localhost | root | *MD5ENCRYPTEDPW | | % | root | *MD5ENCRYPTEDPW | | 127.0.0.1 | root | *MD5ENCRYPTEDPW | | ::1 | root | *MD5ENCRYPTEDPW | +-----------+------+-------------------------------------------+ 4 rows in set (0.00 sec)

You might try to connect to "127.0.0.1" instead of "localhost" on your system, or change the settings of Webmin's MySQL module to do so.

mysql -h 127.0.0.1 -u root -p and enter your root password. Once you get in, add a user entry for "root" and host "localhost" like so:

http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

It's okay that you get "0 rows" for "root@localhost", because the entries in the "user" table are not in the "user@host" form, they contain those two parts in separate columns.

Mon, 12/16/2013 - 15:18
Locutus

Another thought. I have doubts that the issues with root login you're seeing now are caused just by your changing the listen IP to "any". I have the suspicion that something else was changed at the same time, maybe behind the scenes. Possibly some config change had been done before, and became active only now when the server was reloaded or so.

Mon, 12/16/2013 - 15:24
PatTzZ

I tried what you said and if i use -h 127.0.0.1 to connect, i can use the password that i'd setup in safemode but as i said, i'm affraid to create this new user root@localhost because i'm a noob with mysql and dont want to break things.

I should do this?

mysql> CREATE USER 'root'@'localhost' IDENTIFIED BY 'mypassword'; mysql> GRANT ALL PRIVILEGES ON . TO 'root'@'localhost' -> WITH GRANT OPTION;

?

Mon, 12/16/2013 - 15:30
Locutus

Looks okay to me. I'm not an SQL expert though. ;) I usually use some GUI (mostly NaviCat for Windows) to manage MySQL.

Don't forget "FLUSH PRIVILEGES;" afterwards to make the changes become active.

Also you might want to make a copy of the MySQL data directory before doing any changes, so you can always revert back to the previous state if things get worse. Don't forget to shut down MySQL while you do/revert the copy!

Mon, 12/16/2013 - 15:29
PatTzZ

Also, in webmin / mysql

In "change administration password", it say:

Administration login root Current password No password!

and if i put something, nothing is changing.

I'm confused about which mysql root it is. Because the one from host 127.0.0.1 have a password and as i can understand, there's no root for localhost, so, how it can be root without password?

Mon, 12/16/2013 - 15:32
Locutus

The "change administration password" command is to change the user+pass that the Webmin module uses to access MySQL. It does not change the password IN MySQL itself.

Mon, 12/16/2013 - 15:35
PatTzZ

It is a way to know which root it is?

root@locahost

root@127.0.0.1

root@myserveradress

root@%

?

lol... i'm going crazy...

Mon, 12/16/2013 - 16:02
Locutus

Which root what is? It depends on the IP/hostname being connected which user privilege entry is used.

Mon, 12/16/2013 - 16:48
PatTzZ

I was talking about webmin.

Now, I can connect to mysql using

mysql -h localhost -u root -p

(Without password). So, i imagine the user exist.

Is it possible that i just need to grant him all privileges on . ?

Mon, 12/16/2013 - 16:56
Locutus

I guess so, can't really tell. You can see if the proper privilege entry exists when you perform the "select blah from user where user=root" SQL query.

Mon, 12/16/2013 - 17:51
PatTzZ

I just bough a virtualmin license now.

Where to add this license and how to get fast support? lol

Many thanks for your help Locutus! You invested great time with me and i appreciate but i have too many things to do actually, i can not afford to invest 1 week in mysql right now to learn and to make tests. It helped me to increase my knowledge and i appreciate but now i need to finalise other things, in hope this situation will be fixed fast.

Thanks again and waiting support from you guys! (I seen that pro is not like gpl. Honestly, for the moment, the only thing i want is to have support to fix my problem. In the beginning, i wanted to buy the license to support you because virtualmin is really amazing and you did a greatfull job. but now,, one thing bring another... lol

Thanks in advance!

Mon, 12/16/2013 - 17:55
info8

I'm now this user..

Is it possible to use the same account also to dont mix things? Personnaly, i dont really care. Just like that.

Mon, 12/16/2013 - 18:01
Locutus

Hmm, okay then, good luck with that!

I have slight doubts though that the level of support that comes with the Pro version includes faster support than you've been given so far. You can't expect the Virtualmin people to jump into your problem in like a few minutes' matter, especially given that it's specific to your installation (especially with all that addon software you have installed) and not directly related to Virtualmin.

They will certainly suggest to log on to your system themselves and try to fix things, but the level of support they can offer even to paying customers has of course certain limits. Anyway I hope they'll be able to sort things out for you. Take care!

Mon, 12/16/2013 - 18:10
PatTzZ

Yes i understand also what you mean and i dont want to bring them out of their bed for me lol.. but i wanted to support them anyway, so, if they can do deeper investigation it will be good.

I seen that i got fast support from you and andreycheck. Maybe my programmer will be able to fix it before i get other help also but i'm now so much tired of playing into that, i want put some effort somewhere else during that time.

I have few websites to be built. I need to prepare orders for designers, seo guys etc.. I'd put it on ice for more than 1 week now because i needed to transfer all these customers but now, i have the feeling that i need to go back to my things.

Thanks again for the help. With a bit of sleep and freshly shaved, i can go back to business fast also. lol

Take care also!

Mon, 12/16/2013 - 21:20
PatTzZ
  1. 1 physical server only

  2. Not a vps. It's a dedicated server.

Mon, 12/16/2013 - 22:14
PatTzZ

Finally, the problem was because of this change to "any" that i did from webmin.. This change was done in mysql and like mysql is supposed to connect to localhost, it was failing.

My programmer did this query to fix it:

update user set host = 'localhost' where user='root' and host='%' limit 1;

After that, we changed the password in webmin / mysql server config and it was done..

So now.. 1 thing fixed hahaha.. i will sleep better this evening. I just started virtual servers backup to dont take chances and tomorrow i will setup a physical disk backup.

About this php config now. We are using mod_fcgi but as i said, config is not modified if we make some changes. The changes are made only if we modify another server.

Now the backup is running, tomorrow i will come back to you with more details.

Many thanks again!

Tue, 12/17/2013 - 07:57
PatTzZ

Finally, i verified with phpinfo (i dont know why i didnt checked with this before... probably too much things at the same time as TSC said) but everything is working.

My problem is with phpmyadmin.. If i want to upload a big database inside it for a virtual server (import from a file) and i need to increase the import size capacity (upload_max_filesize, post_max_size)

It's not working when i change these values inside the virtualserver where i wanted to increase the size.. but it's working if i increase it on another virtual server (probably the first or the second virtual server i created, or the first in the apache list. I need to inspect deeper to know.

Do you know where phpmyadmin are taking values for a specific virtual server? If it can save me hours of investiguation, i will appreciate.

Tue, 12/17/2013 - 08:44
Locutus

Hello Pat!

Since things seem to be a little more complicated in your case, remote help via forum is probably not too efficient. I can offer to take a look at your system myself, which should speed things up. If it takes longer than about 30 minutes though, and I can help you successfully, I'd have to charge a little fee.

So since you just bought Virtualmin Pro, you'll probably want to ask the VM team for support first. ;)

Tue, 12/17/2013 - 09:41
PatTzZ

Thanks for your offer! I will let you know if necessary.

I can also deal with the actual problem. It's not really dramatical. Just that i like to know my environment as well as possible and when something is not like it's supposed to be, it make me want to fix the situation.

There's few things again that are not perfect on the system but i will do thing by thing.

Actually the VM team are helping me, i will let you know if necessary.

Thanks again for your time yesterday. It helped me to increase my knowledge level.

Have a nice day and keep you in touch here :)

Tue, 12/17/2013 - 11:45
Locutus

@TSC: The thread you linked to is 6 years old!

Of course phpmyadmin itself is "supported" by Virtualmin, even if Webmin has a MySQL editor of its own. You can even auto-install it in the Pro version using the script installers. And you can always install it manually in a VM virtual server.

What you probably meant is that you should NOT install it from a package that comes with your OS. That will probably install the thing in /var/www, which indeed is not "supported" by Virtualmin.