Category Archives: Apache2

Increase PHP Memory Limit in htaccess, apache or in a php script

Most of us have come across this error: “Fatal error: Allowed memory size of xxxxxx bytes exhausted (tried to allocate yyy bytes) in ….” in the php error logs. In php, running out of memory in usually a sign that your php script is not too well written or has a bug or two in [...]

Common Ports List – Most Commonly Used Port Numbers

List of Commonly Used Ports Below is a list of common ports and the service it is associated with I find are most commonly used. If you feel there are ports that should be on this list, please leave a comment or contact me. Updated 17 May 2012 to include ports recommended by DHost Port [...]

Set Apache Log Permission Using Logrotate

If you have ever wondered why your log files randomly change permissions each night. Logrotate could be up to its tricks. Similar to the other article I published on Why is apache randomly restarting which explains why logrotate could be causing apache to restart randomly. Each time logrotate runs its course, it will compress, rename and [...]

Why is Apache Restarting Randomly

Logrotate could be the cause of the issue. Each time logrotate runs, it will compress, rename and rotate your logs as well as removing older logs. Similar to the follow up of this article explaining how logrotate was changing apache log file permissions. Since the logs files are renamed, it will result in some of your [...]

PHP Script to Check Remote Server Port or Service is Running

As most webmasters will know, if your website is doing, clients are going to be knocking on your door with pitchforks and torches. Here is a script that allows you to monitor remote ports on a server to make sure that the required services are running such as Apache (port 80), FTP (port 21), SSH [...]

Override The Default PHP Execution Timeout Limit

In any programming language there is always a chance that your code will enter an infinite loop and get stuck for a long time. There is also a chance that a script may be processing large and complex data which causes it consume large amounts of server resources for a long time which affects other [...]

Secure Directory With Apache htpasswd and htaccess

Overview Need a folder secured on your website with a username and password? You may have some important documents you need to share with selected people. You could have restricted downloads you need to give to certain people. In any of these cases, you can secure a folder with one or multiple usernames and passwords. [...]

Running Linux logrotate.d Command Manually

Here Is My Problem One day while perusing around one of my Debian Linux servers I noticed that the disk was extremely full. After taking a look at what could be using up all the disk space, I realised that my log files were absolutely massive with some log files being close to 20 GB [...]