Hi. I want use my owncloud outside my home. Probably I must add virtual host with my exampledomain.com but I don’t know where and how to do this. Maybe someone can help me.
It’s not necessary, it should work out of the box. Can you explain what the goal is?
I suggest you narrowing a little bit the problem
This is not a NS topic unless you intend to install your owncloud instance on a NS…
But you have to give some more info.
what do you mean with ‘outside your home’?
Is that on a server in a datacenter (VPS or dedicated server?)
Is that owncloud on your homeserver but you want to have that available from outside?
Ok. Few days ago I installed centos 6.7 + lamp + newest owncloud + webmin.
In webmin i add virtualhost with my example.domain.com and directory ownclou and it works. but I have some problems with files access and ownCloud was not working properly. So I decide to use nethserver. Owncloud works perfect in my local Network. Https://192.168.1.222/owncloud and now i want use oncloud outside my local network. I tried to install webmin and add virtualhost there but it doesn’t work on nethserver. I run nethserver as a vm on my pc. And yes, owncloud is my homeserver and i want to have availability to use it outside.
Clear. Then still this isn’t NS specific, but more a routing and DNS question.
Now I have to assume you have a dynamic IP address from your internet provider and not a static IP address.
- Use a Dynamic DNS service to create a domain that points to the (current) IP address of your home connection.
- Create a link in the dyndns admin page that points to your owncloud instance for instance: https://yourname.dyndnsprovider.tld/owncloud
- add yourname.dyndnsprovider.tld to the virtualhost of Apache
- Open port 80/443 (whatever you use for owncloud) on your router
- Forward port 80/443 to your NS
Now you can access owncloud from outside using https://yourname.dyndnsprovider.tld/owncloud
NS does have dd-client module so setting this up shouldn’t be too hard. If you have a decent modem/router chances are that the modem/router has also the ability to be used to update your IP address with the dyndns service.
Everything is configured correctly. Even I bought my own domain. But I want to use https://my.domain.com not https://my.domain.com/owncloud to Connect to my owncloud and something I must add or change in nethserver, probably add add a virtualhost.
“add yourname.dyndnsprovider.tld to the virtualhost of Apache” - how to add?
Dont worry about my ip addres, as i wrote in the first post,“Probably I must add virtual host” - but i dont know how.
When i run https://my.domain.com it open apache 2 test page.
Here is more detailed how DNS and dyndns works:
In order to match a domain with an IP address, the IP address must be static. In such a case, when you have registered a domain, you can point an A record of the domain to an IP address. Then, when you enter domain.tld in your browser, the Nameserver will reply: "you can find domain.tld at IP address xxx.xxx.xxx.xxx
If you host a website or webapplication on your server, you must tell Apache that the website or application can be found on the server and that Apache should server the content of the website or webapplication when a certain URL is asked. This is set in the VHOST config file.
But now we have a slightly different situation. You have a consumer internet connection and (at least over here in Belgium) consumer internet connections do NOT have a static IP address. They have a dynamic IP address. Sometimes this IP address changes. The problem with your domain is that you can only point it to a single IP address. Now the dyndns service is coming into action.
Dd-client is a small program that monitors if your external IP address has changed. There are several services that can use the information collected by dd-client to update a DNS entry. In order to be able to update A DNS entry, that dyndns provider must be able to change the DNS database. This can only be done if the dyndns provider has control over that database. So you have to create an account with that dyndns provider and select a (free) domainname.
Now the trick to use your own domain with the dyndns provider:
When you have registered a domainname, lets asume ‘angelboy.com’ you can create an A record to connect an IP address to that domain. But there are some more options. Instead of an A record, you can also create a CNAME record. This is some kind of alias for the domainname.
So in the DNS settings of your domainname, create a CNAME record for angelboy.com and point that to angelboy.dyndnsprovider.tld
Everytime you ask for angelboy.com, your DNS be forwarded to angelboy.dydndsprovider.tld
So a browser request for angelboy.com will end up with your router. Now your router needs to forward the request to your webserver on your local LAN. And your webserver needs to know that when angelboy.com is being requested, it shows your owncloud instance.
“If you host a website or webapplication on your server, you must tell Apache that the website or application can be found on the server and that Apache should server the content of the website or webapplication when a certain URL is asked. This is set in the VHOST config file.”
I need do this but I don’t know how.
I have configured DNS records to my server. And i have forwarded ports 80 and 443 to NS server. I don’t need dyndns because I have static IP. When i open https://angelboy.com/owncloud everythings works fine. But when i run http://angelboy.com it open apache 2 test page. How to change it that when i run https://angelboy.com will be opening owncloud page? And like i wrote in my first post “Probably I must add virtual host”. But how to add or change vhost in NS/apache?
I think the best thing is to point your to the Apache documentation: https://httpd.apache.org/docs/2.4/vhosts/examples.html
take a look to these links maybe could be useful
Yes. I tried to understand this but they dont wrote where this file i must change/create. And i think that NS have his own rule to this because it is not clear centos but configured system. That’s why I ask about this here.
Redirect works but at the end in web browser url still i have */owncloud