ipfw resetting after reboot - ipfw

I added a rule in my ipfw a time ago and now I want to delete it. So i go:
sudo ipfw flush
And all user rules gets deleted. But everytime i restart the machine the rule is back again!
I tried looking for some ipfw config file, but has not find anything. When I added the rule the first time i user WaterRoof (frontend for ipfw), could that have somthing to do with this? (I also tried removing the rule with WaterRoof, but same result)
Any ideas on where this rule gets added every time? I don't know where to start.
Im running OS X 10.6

Hmpf... It was Internet Sharing that added the rule, when I turned it of it all went back to normal.

Should be the same for OSX. Run:
cat /etc/rc.conf |grep -i "firewall"
You should see:
firewall_script="/etc/ipfw.rules"
Modify whatever file that parameter is using.

Related

Libvirt generated profiles

I'm using apparmor as hardening layer for libvirt-qemu , everything is OK , but there is one thing that I can't solve systematically, let me explain :
When create a new qemu instance , profile is generated from /etc/apparmor.d/libvirt/TEMPLATE.qemu to a file with path /etc/apparmor.d/libvirt/libvirt-81303229-df4c-4b18-b33b-277bcda81b0f for example .
When instance is shut-off profile is unloaded from kernel by apparmor and it is OK as expected. But if i remove the instance definitively, i would expect that profile is removed also from filesystem, but it is not and still present in filesystem. After some time I have very big mess in libvirt instance profile files
Yes .. I can write a cron job what will be delete unnecessary libvirt profile files ... but ..is there some more clear solution , maybe builtin function of apparmor ?
Thanks
Are you using libvirt undefine to delete the stopped guest? It appears that virt-aa-helper should delete an undefined domain but I think it is a bug and you should file a ticket.
You can use the virt-aa-helper command directly to remove the files which is probably the safest as it should deal with the dependencies for you.
An example command is:
$ sudo /usr/lib/libvirt/virt-aa-helper -D -u libvirt-3c3d5aa2-f581-457d-b5ab-efbf9fdd4a6e
But it may be some edge case that they need to account for, where you can undefine a running instance to convert it to ephemeral. You would need to take care of that edge case.
Note: Because virt-aa-helper is intended to be run by libvirt you will have to use sudo with the command. If you do not it will silently fail and not remove the profile.

icmp_echo_ignore_all doesn't get set

I'm trying to set icmp_echo_ignore_all to 1, and I am able to do so using the following:
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
I've also edited the sysctl.conf file and added:
net.ipv4.icmp_echo_ignore_all = 1
and then I followed with this:
sysctl -p
Supposedly the last two steps would permanently set icmp_echo_ignore_all to 1, until the next time I enable it. Every time I reboot, though, it goes back to 0. Am I missing a step? I'm doing it on a virtual machine running Ubuntu 14.04 LTS.
Any advice would be greatly appreciated.
For me this did only get set after I issued sysctl -w to set the setting, as opposed to editing sysctl.conf manually.
I found that most other settings in sysctl.conf are picked up on reboot as sysctl.conf is linked also as /etc/sysctl.d/99-sysctl.conf
For some reason this one isn't - or it is, but later in the boot process gets overwritten - so after a boot I usually manually issue sysctl -w again.

Phpmyadmin shows blank page

