Today I dared to transfer my old website from Zentyal to Nethserver. It was based on Drupal. I tried some time before, but due to lack of time, I gave up. Today my trails were harder … but also not successful.
I set up a vhost called www.mydomain.tld.
I downloaded and moved Drupal to /var/lib/nethserver/vhost/www
I set up user/group to apache:apache and rights were 755, recursively, of course
I called my website but all I got was
503 - Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
OK, back to the roots, I removed the content from www and called the website - fine. I got the “standard default data”
I added a tiny little “Hello-World” script to index.php in /var/lib/nethserver/vhost/www/
… but all I got was
503 - Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
I moved index.php to index.html and changed the “Hello World-PHP code” to some simple text.
This time it worked. Other Sites applying php code (such as phpmyadmin, phpmyldap, SoGo, Nextcloud…) work with charm.
Of course I tried 503 Service Unavailable Error but no success
By change: Can somebody help me out to get php code working on www?
Got it stupid me - it was an old vhost which I simply made empty. I removed and re-created the vhost … now it seems to work (besides the fact that the vhosts folder name is now something cryptic instead a speaking name suche as www)
You should never name a vhost as www since it is already in use if you defined the FQDN of your domain under System → DNS → Add DNS record and you enabled Wildcard DNS record.
If you go to www.FQDN you should get the content of /var/www/html/, the defautl site for NethServer.
I you go to www.FQDN/vhost-directory-name/ then you should get the content of /var/lib/nethserver/vhost/vhost-directory-name/, the content of your vhost i.e. your Drupal.
To which owner:group should it be set? I do not know why, but I already got apache:apache for matomo (former Piwik). If I changed it, I am quite sure I followed the installation instruction.
The regular default seems to be ftp:apache. This is reagardless if FTP access is not enabled or not. So I will return to this.
No, definitely not. It was as you describe for Nethserver, but now, if I create a vhost (e.g. foo), I get a complete cryptic directory name under /var/lib/nethserver/vhost/. The vhost-directory-name is a 15 digit hex code equal to the ftp user name if enabled. I understand this in order to separate “NS-Domain users FTP access” from “vhost FTP users”, but I am not sure what the background is.
You are right about FTP, enabled or not, a new vhost directory OWNER:GROUP is ftp:apache.
If you leave it that way, the update for WordPress won’t work. That is why I always change to apache:apache. WordPress doesn’t use the NethServer FTP but its own way to get the updating files.
For Drupal, I do not know as I don’t use it, but I think it will be the same.
That is not normal. For the directory, you should get the same name as the one used when creating the vhost.
# ls -als /var/lib/nethserver/vhost/
total 0
0 drwxr-xr-x 3 root root 18 27 août 10:14 .
0 drwxr-xr-x. 12 root root 150 24 juin 13:51 ..
0 drwxr-sr-x 2 ftp apache 6 27 août 10:14 toto
#
# chown -R apache:apache /var/lib/nethserver/vhost/toto
#
# ls -als /var/lib/nethserver/vhost/
total 0
0 drwxr-xr-x 3 root root 18 27 août 10:14 .
0 drwxr-xr-x. 12 root root 150 24 juin 13:51 ..
0 drwxr-sr-x 2 apache apache 6 27 août 10:14 toto
#
I might be wrong but I think that NethServer is creating this name because you use www for another vhost.
By the way, the hexcode for FTP is 14:
For a test after changing the name of the vhost using www, try to create a new vhost that its name is never been used before:
Create a /temp directory
cp -a /var/lib/nethserver/vhost/www /temp
(-a, --archive / same as -dR --preserve=all)
delete the www vhost.
create a new vhost that its name has never been used before and verify the name of the new vhost directory.
if all went right with the previous procedure, create a new vhost for your Drupal (ex: drupal, and verify that NethServer used drupal as the directory name)
cp -a /temp/www/* /var/lib/nethserver/vhost/drupal/
change -R (Recursive)owner:group to apache:apache (to be able to update Drupal)
You should be able to access your Drupal site with: https://FQDN/drupal.
If Drupal site doesn’t display, adjust the config file of Drupal to use the new FQDN/site (It is like moving Drupal to a new site).
Another way will be to copy your Drupal site to: /var/www/html/ and it will be the new default site for NethServer.