I have a newly installed FreeBSD OS and I need to install an Apache web-server on it. Need it to test some software. But I need not the last version but exactly apache-2.2.17_1. How can I do that? I'm new to FreeBSD and actaully have no idea where to start with.
My recommendation is that you install the version of Apache available in the ports collection (currently 2.2.22) - this includes a number of bug and security fixes over the version of Apache you mentioned.
If you absolutely require a specific (older) version of Apache you can download the source from httpd.apache.org and build it manually. Explaining the Apache build process is beyond the scope of a Q&A site, but the Apache documentation would be a good starting place to learn more.