I'm taking over a project from a coworker who recently left. I'll be working by myself on a website that runs on ASP.NET through mono on a xsp4 server. I'm new to linux and the ASP.NET framework so I'll try to explain things the best I can. To get things going I ssh into the server and change to the project's directory. From here I use git to pull any new changes. Next I use:

screen (or screen -r if one is already running) 

and run/restart the server by:

sudo xsp4 --port 80

I left last night with everything in working order and running, but when I visited the site this morning I got an error 403 access forbidden in the browser. I haven't changed permissions or edited files.

I decided to ssh in and screen -r to stop the server but it said there is no screen to be resumed. In a new screen I tried to run the server but get this error:

w@c:~/CRIME/CP-Web-l> sudo xsp4 --port 80
Listening on address:
Root directory: /home/webmaster/CRIME/CP-Web-l
Error: System.Net.Sockets.SocketException: Address already in use
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0 
  at Mono.WebServer.XSPWebSource.CreateSocket () [0x00000] in <filename unknown>:0 
  at Mono.WebServer.ApplicationServer.Start (Boolean bgThread) [0x00000] in <filename unknown>:0 
  at Mono.WebServer.ApplicationServer.Start (Boolean bgThread, System.Exception initialException) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) Mono.WebServer.ApplicationServer:Start (bool,System.Exception)
  at Mono.WebServer.XSP.Server.RealMain (System.String[] args, Boolean root, IApplicationHost ext_apphost, Boolean quiet) [0x00000] in <filename unknown>:0 

I don't quite understand how it could be in use if there wasn't a screen running. I'm also not sure how the screen disappeared overnight. Is it possible that there was a crash?

Through googling I found this post that had a similar problem, http://www.ubuntufaqs.com/questions/432605/xsp4-address-already-in-use-error-cant-run-mono-application, that gave 3 solutions. I don't think xsp is still running but I'm not 100% sure how to check. I thought that since the screen wasn't found that xsp wasn't running anymore. The directory isn't a root directory of another server. Would an error be thrown if xsp couldn't find the required assemblies in the mono path?

I reverted the project back to a previous version and the same errors still exist.

Are these two problems connected? If there is some information that I didn't provide that would be useful please let me know. Thanks!

Edit (May 12, 1:48PM):

From what I understand these are the things listening to port 80 but I'm not sure what they are:

w@c:~/CRIME/CP-Web-l> sudo lsof -i:80 -n -P
httpd2-pr 1324   root    4u  IPv4  10644      0t0  TCP *:80 (LISTEN)
httpd2-pr 1795 wwwrun    4u  IPv4  10644      0t0  TCP *:80 (LISTEN)
httpd2-pr 1796 wwwrun    4u  IPv4  10644      0t0  TCP *:80 (LISTEN)
httpd2-pr 1798 wwwrun    4u  IPv4  10644      0t0  TCP *:80 (LISTEN)
httpd2-pr 1799 wwwrun    4u  IPv4  10644      0t0  TCP *:80 (LISTEN)
httpd2-pr 1800 wwwrun    4u  IPv4  10644      0t0  TCP *:80 (LISTEN)
httpd2-pr 3314 wwwrun    4u  IPv4  10644      0t0  TCP *:80 (LISTEN)

So after a few days of no luck I decided to have the server admin reboot the virtual server. I waited another day before giving things another try and luckily it looks like things are working now. Best of luck to you if you have a similar problem as mine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy