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!

  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”.

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!

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.

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

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.

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

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. :frowning:

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?

Yeah that’s a pitfall that happened to me before too (not with root luckily :wink: ).

“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.

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.

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.)

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…

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

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.

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)…

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)

If i do it for root@localhost, i get this:

Empty set (0.01 sec)

I dont know if it help

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.)

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”
->

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.

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.

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;

?