You're code uses the HTTP protocol, which is a specification that is independent of the host OS; so, no, it doesn't matter that you're running linux on the server. If you're having problems, please be specific. The code I gave you is a sample that you should research further, like reading the method and property documentation in the .NET Framework SDK if you don't understand a particular line of code. You should also read - which I mentioned - which authentication protocols are supported. If your web server (presumably Apache) is uses an unsupported authentication mechanism, then you're have to implement the IAuthenticationModule interface and roll your own authentication module. With specifics regarding your problem, I really can't help you.
Microsoft MVP, Visual C# My Articles