Deploying an aspnetcore 6 web app to Ubuntu 20.04. Here is an article of what I am doing

Apache is now set up to forward requests made to to the ASP.NET Core app running at . It worked before but now its giving me this error.

 dotnet helloapp.dll Unhandled exception. System.IO.IOException: Failed to bind to address address already in use. ---> Microsoft.AspNetCore.Connections.AddressInUseException: Address already in use ---> System.Net.Sockets.SocketException (98): Address already in use My service file looks something like [Unit] Description=Example .NET Web API App running on Ubuntu [Service] WorkingDirectory=/var/www/helloapp ExecStart=/usr/local/bin/dotnet /var/www/helloapp/helloapp.dll Restart=always # Restart service after 10 seconds if the dotnet service crashes: RestartSec=10 KillSignal=SIGINT SyslogIdentifier=dotnet-example User=apache Environment=ASPNETCORE_ENVIRONMENT=Production [Install] WantedBy=multi-user.target 

and config like

<VirtualHost *:80> ProxyPreserveHost On ProxyPass / ProxyPassReverse / ServerName ServerAlias *.example.com ErrorLog ${APACHE_LOG_DIR}helloapp-error.log CustomLog ${APACHE_LOG_DIR}helloapp-access.log common </VirtualHost> 
9

1 Answer

i solved the AddressInUseException (:5001 in my case) doing the steps listed here.

Let me know if the issue persists after that.

5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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