Tuesday, May 25th, 2010
This amazing bash linux prompt does more than meets the eye. If you want to know how to become really good with technology, linux is the secret sauce behind the AskApache articles. Open Source is elixir of the web. Thanks to everyone who helped me for the past 20 years. I use linux/bsd because homey don’t play, so this is geared to be as productive a prompt as I can make it.
Don’t have much time.. or just don’t care? Not a problem, here are the 3 lines to copy and paste – you can just paste them right in your shell to test it, or add to a startup script.
export AA_P="export PVE=\"\\033[m\\033[38;5;2m\"\$(( \`sed -n \"s/MemFree:[\\t ]\\+\\([0-9]\\+\\) kB/\\1/p\" /proc/meminfo\` / 1024 ))\"\\033[38;5;22m/\"\$((\`sed -n \"s/MemTotal:[\\t ]\\+\\([0-9]\\+\\) kB/\\1/p\" /proc/meminfo\`/ 1024 ))MB\"\\t\\033[m\\033[38;5;55m\$(< /proc/loadavg)\\033[m\";echo -en \"\""
export PROMPT_COMMAND="history -a;((\$SECONDS % 10==0 ))&&eval \"\$AA_P\";echo -en \"\$PVE\";"
export PS1="\\[\\e[m\\n\\e[1;30m\\][\$\$:\$PPID \\j:\\!\\[\\e[1;30m\\]]\\[\\e[0;36m\\] \\T \\d \\[\\e[1;30m\\][\\[\\e[1;34m\\]\\u@\\H\\[\\e[1;30m\\]:\\[\\e[0;37m\\]\${SSH_TTY} \\[\\e[0;32m\\]+\${SHLVL}\\[\\e[1;30m\\]] \\[\\e[1;37m\\]\\w\\[\\e[0;37m\\] \\n(\$SHLVL:\\!)\\\$ " && eval $AA_P
Tags: .bashrc, 404 Not Found, admin, Advanced, Apache, askapache, bash, bash_profile, CommandLine, Dig, Examples, Forms, GET, grep, HowTo, Kung-Fu, Linux, Login, mysql, Port, Prompt, PROMPT_COMMAND, PS1, Putty, ram, Redirect, server, servers, Shell, Shell History, SPEED, SSH, SSI, stat, trick, Username, Web Hosting
Posted in Apache, DreamHost, Featured, Hacking, Htaccess, Linux Unix BSD, Making Money, Security, Server Administration, Shell Scripting, Web Hosting, Webmaster, WiredTree | 8 Comments »
Thursday, March 18th, 2010
NOT a typo.. 30x is measurable, well-documented, and easily tested. This is what open-source is about. I haven’t had time to post much the past year, I’m always working! So I wanted to make up for that by publishing an article on a topic that would blow your mind and be something that you could actually start using and really get some benefit out of it. This is one of those articles that the majority of web hosting companies would love to see in paperback, so they could burn it.
Tags: Advanced, Apache, askapache, Backups, Bandwidth, Boot, Cache, chmod, console, devshm, DreamHost, File System, filesystem, grep, Hard Drive, HowTo, HTTPS SSL, ionice, Linux, memory bandwidth, mysql, Private Server, ram, rsync, Scripts, Security, server, servers, Shell, shell script, SLRAM, SPEED, speed improvements, SSI, stat, SymLinks, tmpfs, trick, Vulnerability, Web Hosting, webhosts, WordPress, WP-Super Cache
Posted in Apache, Cache, DNS, DreamHost, Featured, Hacking, Htaccess, Linux Unix BSD, Mod_Rewrite, PHP, Security, Server Administration, Shell Scripting, Web Design, Web Hosting, Web Tools, Webmaster, WiredTree, WordPress, WordPress Plugins | 7 Comments »
Sunday, November 29th, 2009
There are so many WordPress plugins out there now that I wanted to post my favorite 3 plugins for speeding up a WP-Powered blog. These are the 3 plugins that I install for pretty much all of my WP-Powered sites, which I run about 300 now. They work together to provide a very optimized blog for speed.
DB-Cache Reloaded does something entirely different, it saves the mysql queries that are made to the WP-database, as well as the mysql results to static files, and then through php serves those cached-files instead of re-querying the mysql database. Most mysql databases are stored on separate servers, and although many are on the same local network there is a limit to how many queries, and how many connections can take place.
So DB-Cache Reloaded basically makes WP-Super Cache work alot faster when generating the cache files, and DB-Cache Reloaded helps in a number of areas un-related to WP-Super Cache, like in the admin panel. And DB-Cache without WP-Super-Cache is a joke because it still uses the application-level and php for everything. Gotta use both (or just WPSC).
Tags: admin, Apache, askapache, AskApache Crazy Cache, Bandwidth, Bottleneck, Cache, caching, compression, Dig, filesystem, GET, httpd, mysql, Networking, password, PHP, post, Private Server, ram, Scripts, server, servers, SPEED, SSI, stat, Web Hosting, WordPress, WordPress Optimizing, WordPress Plugins, WordPress Speed, WP-Super Cache
Posted in Apache, Cache, Featured, Mod_Rewrite, Review, Server Administration, Web Hosting, Webmaster, WordPress, WordPress Plugins | 14 Comments »
Saturday, October 10th, 2009
To prepare for several upcoming articles on AskApache that are focused on optimizing Servers and Sites from a server admin level, here is an article to introduce the main tools that we will be using. These tools are used to optimize CPU time for each process using nice and renice, and other tools like ionice are used to optimize the Disk IO, or Disk speed / Disk traffic for each process. Then you can make sure your mysqld and httpd processes are always fast and prioritized.
Tags: 503, Advanced, Apache, askapache, Backups, Bandwidth, bash, Blocking, Boot, Bottleneck, caching, compression, CPU, CSS, curl, Disk IO, DNS, Examples, feed, fifo, GET, httpd, ionice, iostat, Javascript, Linux, mysql, Nice, Optimization, pagefile, Performance, Perl, PHP, Port, ram, Renice, Round Robin, rsync, Scripts, Security, server, servers, Shell, shell script, Shell Scripting, Socket, SPEED, SSH, SSI, stat, taskset, trick, Ulimit, Web Hosting, WordPress, wp-config.php
Posted in Apache, Cache, Featured, Linux Unix BSD, Review, Security, Server Administration, Shell Scripting, Web Hosting, Webmaster | 3 Comments »
Saturday, January 10th, 2009
Skip this – still under edit
I discovered these tips and tricks mostly while working as a network security penetration specialist hired to find security holes in web hosting environments. Shared hosting is the most common and cheapest form of web-hosting where multiple customers are placed on a single machine and “share” the resources (CPU/RAM/SPACE). The machines are configured to basically ONLY do HTTP and FTP. No shells or any interactive logins, no ssh, just FTP access. That is when I started examining htaccess files in great detail and learned about the incredible untapped power of htaccess. For 99% of the worlds best Apache admins, they don’t use .htaccess much, if AT ALL. It’s much easier, safer, and faster to configure Apache using the httpd.conf file instead. However, this file is almost never readable on shared-hosts, and I’ve never seen it writable. So the only avenue left for those on shared-hosting was and is the .htaccess file, and holy freaking fiber-optics.. it’s almost as powerful as httpd.conf itself!
Most all .htaccess code works in the httpd.conf file, but not all httpd.conf code works in .htaccess files, around 50%. So all the best Apache admins and programmers never used .htaccess files. There was no incentive for those with access to httpd.conf to use htaccess, and the gap grew. It’s common to see “computer gurus” on forums and mailing lists rail against all uses and users of .htaccess files, smugly announcing the well known problems with .htaccess files compared with httpd.conf – I wonder if these “gurus” know the history of the htaccess file, like it’s use in the earliest versions of the HTTP Server- NCSA’s HTTPd, which BTW, became known as Apache HTTP. So you could easily say that htaccess files predates Apache itself.
Once I discovered what .htaccess files could do towards helping me enumerate and exploit security vulnerabilities even on big shared-hosts I focused all my research into .htaccess files, meaning I was reading the venerable Apache HTTP Source code 24/7! I compiled every released version of the Apache Web Server, ever, even NCSA’s, and focused on enumerating the most powerful htaccess directives. Good times! Because my focus was on protocol/file/network vulnerabilites instead of web dev I built up a nice toolbox of htaccess tricks to do unusual things. When I switched over to webdev in 2005 I started using htaccess for websites, not research. I documented most of my favorites and rewrote the htaccess guide for webdevelopers. After some great encouragement on various forums and nets I decided to start a blog to share my work with everyone, AskApache.com was registered, I published my guide, and it was quickly plagiarized and scraped all over the net. Information is freedom, and freedom is information, so this blog has the least restrictive copyright for you. Feel free to modify, copy, republish, sell, or use anything on this site ;)
Tags: .htaccess examples, 301 Redirect, 302 Redirect, 401, 403 Forbidden, 404 Not Found, 500, 503, admin, Advanced, Apache, Apache Htaccess, apache ssl, askapache, ASP, authorization, Backups, Bandwidth, bash, Blocking, Boot, Cache, Cache-Control, caching, cheatsheet, chmod, code snippets, compression, Cookies, CSS, debugging, DreamHost, Email, error log, errordocument, Etags, Examples, experiments, feed, FeedBurner, File System, FilesMatch, filesystem, Firefox, Flash, Forms, GET, Google, Hacking, hotlinking, HowTo, Htaccess, htaccess files, htaccess guide, htaccess rewrite, htaccess tricks, htaccess tutorial, Htpasswd, HTTP Error, HTTP Headers, HTTP-EQUIV, httpd, httpd.conf, HTTPS SSL, hyper text transfer protocol, If-Modified-Since, Javascript, Last-Modified, Linux, Login, Logs, mad skills, mod_include, mod_python, Mod_Rewrite, Mod_Rewrite examples, Mod_Security, Mod_Setenvif, mysql, Nice, nsa, password, password protection, PDF, Performance, Perl, PHP, php.ini, phpinfo, Port, post, Powweb, Prompt, Python, ram, Redirect, Redirection, Request Method, Rewrite Tricks, rewritecond, rewriterule, Robot, robots, Sample .htaccess, Scripts, Security, SEO, seo secrets, server, server config, servers, SetEnvIf, Shell, Socket, Source Code, SPEED, SSH, SSI, stat, SymLinks, trick, tutorial, ultimate htaccess, Username, Web Hosting, WordPress
Posted in Apache, Apache Modules, Cache, DreamHost, Featured, Google, Hacking, Htaccess, Linux Unix BSD, Mod_Rewrite, SEO, Security, Web Design, Web Hosting, Web Tools, Webmaster, WordPress | 71 Comments »
Monday, August 4th, 2008
Enter your DOMAIN_ROOT and the location of your wp-config.php or config.php, and this script finds all the mysql settings by parsing the phpbb or wordpress config file, then creates GPG encrypted backups, and saves your settings for future automation.
Tags: Apache, askapache, Backups, bash, debugging, encryption, GET, GPG, grep, Linux, mysql, Nice, password, PHP, phpBB, Renice, Security, Shell, shell script, umask, WordPress, wp-config.php
Posted in DreamHost, Featured, Linux Unix BSD, Security, Server Administration, Shell Scripting, Web Hosting, Webmaster, WordPress, phpBB | 3 Comments »
Thursday, February 7th, 2008
WordPress plugin gives you control over HTTP Basic Authentication for your WordPress blog which among other things, stops most automated hacking attempts and exploits being attempted, cutting down on the number of requests, connections, and mysql queries for all WordPress blogs on the Internet.
Tags: Apache, askapache, AskApache Password Protection, encryption, Hacking, Htaccess, Htpasswd, httpd, HTTPS SSL, Logs, mysql, password, password protection, PHP, Port, Prompt, Security, server, servers, WordPress, WordPress Security
Posted in WordPress Plugins | 14 Comments »
Monday, February 4th, 2008
How I was able to preload many flash flv and swf files on one of my clients sites that has a lot of online video and relatively small traffic. Their site visitors would usually watch 3-10 videos per visit and so to make the videos load almost instantly on every page I came up with a way to preload the top 10 .flv files and the swf flv player files as soon as the visitor successfully started watching the 1st video. Of course I also setup .htaccess caching on the server so that once they downloaded the files into their cache they would never request them from the server again. I was having fun with this so its pretty funky and uses some really cool combinations of javascript, swf preloader from xml, css classes to help automate it all..
Tags: 404 Not Found, Ajax, Apache, askapache, Backups, Bandwidth, Boot, Cache, Cache-Control, caching, console, Cookies, CSS, FilesMatch, Flash, Flash Actionscript, Google, Htaccess, HTTP Headers, Javascript, Logs, Mod_Rewrite, mysql, PDF, PHP, preload, ram, Rewrite Tricks, server, Shell, SPEED, SSI, stat, tutorial, Web Development, Wireshark
Posted in Cache, Flash, Htaccess, Web Design | 4 Comments »
Wednesday, January 30th, 2008
A plugin built to generate static files from php+mysql for Apache to serve the way its supposed to be.. My dream. Conclusion: Needs some improvement, pretty sweet though.
Tags: Apache, askapache, AskApache Crazy Cache, Cache, caching, Cookies, debugging, Dig, Examples, Forms, Hacking, Htaccess, HTTPS SSL, Mod_Rewrite, mysql, PHP, post, Redirect, Rewrite Tricks, rewritecond, rewriterule, SetEnvIf, SPEED, stat, trick, WordPress
Posted in Cache, Htaccess, PHP, WordPress | 11 Comments »
Monday, November 26th, 2007
Thought I’d give you all the tips and tricks that I’ve learned and use when developing WordPress plugins.. which can be quite fun!
Tags: 301 Redirect, 404 Not Found, admin, Advanced, Ajax, Analytics, Apache, askapache, Cache, CSS, Dig, Elite, GET, Google, Google Analytics, Javascript, Logs, mysql, PHP, Port, ram, search and replace, SEO, Source Code, SSI, stat, trick, WordPress, WordPress Plugins
Posted in WordPress, WordPress Plugins | 5 Comments »
Friday, November 23rd, 2007
Apache .htaccess Directives and Loaded Modules allowed on DreamHost Apache Server 2 Setups.
Tags: admin, Apache, askapache, authorization, Bandwidth, Cache, Cache-Control, Dig, DNS, DreamHost, Email, error log, errordocument, Etags, FilesMatch, filesystem, HowTo, Htaccess, HTTP Error, HTTP Headers, httpd, httpd.conf, HTTPS SSL, Linux, Logs, mod_include, Mod_Rewrite, Mod_Security, Mod_Setenvif, mysql, Performance, Port, ram, Redirect, Redirection, Request Method, Rewrite Tricks, Scripts, Security, server, server config, Server Side Includes, servers, SetEnvIf, Shell, Socket, SPEED, SSI, stat, Web Hosting
Posted in Apache, Apache Modules, DreamHost, Htaccess | No Comments »
Sunday, November 11th, 2007
NOTE: This is a very old post, I do NOT recommend DreamHost for anyone other than spammers. They are not a long-term solution.
Tags: Apache, Backups, DreamHost, GET, hellish experiences, Htaccess, Linux, long term solution, mysql, Perl, PHP, spammers, SSH, SSI, stat, support staff, Web Hosting
Posted in DreamHost, Making Money, Review, Web Hosting | 2 Comments »
Tuesday, September 18th, 2007
Often I am programming a plugin, or modifying my .htaccess rules, or editing a WordPress template file and I get stuck when it comes to how WordPress rewrites url’s internally. This simple plugin displays all the internal WordPress rewrites.
Tags: 500, Apache, askapache, Backups, GET, Htaccess, mysql, PHP, ram, Rewrite Tricks, rewriterule, WordPress
Posted in Apache, DreamHost, Htaccess, Linux Unix BSD, PHP, SEO, Security, WordPress, WordPress Plugins | 16 Comments »
Monday, February 5th, 2007
Describes in exhaustive detail how to change configuration settings and implement a custom php.ini file for use with the Apache Web Server. View latest official php.ini Sections: When php run as Apache Module (mod_php) When php run as CGI When cgi?d php is run with wrapper (for FastCGI) .htaccess code from Ultimate htaccess file RUN PHP AS APACHE MODULE AddHandler application/x-httpd-php .php .htm RUN PHP AS CGI AddHandler php-cgi .php .htm CGI PHP WRAPPER FOR CUSTOM PHP.INI AddHandler phpini-cgi .php .htm Action phpini-cgi /cgi-bin/php5-custom-ini.cgi FAST-CGI SETUP WITH PHP-CGI WRAPPER FOR CUSTOM PHP.INI AddHandler fastcgi-script .fcgi AddHandler php-cgi .php .htm Action…
Tags: admin, Apache, askapache, ASP, Cache, caching, chmod, CommandLine, compression, Cookies, curl, debugging, Dig, DreamHost, Email, error log, Examples, File Permissions, filesystem, GET, Htaccess, htaccess files, HTTP Headers, httpd, httpd.conf, HTTPS SSL, Javascript, Linux, Logs, Mod_Rewrite, mysql, Nice, nsa, password, Performance, PHP, php.ini, phpinfo, Port, post, Powweb, Prompt, ram, Redirect, Redirection, Rewrite Tricks, rewritecond, rewriterule, Scripts, Security, server, server config, servers, Sessions, SetEnvIf, Shell, shell script, Shell Scripting, Socket, SPEED, SSI, stat, trick, ultimate htaccess, umask, Username, Web Hosting, xargs
Posted in Apache, Htaccess, Linux Unix BSD, Mod_Rewrite, PHP, Security, Server Administration, Web Hosting, WiredTree | 13 Comments »
Thursday, January 25th, 2007
Apache server performance can be improved by adding additional hardware resources such as RAM, faster CPU, etc.
Tags: admin, Apache, Bandwidth, bash, Bottleneck, Cache, Cache-Control, caching, compression, DNS, feed, File System, GET, Htaccess, HTTP Headers, httpd, httpd.conf, Linux, Mod_Rewrite, mysql, Performance, Perl, PHP, Port, post, ram, Rewrite Tricks, rewritecond, rewriterule, Scripts, server, servers, SPEED, SSI, stat, SymLinks, trick
Posted in Apache, Htaccess | 2 Comments »
Monday, January 22nd, 2007
can you please suggest me any tiny and good port redirector
for linux and unix like oses ?
so that when I connect to the box to a given port it redirects my connection
to another box and port that I can chose ?
thanx a lot
Tags: Hacking, Linux, mysql, Port, ram, Redirect, server, servers, Socket, SOCKS, SSH, SSI
Posted in Linux Unix BSD, Security | 1 Comment »