Go to the salckware website and find the sources for Apache there. Download the SlackBuild script which accompanies the sources. Use the script to compile apache. You may need to alter the script slightly to use it with a current version of apache, though the best way to make sure you are getting a version and build which work with skacjkware would be to get the sources used by slackware -probably for the last stable version of slackware (12.0) or for 11.0 here:
ftp://ftp.slackware.at/slackware-11.0/source/n/apache/
Download everything in the directory to a directory where you have read-write permission and then just execute the SlackBuild script like this:
sh ./apache.SlackBuild
Of course you said you neede to make a change to the sources. The easiest way to do that is to manually unpack the sources and then edit the files needed and make a diff of the changes. Then add your diff file to list of diffs applied in the SlackBuild script. I usually use the gendiff program for creating patches as it is very easy to use. It's part of the rpm package. To create a diff with it just do as above, that is unpack the sources. Find which file(s) you need to change and create copies of them with a suffix like '.00'. Then, when finished cd into the toplevel of the sources and create the patch like this:
gendiff . .00 > ../mychanges.diff