Recently we have upgraded our mysql from 5.5.x to 5.6.x in an Ubuntu 12.04, also we have changed php5-mysql library with php5-mysqlnd(Which is recommended from MySql).
Since our change in library phpmyadmin stopped working and shows a blank page.
I have followed so many forum and advises from forum contributor but have not had success so far.
I also used ubuntu repository as suggested in this other topic at stackoverflow ppa:nijel which I believe has the modified phpmyadmin package and include the support of php5-mysqlnd, but still no success.
I also have enabled highest verbosity on the php.ini but still nor error or warning is generating in any log, using chrome developer tools it shows "500 Internal Server Error".
I am clueless now, if anyone can help me to determine what I may be missing obvious.
I just ran into a very similar error and I thought I would leave my solution here in case anyone finds this searching for my error. The difference was, that phpMyAdmin showed a blank page after a successful login.
The solution was, removing the "X-Frame-Options: Deny" header.
When setting up the webserver, I didn't remember that phpMyAdmin would rely on iFrames to serve its interface.
Check Mysql & Php error log files located at /var/log/mysql/error.log and /var/log/apache2/error.log respectively
Even after multiple uninstall, purge and reinstall of phpmyadmin I did not get a success.
Finally I used bruit-force approach and from another Linux server where phpmyadmin was running properly I copied all i.e. /usr/share/phpmyadmin, /etc/phpmyadmin and /var/lib/phpmyadmin folders and over write them in the problematic server.
Every thing works perfectly now.
Thanks for help Vibhas... I just thuoght to post just for someone's help.
In case someone (like I was) is using phpmyadmin via xampp on windows and has skype turned on - try turning skype off (or configure xampp to use another port).
I was facing a similar issue with phpmyadmin (phpmyadmin was returning a blank page). It was alright once I reinstalled phpmyadmin using:
apt-get install --reinstall phpmyadmin
If you are not root:
sudo apt-get install --reinstall phpmyadmin
When i changed this inside the config.inc.php:
$cfg['UploadDir'] = '/tmp';
$cfg['SaveDir'] = '/tmp';
to:
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
and reloaded the page then it worked directly!
This is a long shot, but it happened to me when I realised after a cPanel password reset I did not check the "Synchronize MySQL password" option.
This used to be defaulted as checked in previous cPanel versions.
To fix all I did was reset my cPanel password again and selected the "Synchronize MySQL password" checkbox and PhpMyAdmin was back.
Hope this helps others, and if its causing a big issue cPanel should select this option by default again.
I had a similar experience after installing mysql 5.5.60 and phpmyadmin 4.2.12 and what did the trick for me was changing folder ownership for /var/lib/php/session which was the solution in another case for getting php-scripts tu run in general. In my case user www-data is trying to execute related scripts, so I set folder permissions accordingly
chown -R www-data:www-data /var/lib/php5/
and the page appeared as expected.
A web search for [phpmyadmin blank page] shows many people are having this problem and there are almost as many different solutions proposed. So let me add one more after spending a day and finally having success:
When the blank page was displaying, I opened Developer Tools (Command-Option-i on Mac in Chrome or Brave). I immediately observed multiple instances of failing to load .js files from phpmyadmin/js/dist. Checking that directory I found that it was indeed empty.
I then went to https://www.phpmyadmin.net/ and downloaded the zip file into a different location. When I unzipped it, I found js/dist did in fact contain many .js files. I copied all of these files to my webserver's phpmyadmin/js/dist directory. And the problem was solved! I now have a working page.
I hope that helps some of you.
Perhaps I should add that I installed phpmyadmin using the Composer install method (% composer create-project phpmyadmin/phpmyadmin). I did it a second time in an offline directory and again the js/dist directory was empty. I don't know if that means I did something wrong or if that install method is broken.

Cannot login to phpMyAdmin, no errors shown

