Control Web Panel
WebPanel => Postfix => Topic started by: maestrofx on December 13, 2014, 01:11:19 PM
-
Hello,
I got an error below after completely installing CWP on my server.
I have do searching for many error encountered that problems, but no clue to solve it now.
and there's no file as mention here: /usr/local/cwpsrv/htdocs/admin/include/postfix.php
Warning: mysql_connect(): Access denied for user 'postfix'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php(1) : eval()'d code(1) : eval()'d code on line 2
Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php(1) : eval()'d code(1) : eval()'d code on line 2
Could not connect to database postfix check configuration file: /usr/local/cwpsrv/htdocs/admin/include/postfix.php
thank you
-
this error is because you don't have that file, have you installed CWP on the clean CentOS server minimal?
-
this error is because you don't have that file, have you installed CWP on the clean CentOS server minimal?
hello admin,
Yes, sadly, the main problem: because CWP installed on existing server, not the clean one :(
I try to browse spesificly through the CWP script installation and found the mail server steps didn't work correctly. So, I've checked it and have done my own setup based on my server configuration before. It solved.
After that, I installed CWP in clean VM server, I found no error at all.
Thanks
-
They have changed the postfix's config location to
/usr/local/cwpsrv/htdocs/resources/admin/include/postfix.php
-
Hello all,
I managed to fix my problem with changing password for user postfix in mysql.
remember that you can;t change the file /usr/local/cwpsrv/htdocs/resources/admin/include/postfix.php, so just copy the password :)
so here are the steps:
login to server via SSH,
[root@yourserver~]#mysql
SET PASSWORD FOR 'postfix'@'localhost' = PASSWORD('YOURPASSWORD');
[root@yourserver~]#service mysqld restart
this is it
enjoy
-
Hi valivarona
Thanks for providing a resolution on this fix however I've not really used a SSH service before and a little worried I mess things up.
I have installed Putty to access the Root to server and can login as the root user however after that I'mm completely lost. I tried what you had put but got a message SET: command not found.
Would you please be so kind as to provide an idiots guide to correcting this as I would really like to create an email address with my domain rather than use gmail or yahoo mail.
Thanks in advance
-
Hello @Moonshine
1. Login into your server via SSH.
2. nano /usr/local/cwpsrv/htdocs/resources/admin/include/postfix.php
?php
/* MySQL hostname [ localhost (127.0.0.1 via TCP/IP) ] */
$db_host_postfix = "localhost";
/* The name of the database */
$db_name_postfix = "postfix";
/* MySQL database username */
$db_user_postfix = "postfix";
/* MySQL database password */
$db_pass_postfix = 'YOUR_PASWORD';
?>
3. copy your password
4. enter mysql
[root@yourserver~]#mysql
it should look like this
[root@your_server ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1472
Server version: 5.5.48 MySQL Community Server (GPL) by Remi
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
5. change postfix password
SET PASSWORD FOR 'postfix'@'localhost' = PASSWORD('YOUR_PASSWORD');
6. exit mysql
mysql> Ctrl-C -- exit!
Aborted
7. restart mysql
[root@yourserver~]#service mysqld restart
also you can try to reboot your server.
hope this helps.
-
Hi @Valivarona
Thanks for the quick response. I tried what you had writen and I did get the information regarding the post pasword etc however when typing in "[root@yourserver~]#mysql" nothing else happened at all.
Not sure if I did it right to be honest.
The actual error message I get is
Warning: mysql_connect(): Access denied for user 'postfix'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_list.php(1) : eval()'d code(1) : eval()'d code on line 2
Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_list.php(1) : eval()'d code(1) : eval()'d code on line 2
Could not connect to database postfix check configuration file: /usr/local/cwpsrv/htdocs/admin/include/postfix.php
Thanks again
Moonshine
-
you need to type in only "mysql" when you login as root on the server and then following two commands
mysql
SET NEW PASSWORD
SET PASSWORD FOR 'postfix'@'localhost' = PASSWORD('YOUR_PASSWORD');
ACCEPT NEW Changes
flush privileges
-
After an auto-update of CWP, I dont know what is the reason I lost the user postfix in mysql
This is how i fixed it, run this SQL as root
GRANT ALL PRIVILEGES ON postfix.* TO 'postfix'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD' WITH GRANT OPTION;
Then, the configuration of postfix file was also changed its location, we need to copy from old location and put it back in right place
sudo chattr -i /usr/local/cwpsrv/htdocs/admin
mkdir /usr/local/cwpsrv/htdocs/admin/include/
mv /usr/local/cwpsrv/htdocs/resources/admin/include/postfix.php /usr/local/cwpsrv/htdocs/admin/include/postfix.php
nano /usr/local/cwpsrv/htdocs/admin/include/postfix.php
put your new password in the file
-
Hi valivarona
Thanks for providing a resolution on this fix however I've not really used a SSH service before and a little worried I mess things up.
I have installed Putty to access the Root to server and can login as the root user however after that I'mm completely lost. I tried what you had put but got a message SET: command not found.
Would you please be so kind as to provide an idiots guide to correcting this as I would really like to create an email address with my domain rather than use gmail or yahoo mail.
Thanks in advance
made my Sunday !!!!!
Thanks
-
I still can't get my email working :( i already set it all up and the last error was
2017/07/27 16:19:54 [error] 1685#0: *13921 FastCGI sent in stderr: "PHP message: PHP Warning: [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0
PHP message: PHP Warning: [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0" while reading upstream
-
I still can't get my email working :( i already set it all up and the last error was
2017/07/27 16:19:54 [error] 1685#0: *13921 FastCGI sent in stderr: "PHP message: PHP Warning: [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0
PHP message: PHP Warning: [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0" while reading upstream
to create email account you need to have created account with domain which you can then use when creating new email address...if you dont have account then you can't create email address.
This is info if only if you postifx db admin user works properly and its set in all required locations.
If you need to set new user then make sure that you use old username and password for database as otherwise you will need to change it on many locations, you can check your old user details in /etc/postifx/mysql-***.cf file
-
I still can't get my email working :( i already set it all up and the last error was
2017/07/27 16:19:54 [error] 1685#0: *13921 FastCGI sent in stderr: "PHP message: PHP Warning: [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0
PHP message: PHP Warning: [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/resources/admin/modules/mail_add-new.php on line 0" while reading upstream
to create email account you need to have created account with domain which you can then use when creating new email address...if you dont have account then you can't create email address.
This is info if only if you postifx db admin user works properly and its set in all required locations.
If you need to set new user then make sure that you use old username and password for database as otherwise you will need to change it on many locations, you can check your old user details in /etc/postifx/mysql-***.cf file
I already set things up , already have an account and the passwords to connect to mysql is correct.
But still the error persist.
Thank you in advance