#Which command checks the user’s path:
which iptables
/sbin/iptables
#Whereis command checks a list of standard Linux places
whereis iptables
iptables: /sbin/iptables /usr/share/man/man8/iptables.8.gz
#Which command checks the user’s path:
which iptables
/sbin/iptables
#Whereis command checks a list of standard Linux places
whereis iptables
iptables: /sbin/iptables /usr/share/man/man8/iptables.8.gz
find . -type d exec chmod 1775 {} \; -print
The most common use of the sticky bit today is on directories. When the sticky bit is set, only the item’s owner, the directory’s owner, or the superuser can rename or delete files. Without the sticky bit set, any user with write and execute permissions for the directory can rename or delete contained files, regardless of owner.
To create bin-logs
enable log-bin, set that to a directory (/var/lib/mysql)
Restart mysql
To read them out:
mysqlbinlog /var/lib/mysql/bin-log.000001 > /root/textform
To replace all instances of search with replace throughout the file called filename:
“sed -i -e s/search/replace/g filename” to edit one in place
“cat filename | sed s/search/replace/g > /tmp/tmpfile ; mv /tmp/tmpfile filename”
Using Apache keepalives on your server can reduces CPU usage since it allows the same connection to be used for images, stylesheets, javascript, etc. If KeepAlive is disabled a separate connection must be made for each of those files. Creating and closing connections has an overhead and doing it for every single file wastes CPU time. The converse to this is memory usage. Keepalives can use a lot of memory.
Cause of 503 Service Unavailable Errors
The 503 Service Unavailable error is an HTTP status code that means the web site’s server is simply not available right now. Most of the time this is because the server is too busy or because there’s maintenance being performed on it. It can also mean that a backend process like Tomcat has become unavailable.
1) Retry the URL from the address bar again by clicking the reload/refresh button or pressing F5.
Note: If the 503 Service Unavailable error message appears while paying for an online purchase, be aware that multiple attempts to checkout may end up creating multiple orders – and multiple charges! Most payment systems, and some credit card companies, have protections from this kind of thing but it’s still something to be aware of.
2) Come back later. The 503 Service Unavailable error is a common error message on very popular websites when a huge increase in traffic by visitors (that’s you!) is overwhelming the servers. As more and more visitors leave the website, the chances of a successful page load for you increases.
3) Restart your router and then your computer, especially if you’re seeing the “Service Unavailable – DNS Failure” error. While the 503 error is still most likely the fault of the web site you’re visiting, it’s possible that there’s an issue with your computer’s or router’s DNS server configurations and a simple restart of both might fix the problem.
When you are trying to troubleshoot a site and see that, from a host perspective, nothing is overloaded or in trouble.
Run:
lsof -ni | grep httpd | wc -l
If that number is the same as (or about the same as) MaxClients, and nothing else looks bad, you probably need to employ some caching.
To test, increase maxCilents, and restart apache. If these newly available connections immediately get used, you have found your culprit.
Install Varnish and rejoice
TO ensure that a service does not start at reboot, use the following tools:
chkconfig servicename off
or ubuntu:
update-rc.d servicename disable
Pick the appropriate one for your operating system:
usermod -g www-data -G username username
usermod -g apache -G username username