It really depends on how you intend to offer the services. I do think that “cloud.whatev.er” could be simpler and clearer than “whatev.er/nextcloud/”, also because you are now bound to use “nextcloud” as the directory name and usually non-technical people don’t remember the name of the product; “cloud” is a much more simpler word to remember, to them.
Obviously, instead of customizing each web application path before installing it, probably a simpler way to implement some customization is to use vhosts, hence the request And probably applying the same logic to other web applications could be a winning point (Webtop is a simple application name, but it doesn’t work so well as, for example, “webmail”).
Your solution seems fine to me, but I don’t have the time to test it today. Will do some tests in the next few days and let you know. Sorry.
An easier way, the way I do it is create /etc/httpd/sites-enabled and /etc/httpd/sites-available in the httpd folder, that way you have full control over the vhost. I have nextcloud along with a few other servers running off of a freenas server and this will allow letsencrypt certs for any vhost I desire, pretty simply. Feel free to copy and paste this, replace the internal ip’s with the ip of the hosted server and the addresses with “whatever.site.com” or anything you wish.
From your preferred SSH cli tool:
sudo nano /etc/httpd/conf/httpd.conf (I LOVE nano)
IncludeOptional sites-enabled/*.conf (Place this in httpd.conf, it tells the system to use traditional apache location for vhosts)
Copy the vhost from below and copy into whateversite.com.conf in the sites-available folder (example: I used cloud.mysite.com for a nextcloud install)
This is all assuming you created some vhosts in the GUI of nethserver, so you create mysite.com under vhosts, nextcloud could be cloud.mysite.com. Anyways, under vhosts select require ssl, not required but if youre using letsencrypt certs why not.
Oops forgot the important bit “sudo apachectl restart” will restart apache and load the conf files you created. This can be replicated as many times as you want, throw a different ip, different subdomain and restart apache and youre all set.
Edit: Forgot restart apache
Edit2: Apache will error out if any conf file has bad code in it but copy and paste this and you should be good. This should be in the vhosts anyways but once youve done it once it will be super fast. Ive gof my freenas server this way, nextcloud, and a few other servers. It is handy because its all going through the cert you created in letsencrypt, so freenas doesnt need a cert neither does nextcloud its all going through the main server cert which is very nice.
have suggested /requested to be used the Virtual Host Module implemented in NethServer.
The solutions presented here, in this topic, and here: Nextcloud in new virtualhost - #2 by enzoturri
are functionally, very simple, but does not use at all the NethServer Virtual Host Module. The solutions use symlink.
Rhetorical question: why was this module (NS Virtual Host) created?
I need to use the NS VH Module because I want to set a dedicated server to host multiple websites: Nextcloud for my company, my company website based on Wordpress, other customers websites.
I need to use the NS VH Module because I want to set a dedicated server to host multiple websites: Nextcloud for my company, my company website based on Wordpress, other customers websites. There are some advantages using this module: easy to setup (the directories, the configuration file, server alias, FTP access, are automatically created), can be monitored by Web Statistics (the AWStats module by @stephdl ), are all in the same place/location (/var/lib/nethserver/vhost/****).
If the NS VH Module were to be used, it would mean that the entire content of the Nextcloud folder should be inside the VH folder created through GUI (Management → Virtual hosts), in this location: /var/lib/nethserver/vhost/nextcloud.
If we use the NS Nextcloud module (which should be the optimal solution), will be installed in this location: /usr/share/nextcloud.
So, some questions from me:
is there a functional procedure to move “nextcloud” from default installation path to “vhost” path and, of course, Nextcloud to be functional after that?
can be modified the installation process of the module so the default installation path to be chosen by the user?
can be modified the installation process of the module so the default installation path to be inside the real virtualhost (/var/lib/nethserver/vhost/nextcloud)?
common question for all three from above: will the module automatically updated?
Thank you all in advance for the patience to read this and for your future answers!
Actually, besides NextCloud you can easily use the NS Virtual Host to host any virtual hosts (Apache, not KVM or Containers). I do run several WordPress in NethServer that way.
However: LetsEncrypt wil also NOT work out of the box for this kind of setup.
However,the NextCloud is installed from modules and should be consistant during updates. This is a different kind of “beast”. WordPress don’t actually need the AD or LDAP for users. NextCloud surely does! Even if no one can log in, a word press site is still considered functional if it just shows the content. NextCloud will not show any content except the login page if there’s no authenticated user.
If you MUST have your nextcloud available behind a URL like this:
which seems to me to be your goal, then install 2 or more NextClouds at the appropriate locations.
AFAIK: The Integrated NextCloud in NethServer doesn’t support multiple domains, the user nor admin can’t change the e-mail addresses… The E-Mail of the User in NextCloud/NethServer is always the server’s domain name.
Thank you @Andy_Wismer for your quickly and detailed answer!
Actually, I want to provide Nextcloud services only for my company (suggested site: cloud.mycompany.tld), using NS Nextcloud module. It works like that with @giacomo solution. So, I don’t need Nextcloud as multisite/multiple domains.
For sites based WP is another discussion, but here:
Create the vHost folder (Or server-root, whatever needed)
wget the right version / language needed
create the DB and users with:
mysqladmin create wpdewebsitename
mysql --user=root mysql
GRANT ALL ON wpdewebsitename.* TO wpdewebsitenameuser@localhost IDENTIFIED BY ‘secret-password’;
unpack wp and set the right permissions: done!
One advantage of WordPress is it doesn’t need to be fully integrated in NethServer, I can quickly move it anywhere else simply by dumping the DB and Zipping the WP-folder.
NethServer is great for hosting like you plan to…
But you’re safe to move WP offsite if needed or requested - without disrupting your NethServer.
yum doesn’t really “need” to know about an installed WP-package. That only creates unnecessary dependencies…
BTW: I am a big believer in standardized naming conventions and principles, one of them being “speaking names”. Since 25 years, all Windows boxes i touched, you will find the CD/DVD drive on J:. Printers always use the IP 31 at the end (at least the primary, main printer). WordPress naming for DB includes two etters for WP, two letters for language (I do have several multilanguage sites, Switzerland may be small, but we use 4 languages officially!) and the Domain represented. The user involved is the same, but adding user at the end, see example above.
If I see “wpdewebsitenameuser” this in any script or log file, I know exactly it’s the database user we’re talking about, and not the database, domain or the web-folder.
I do have a lot of these naming conventions documented in PDF for at least 20 years now, if anyone’s interested…
I faced with NS WP issues when I wanted to move it in VH.
In that topic, there is a solution given by @mrmarkuz , but for me didn’t work.
I will try again, with a little help from him, I hope!
So, till now, I have installed WP in the same “old school” as you.
I’m very sorry I cannot follow through the discussion in a timely manner; tomorrow I will dedicate my spare time to provide answers and tests.
I do very much like the vhost approach; please be aware that probably some other settings may be implemented to improve/simplify user experience (e.g. removing ‘index.php’ from the URL, etc.). I’ve seen some tries, I will reproduce them tomorrow and provide feedback.
Hi, this setup is working with theNethServer release 7.5.1804 ? i get the error below when i visit my nextcloud through cloud.xxx.yyy. i try to delete 10base file and retype signal-event nethserver-nextcloud-update and i’m able to reach my nc but with wrong cert
This version of Nextcloud requires at least PHP 7.0
You are currently running 5.6.25. Please update your PHP version.
I removed the subdomain
Now on that subdomain i receive:
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
[07/May/2019:13:51:59 +0200] “GET / HTTP/1.1” 503 299
[07/May/2019:13:57:11 +0200] “GET /nextcloud HTTP/1.1” 503
I even reinstalled nextcloud…
Plus the certificate for subdomain isn’t configured. It uses the generated by the server.