WARNING: Cannot write log file and Permission denied in Ubuntu, when running squid 3 - warnings

I installed Squid3 on Ubuntu 14.04, and did some minor configuration.
When i run Squid3 using terminal, it shows a warning message as below
WARNING: Cannot write log file: /var/log/squid3/cache.log
/var/log/squid3/cache.log: Permission denied
messages will be sent to 'stderr'.
I'm new to squid, so please help me to fix this

When you are running squid from the terminal, are you doing it as yourself? Check the ownership and permissions of /var/log/squid3/cache.log. You probably do not have the right permissions. Usually services like squid are started automatically as their own user.

Related

Laravel - Which user creates log files

My issue is I've a laravel web application and in the storage folder I'm logging the slow SQL queries, but they do not appear. In laravel.log I can see the following error:
[2019-02-22 07:23:21] dev.ERROR: file_put_contents(/var/www/html/com.mywebsite/storage/logs/sql/2019-02-22-slow-log.sql): failed to open stream: Permission denied {"userId":40,"email":"a.user#somewhere.com","exception":"[object] (ErrorException(code: 0): file_put_contents(/var/www/html/com.mywebsite/storage/logs/sql/2019-02-22-slow-log.sql): failed to open stream: Permission denied at /var/www/html/com.mywebsite/vendor/mnabialek/laravel-sql-logger/src/SqlLogger.php:179)
I'm running this on CentOS 7 linux with NginX and PHP-FPM. Both of them runnin with user called web and the permissions on all the files and folders is web:web. However, I saw one slow-query log file, with the permission root:web. What gives?
Oh yeah! I have found the issue. One of my former sys.operators wrote the cronjob and I didn't pay attention. He wrote it for the sudo user and not the web user. It was a job to run certain PHP commands. That is why the log file appeared with root permissions, but later on, the laravel application was unable to write it. Thanks for the help. :)

Ejabberd user registration command fails with {error,access_rules_unauthorized}

I've been trying to set up an XMPP server using ejabberd on windows. every time I try to register a user in ejabberd with this command:
ejabberdctl register admin localhost admin
it gives me this error:
{error,access_rules_unauthorized}
I've installed the ejabberd using its binary installer and according to "install.log" file, the installer also fails to create a user due to the same error.
Part of the log file:
E:\Program Files\ejabberd-16.08\bin>bash ejabberdctl register "admin" "localhost" "admin"
{error,access_rules_unauthorized}
ejabberd.yml config file:
access_rules:
register:
- allow
I've gone even to the 100th search of the google, but found nothing similiar yet. So any help on how to fix this is strongly appreciated.
Try version 16.06 instead of 16.08 from downloads archive https://www.process-one.net/en/ejabberd/archive/ It solved my issue on Centos.
It seems like this is an error in ejabberd 16.08 and has been fixed in the git master.
For the corresponding issue, see https://github.com/processone/ejabberd/issues/1231.
Version 16.06 work for me in windows10, before installation keep firewall off.

Openshift - "Unable to connect to gear" when running: rhc show-app <app> --gear quota

I created an app called "world" following the instructions from:
https://blog.openshift.com/12-tips-for-hosting-wordpress-on-openshift/.
It's a hosted Wordpress blog, with PHP 5.4 scalable up to 1GB, with a Web Load Balancer and MySQL 5.5.
Everytime I try to check for the space used, I get the same error.
rhc show-app world --gears quota
Unable to connect to gear 54d48383fcf933f91f0000aa#54d48383fcf933f91f0000aa-laurapons.rhcloud.com
Unable to connect to gear 54d48383fcf933f91f0000a9#world-laurapons.rhcloud.com
Gear Cartridges Used Limit
------------------------ ------------------- ----- -----
54d48383fcf933f91f0000aa mysql-5.5 error 1 GB
54d48383fcf933f91f0000a9 haproxy-1.4 php-5.4 error 1 GB
I tried to restart the application (using restart and stop&start commands) but nothing seems to work.
I am also facing some other connection problems (probably related to the same issue):
I have the same problem when trying to clone the application with git clone:
ssh: connect to host world-laurapons.rhcloud.com port 22: Bad file number
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
And also with the rhc port-forward world
I copied the URL for git clone from the openshift online dashboard, and I can open the wordpress blog and see all the information, but somehow, I'm unable to access to the data.
I have already created a default Public Key and 2 authorisations (one to access through the browser and the other to access through RHC)...
What should I try?
How can I get the usage?
Do I need to set up anything else?
I am stuck... any suggestion?
Sounds like your SSH key is not working properly. Make sure you installed your keys and that they are working. Try running 'rhc setup'. If that still doesn't work try
ssh -vvv 54d48383fcf933f91f0000a9#world-laurapons.rhcloud.com
and look at the output.
You can also try using
ssh -i /path/to/your/ssh.key 54d48383fcf933f91f0000a9#world-laurapons.rhcloud.com
And see if that works (specifies what ssh key to use)
rhc with some ruby version will have issue with pageant (putty). I closed pageant, ran again rhc command then it worked.

MySQL Server on Windows XP SP3 Installation

I am currently trying to install MySQL Server 5.5 on Windows XP Professional. The only firewall on the computer is the Windows Firewall which I have disabled.
I am going through the MySQL Server configuration and it completes the starting service section but when it tries to apply security settings an error is displayed saying
'The security settings could not be applied to the database because the connection has failed with the following error.
Error Nr. 1045
Access denied for user 'root#localhost' (using password:NO).
I have set up a password for the root account during the configuration wizard of the server and the Windows firewall is disabled. I have tried uninstalling MySQL Server, deleting the MySQL Server in program files, rebooting and trying to reinstall but I still get the same error.
Thanks for your help with this problem.
Problem is sort of solved. For some reason MySQL Server 5.5 comes up with the error saying that a firewall is blocking the security settings settings from being applied even when the firewall is disabled.
However if you install MySQL Server 5.1 there is no problem at all.
If you have problems during installation and the error is MySQL Error Nr. 1045, it means you've done the previous MySQL installation and that the computer system has been read and has saved MySQL files.
What you need to do is:
Uninstall MySQL through the control panel
Delete the MySQL folder in C:\Program Files
Delete the MySQL folder in the directory documents and settings
all you have to do is to delete all data from C:\Program Files (x86)\MySQL then run mysql server instance configuration wizard from Start Menu and reconfig the server
you might remove current instance first

MySQL command line won't open?

I just installed the latest version of MySQL. Until Now I had it on Windows XP but I wanted to install this on another computer with Windows 7.
Even after configuring everything correctly, the MySQL client won't show up in the Start Folder. So I went to the bin folder of MySQL and tried opening mysql.exe but it would immediately close down.
I then tried opening mysql.exe in cmd & this is what I get
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using password: N
O)
Any Ideas how I can get this to work?
Provide username (root)
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -uroot
Default passsword is blank, but if you set it, you will need to provde password as well
I don't recall where I first read it, but when facing this problem before, I found that I had to manually turn on a service:
Windows key+R and type Run and hit "enter"
Type "services.msc", hit "OK"
Find "MySQL56", right-click and choose "Start"
You should now be able to log in with no trouble
That's the solution that worked for me; hopefully it helps others out there.
What #Herschel said is right if you follow his steps 1-4 then try to log in with your password in command line you'll have no trouble.
You can also make this run automatically as a service, something which you need when running it on a server.
Open Run
Type "services.msc" click ok
Find the MySQL service
Right-click properties then go down to startup type:
Change it to automatic
I followed these steps and it worked for me:
1. Open Command prompt in admin and go to the location of Mysql bin folder and type -
C:\ProgramFile\mysql\bin>mysql -u root -p <password>
2. Then the prompt asks for the password. This is the password or the root user which
you had set during installation of mysql.
3. Type the password and you will login in to mysql.
4. Also make sure your mysql service is running in the backend by going to the
windows service panel and check whether the mysql service is running.
Heyoo Heyoo. So as of today 19th March 2022 I had this same issue but imma show you how I solved it. My specs before we start:
MySql Version: 8.0
OS: Windows 10
OS Build: 19044.1586
Alright, I'm fairly new to SQL, was following along with a tutorial but when it got to the point of opening the client command line it wouldn't open, it just popped up and closed back; didn't even ask for a password. After watching several tutorials (which were very unhelpful) I noticed from those tutorials that the solution they proffered was to "Active the MYSQL80 service", but that was unhelpful to me because I couldn't see that service in the services menu.
So I decided to go back to the "MySql Installer -Community" App (I installed the community version of SQL)
After the installer had opened up I clicked on the "Reconfigure" action for MySQL Server
It opened the configuration window for the SQL Server and I followed the configuration process to set up the server (turns out I didn't initially set it up when I installed MySQL 😅😅). After the configuration process was done I went back to the services menu to see if the "MYSQL80" service was there... and it was, I checked to see if it was running; following the instructions from this tutorial. After making sure the service was running I went back to the client command line, it finally opened up, allowed me to input my password, and it's working properly!!