Serve webpages on a vps running nextcloud server

57 views Asked by At

I have a Nextcloud Hub 6 (27.1.1) instance running on a vps with Ubuntu 20.04 LTS. Nextcloud works great. I have a domain name that I have set to be pointed to Nextcloud for web access. I would like to use another domain name that I can use to access web pages on my vps. I direct the domain to the IP address, and when I point a webbrowser to the domain name, I get a nextcloud-styled page that says "Access through untrusted domain". This tells me that a webserver is running, great. If I type in a terminal on my local machine:

telnet myip 80

I get:

Trying myip...
Connected to myip.
Escape character is '^]'.

And if I then type:

get foo

I get:

HTTP/1.1 400 Bad Request
Date: Wed, 25 Oct 2023 01:26:29 GMT
Server: Apache
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>
Connection closed by foreign host.

So its an apache server. Great. If I ssh into the vps and run htop, two of the task commands are:

/bin/sh /snap/nextcloud/37720/bin/run-httpd -k start -DFORGROUND
/bin/sh /snap/nextcloud/37720/bin/httpd-wrapper -k start -DFORGROUND

So nextcloud is running its own webserver which makes sense. That is as far as I have gotten. My question is: how do I serve web pages from my vps? Can/should I use nextcloud's webserver? If so, how do I configure it? If not, what should I do?

0

There are 0 answers