Manage Your Own Server

PHP: Getting Last Changed Time of a File – File ctime

File ctime may be a little misleading in nature as many would think it as the creation time of the file, but actually it’s the meta data such as the ownership or permissions change time of the file in addition to content modification. To get the ctime of a file in PHP: $last = filectime(‘anyfile’); …

PHP: Getting Last Changed Time of a File – File ctime Read More »

Set Expiration or Expiring Time by mod_expires.c on Apache via .htaccess to Reduce Web Page Loading Time

When your site’s ready in design and majority of common media resources won’t change for quite some time, say, half a year, for example, the images and flashes. It makes sense to set the expiration of them much longer than the default to prevent the client browsers downloading them every time a visitor drops by, …

Set Expiration or Expiring Time by mod_expires.c on Apache via .htaccess to Reduce Web Page Loading Time Read More »

How to know if your hosting provider is overselling on your server?

To check whether you are one of the victims that are dwelling on oversold web hosting servers, you need to have SSH access to your server. Now perform the following commands: cat /proc/cpuinfo | grep processor | wc -l Which will usually return the number of the CPUs of the current server: 2 Then, display …

How to know if your hosting provider is overselling on your server? Read More »

Dismiss unusable proxy server lists – Build your own stable socks5 proxy server and surf anonymously in minutes!

All web hosting servers with SSH access enable you to tunnel the sessions so that your local computer can act like a socks proxy. For web hosting users, browsing anonymously has never been so easy. There’s a detailed step by step tutorial for turning your web host into a socks5 proxy server. Basically, you use …

Dismiss unusable proxy server lists – Build your own stable socks5 proxy server and surf anonymously in minutes! Read More »

Log Walking – Walk through your website logs and be in the shoe of a visitor

Well, just came across a rather insightful post by ronburk at Webmaster World, which by the way, is probably the most resourceful place for any veteran webmaster. Consumer behavioral analysis is one of the most important part of any marketing campaigns in any industry. The better you get to know your customers, the better you …

Log Walking – Walk through your website logs and be in the shoe of a visitor Read More »

.htaccess: Deny From All – Prohibit, Forbid or Restrict Directory Access

Restricting directory access might be one of the most frequently used .htaccess techniques out there. As a site grows, there always are some areas that you don’t want visitors to look at such as merchandise warehouse where you store digital products for sale. You want a programmed server-side script to serve the download after confirming …

.htaccess: Deny From All – Prohibit, Forbid or Restrict Directory Access Read More »

.htaccess: Directory Listing — Enable Web Directory Browsing & Indexing

One of the best things I love Apache web server is that it instantly enables you to share files and resources via plain web directory index listing without having to spend time making any fancy web pages to serve them. However, there are times when you need to hide things out. To disable web directory …

.htaccess: Directory Listing — Enable Web Directory Browsing & Indexing Read More »

How to build a php query string without question mark

As a result of the spreading SEO awareness and how Google works, it is always recommended to use as less dynamic URLs as possible for your site. If one must, try using as less variables in the dynamic URL as possible. A dynamic URL is one with a question mark that passes dynamic variables to …

How to build a php query string without question mark Read More »

Backup and recover a MySQL database under command line

Yes you can log into phpmyadmin, backup your database by simply using Export and recover it by using Import. However all lamp servers come with a max upload file size, limited by the smaller of upload_max_filesize and post_max_size while also restricted by php.ini configurations such as memory_limit and max_input_time. What if you’ve got a huge …

Backup and recover a MySQL database under command line Read More »

How to count files (get the number of files) under a directory in Linux?

Just perform this command under the directory: find . -type f | wc -l and you will get the total number of files under it (recursively). Simply copy and paste that to do the trick. Or if you just need to count the files directly under the current directory: ls -f | wc -l Which …

How to count files (get the number of files) under a directory in Linux? Read More »

Cron jobs (Crontab jobs) tricks and tips on DreamHost

Crontab is a utility tool on Unix-like OS that enables you to make a program daemon scheduled to run at a specified interval. For example, to fetch news feed and import them into your own database every hour on the hour or to send pre-written newsletters at a given time everyday. With DreamHost you can …

Cron jobs (Crontab jobs) tricks and tips on DreamHost Read More »

Colorful Linux Bash Console by .alias and .bash_profile

At Dreamhost, we are all granted unlimited number of accounts for SSH access to the servers. The default console setting is a monochromatic one just like that in the old DOS style that it sores the eyes to look through the lines for something. Read their wiki the other day and found it’s possible to …

Colorful Linux Bash Console by .alias and .bash_profile Read More »

Essential SSH – 19 Linux SSH Commands You Simply Cannot Live Without

More and more web hosting providers are offering SSH(Secure Shell) access to their customers now, if you are one of them, put this advantage to good use will make your online life a lot easier. Don’t worry, we are just going to deal with just a few more than 15 shell commands, pretty much those …

Essential SSH – 19 Linux SSH Commands You Simply Cannot Live Without Read More »

12 Most Used .htaccess Examples, Tips – Commands & Directives

Updated: added a 301 redirect directive. Whatever you wanto call this, a cheat sheet, a real thin manual, or anything, we simplify the use of .htaccess as much as possible and make it do more for you with less hassle. Unify kavoir.com and www.kavoir.com! # Use a 301 redirect from kavoir.com to www.kavoir.com to tell …

12 Most Used .htaccess Examples, Tips – Commands & Directives Read More »

Scroll to Top