running apache and snap(nextcloud)

April 21, 2019 787 views
Apache Ubuntu 16.04

configured a virtual host with apache for a ticket system that I’m trying, then installed next cloud with snap, tried to run both, but got an error, because of course both of them are using the same port. Aside from running next cloud directly on my VPS instead of using a snap, what can do?, because if I want to use next cloud must stop apache, and to use my ticket service must stop next cloud.

1 Answer


Indeed running two services on the same port at the same time is not possible.

What you could do is change Apache’s port to another non-default port like 8080 or example. That way the two services would be able to run at the same time.

To change Apache’s port open your Apache configuration file and edit the Listen 80 part to Listen 8080. Then run a config test:

apachectl -t

If you get a Syntax OK then restart Apache:

systemctl restart apache2

After that check if Apache is actually listening on the new port:

netstat -plant | grep -i apache2

Finally you should be able to run the nextcloud service on port 80.

Hope that this helps!

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!