If you want to serve other content outside of WeBWorK on the same server, you will almost certainly need to set the $webwork_url to something other than the root directory (i.e. ""), with the default being "/webwork2". If this variable is set as the root directory then WeBWorK will assume that any subdirectory on the web server is a WeBWorK course, and it will intercept all page requests before they get to the /var/www/html directory.
I suspect that this would also solve the javascript issue in your other post. Setting WeBWorK as the root URL on your server is not particularly well tested, and I suspect may need a lot of attention to get working. Perhaps others who have made this work can chime in with their experiences.
The easy way to avoid having users have to type /webwork2 at the end of the URL is to set up an automatic redirect on the root page. Of course if you are using your server for multiple purposes you may want to have the root page be a static landing page with links to WeBWorK and any other content.