All posts by Paul

There are plenty of blog posts about 6 ways to change the upload size limit, i read them all. As usual there were little bits missing that someone like me needed to understand comletly what was needed.

So i thought i would add my own blog on my experience of increasing the upload size limit on my wordpress site

This wordpress site is part of multisite wordpress.

I have built it myself on a virtual machine from a hosting company. I rent a bare bones virtual linux machine with nothing on it

I then installed wordpress multisite with plugins and themes etc

So this might be differnt for you if you have purchased a prebuitl wordpress site

You will have less access to the underlying files

Because of the multisite install of wordpress ihave an extra setting for upload file size and file types

Changing this setting made no difference to the 2mb limit i was stuck with (until later)

Googling how to chnage the limit brought up a .htaccess method and a php.ini method

I teied the .htacess method but it stopped the media libary from loading fro some reason so i reverted the chnages back

Then i tried the php.ini method. The post i read however was not clear on where to find the php.ini file. It advised if i didnt have a php.ini file that you could create one

So off i went and created the php.ini file in the www folder of apache

This didnt work

So off to google i went

Then i found another post not related to wordpress about php and apache

How do i check what version of php i was using.

Well i remebered from installing word press that it created a file for you called info.php in your apache www folder

if you web browse to this file it will show you what version of php you are using and its location on the server


As you can see it shows me php7.4 and its installed location

That is where you find php.ini and where you alter the upload size

I added these two line of text to the php.ini file and hey presto the upload size increased

post_max_size = 100M
upload_max_filesize = 100M

Not to 100mb though!

That was where i needed to go back and alter the upload size in the mutlisite settings (picture above)

Hope this helps someone like me who struggled to fill in the blanks between all the online posts about upload size limits for wordpress

chown www-data:www-data -R * # Let Apache be owner
find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x

The above command will say you days

Finds all the directories and sets them as:

read,write,exec by user

read,exec by group and anon

find . -type f -exec chmod 644 {} \; # Change file permissions rw-r–r–

above command finds all the files and sets them to:

read,write by user

read only by group and anon


useradd example – Add a new user to primary group

To add a user tony to group developers use the following command:
# useradd -g developers tony
# id tony

Sample outputs:

uid=1123(tony) gid=1124(developers) groups=1124(developers)

Please note that small g (-g) option add user to initial login group (primary group). The group name must exist. A group number must refer to an already existing group.

Continue Reading



To Enable and disable services across runlevels in Debian, Ubuntu, and other Debian based Linux distributions we use a script called update-rc.d

How to enable a service

As an example, to enable Apache web server in Debian, do the following –

# update-rc.d apache2 defaults

… this will enable the Apache web server to start in the default run levels of 2,3,4 and 5. Of course, you can do it explicitly by giving the run levels instead of the defaults keyword as follows:

# update-rc.d apache2 start 20 2 3 4 5 . stop 80 0 1 6 .

The above command modifies the sym-links in the respective /etc/rcX.d directories to start or stop the service in the destined runlevels. Here X stands for a value of 0 to 6 depending on the runlevel. One thing to note here is the dot (.) which is used to terminate the set which is important. Also 20 and 80 are the sequence codes which decides in what order of precedence the scripts in the /etc/init.d/ directory should be started or stopped.

To enable the service only in runlevel 5, you do this instead –

# update-rc.d apache2  start 20 5 . stop 80 0 1 2 3 4 6 .


How to disable a service

To disable the service in all the run levels, you execute the command:

# update-rc.d -f apache2 remove

Here -f option which stands for force is mandatory.

Useful IPtables commands




iptables -A INPUT -s IP ADDRESS -j LOG –log-prefix “iptables:  ”

iptables -A INPUT -s IP ADDRESS -j DROP

iptables -i eth1 -A INPUT -s -j LOG –log-prefix “iptables:”

/sbin/iptables -I INPUT -s {IP-HERE} -j DROP
/sbin/iptables -I INPUT -s -j DROP

How Do I Delete Blocked IP Address?
iptables -L INPUT -n –line-numbers
iptables -D INPUT 3

Continue Reading