I have MySQL set up correctly on my linux computer, however I want a better way to input data into the database besides terminal. For this reason, I downloaded phpMyAdmin. However, when I try to log in to the phpMyAdmin from index.php, it doesnt do anything. It seems to just refresh the page without doing anything. I am putting in the correct MySQL username and password. What is the issue?
Here is a screen shot of what it shows after I click "go".
This is a possible issue when the path to save php_session is not correctly set :
The directory for storing session does not exists or php do not have sufficient rights to write to it.
To define the php_session directory simply add the following line to the php.ini :
session.save_path="/tmp/php_session/"
And give write rights to the http server.
usually, the http server run as user daemon in group daemon. If it is the case, the following commands will make it :
chown -R :daemon /tmp/php_session
chmod -R g+wr /tmp/php_session
service httpd restart
Login fails if session folder in not writeable. To check that, create a PHP file in your web directory with:
<?php
$sessionPath = 'undefined';
if (!($sessionPath = ini_get('session.save_path'))) {
$sessionPath = isset($_ENV['TMP']) ? $_ENV['TMP'] : sys_get_temp_dir();
}
if (!is_writeable($sessionPath)) {
echo 'Session directory "'. $sessionPath . '"" is not writeable';
} else {
echo 'Session directory: "' . $sessionPath . '" is writeable';
}
If session folder is not writeable do either
sudo setfacl -R -m u:www-data:rwx <session directory> or chmod 777 sudo setfacl -R -m u:www-data:rwx <session directory>
-
I am late to the game, but on Amazon linux AMI I could not log in to phpmyadmin ... it just kept refreshing the login screen with no errors.
I have fixed with below command
sudo chmod -R 755 /var/lib/php/session
I fixed my issue on CentOS 7 with MariaDB and phpmyadmin I downloaded from offical phpmyadmin site by adding
session.save_path = "/var/lib/php/session"
to /etc/php.ini
and
chown -R :lighttpd /var/lib/php/session
I also restarted php-fpm and lighttpd after
In my case the solution was to set an Apache setting properly:
ProxyPassReverseCookiePath
This was required, because ProxyPass and ProxyPassReverse were in use, but cookie paths are not changed automatically.
It'd be great if PHPMyAdmin had shown something like session not found or anything, when password is sent with POST.
Do you have a .htaccess file in one of the parent directories that strips off index.php from the url by doing a 301 redirect?
301 redirects discard the form data and redirect you as if you didn't submit anything. So you get returned to the login page.
So you should create a local .htaccess file in the phpmyadmin directory with a single line RewriteEngine On. This will overwrite the previous rewrite rule to nothing.
You may need to clear the browser cache as Chrome aggressively caches 301 redirects.
In my case the hard drive was full.
Use df -h to check the space left on your hard drive, and if you want you can free some space by using the command sudo apt-get clean, which removes installation files.
I hope this will help some future users.
I ran these commands and it worked for me:
sudo service httpd restart
sudo service mysqld stop
sudo service mysqld start
Try searching the web for installation or setup guides for phpMyAdmin. Look at two or three of these and make sure you have covered all the required steps. (If you have already done so, please include which guides you have followed it in the question).
See if it helps to edit config.inc.php (acecoder mentioned this as well).
Check if this guide is of any help.
Which distro are you on? Try searching for the name of the distro you are using together with "phpMyAdmin guide" or "phpMyAdmin setup howto".
If you encounter errors along the way, post the error text here, if it's short (or paste via a pastebin-like site if it's long).
Are you sure that mysql is running? I had the same issue after doing a database import and filling up the volume containing the mysql database. After changing various permissions and clearing sessions, I tried to restart mysql (/etc/init.d/mysql restart) and it failed because the volume was full. After increasing /var and starting mysql successfully, I was able to log into phpmyadmin just fine.
If you have an error like:
Host 'host_name' is blocked because of many connection errors.
Login in your mysql as root and run the flush hosts command
1.- mysql -u root -p
2.- mysql > flush hosts
After this I was able to login again in phpmyadmin
phpMyAdmin will show errors when login fails. If it doesn't, it means that your setup has an error.
The most likely place to check is your php.ini settings. Since there doesn't seem to be an official list of phpMyAdmin-compatible settings, it's mostly trial and error.
Make sure you have enabled the stuff that needs to be enabled. Also check that you did not enable uncommon php.ini settings (like enable_post_data_reading = Off) because phpMyAdmin assumes them to be "the usual ones".
To ease debugging, start with a clean default php.ini file then tweak them line by line to see which setting is causing the error. (Don't forget that you need to restart your server after changing the php.ini file for the changes to take place.)
In my case it was due to an old Apache session.
Stop Apache, clear all pending sessions in your sessions.save_path directory (example: /var/lib/php/session) and restart Apache.
Make sure to set a 32 chars long random key in 'config.inc.php' in the $cfg['blowfish_secret'] value. That solved it for me.
Didn't realize I need to restart MariaDB after modifying config.inc.php:
service mariadb restart
Otherwise at least in my case changes didn't come affect. Also make sure your php session directory is writable by webserver (typically session.save_path = "/var/lib/php/session")

How to install MySQL on Leopard, Mac OS X 10.5?

I followed this tutorial to the very end, then found out it didn't work right. I think I have everything installed but when I type
mysql -uroot
I only get
-bash: mysql: command not found
Note: I did not skip the "Setting the Path" step. Upon running this command for the first time:
mate ~/.bash_login
This brought up an empty file. So I added this line:
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
I saved the file, closed TextMate, executed the following command:
. ~/.bash_login
...and continued with the tutorial. Based on your suggestions, I thought maybe the file didn't actually get saved. So I ran the following command to bring up the file again:
mate ~/.bash_login
...yet the contents of the file were as they should be.
Any suggestions?
You probably don't have the mysql binaries in your path.
The link you posted has a section on setting the path, titled "Setting the Path Do not skip this step! Most everything else will fail if you do."
EDIT: As debugging steps, try:
First launching a new terminal window. Does it run now?
Typing "echo $PATH" at the prompt. Does the path show up correctly as you've typed it in bash_profile?
Running it the long way: /usr/local/mysql/bin/mysql -u root
Does the application run?
Did you follow the step that says
Setting the Path
Do not skip this step! Most everything
else will fail if you do.
Did you close your terminal window and re-open it afterwards?
Update:
What does "which mysql" say? Does "ls /usr/local/mysql/bin" say?
Two things:
Try editing ~/.profile (rather than ~/.bash_profile or ~/.bash_login).
You may find it easier to use the native Mac style .dmg installer directly from Sun.
One nice thing about the dmg installer is that it automagically sets up symlinks to /usr/local/mysql (which means less - or no - fiddling with your $PATH).
Another option would be to use MAMP.
It has Apache, PHP and MySQL packaged with no further setup necessary.
MySQL is usually put in /usr/local/mysql/bin/
You need to add this to your PATH, you can do this by adding the follwoing lines to your .bash_profile
PATH=$PATH:/usr/local/mysql/bin/
export PATH
The .bash_profile file is located in the root of your username directory.
Make sure you restart your Terminal for the setting to take affect.
And if you're not a command-line person, I highly recommend you also install the MySQL Preference Pane to start/stop the server and install Sequel Pro to create databases and run queries.
ftp://ftp.mysql.com/pub/mysql/download/gui-tools/MySQL.prefPane-leopardfix.zip
http://www.sequelpro.com/