# chown -R apache:apache /var/wwww/ is done, but the next command fails
ls -alsd /var/wwww/html/
ls: cannot access /var/wwww/html/: No such file or directory
But the directory really exists and root should be able to list it.
For my vhostes directory this works fine.
# ls -alsd /var/lib/nethserver/vhost/a2...47d/
0 drwxr-sr-x 2 ftp apache 6 Oct 5 17:29 /var/lib/nethserver/vhost/a2....7d/
As I want to assign my installations to different vhosts, the question occurs whether it is sufficient to replace the default path with the vhost path /var/lib/nethserver/vhost/##random_number##/ for the application of your manual.
Or must be aware of other specific conditions?
● It is the html directory: chown -R apache:apache /var/www/html
● Exactly
● I do not know why you have a random number for the name of the folder for the vhost.
/var/lib/nethserver/vhost/##random_number##/
It should be:
/var/lib/nethserver/vhost/devnet/
the Name(Nom) you gave to the vhost.
→ Use only standard alphabetic letters without spaces or special characters.
● Do you have an entry vhost-domain.name.tld in the hosts file of your workstation.
If so, then clear the cache of the workstation: ipconfig /flushdns
and also clear the one of the browser.
EDITION:
Change the owner:group of the /var/lib/nethserver/vhost/devnet directory for apache: apache, otherwise you will have difficulty updating WordPress.
Error 500 fixed:
.htaccess: RewriteRule “translated” to RewriteRegel
But now I have only white space within the browser: AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
So the webserver tries to deliver from the default directory, although I used my vhost directory for the configuration.
So I have to check all configuration files again, if there is an artifact somewhere in there.
● White page with WordPress means an error in configuration somewhere.
● Folder /var/www/html/ is for the standard NS web page (here it will be for the standard WordPress).
For the vhost, it should be: /var/lib/nethserver/vhost/devnet. (replace devnet by the name of the vhost)
● Do not translate the commands.
● Also, the icon indicates that the command is on one line. The PDF will put it on two lines with a [CR] [LF] between them. It will therefore be necessary to copy the entire command in an ASCII text editor and reduce it to a single line before copying / pasting it at the console.
● This will control the access to .htaccess
III-6. httpd.conf file
The /etc/httpd/conf/httpd.conf file contains all of the directives that control the httpd daemon. The one that has the most influence on the .htaccess files in the /var/www/html directory and its subdirectories is the AllowOverride directive on line 151 of the daemon configuration file.
By default, this directive is None and causes the httpd daemon to not process any .htaccess files it finds; he will ignore them all.
Later, in the .htaccess file in the WordPress root directory, we will add directives to change the Permalinks so that WordPress displays the name of the page instead of just displaying their number. With these directives, Wordpress will search for pages that have the Post Title suffix, but will not find them, because httpd will not use the .htaccess file. WordPress will think the permalink is set to Post Title while by default they are set to Simple. It will then display the message “Page not found”, because it cannot locate the page with the Post Title suffix.
EDITION:
Make sure the modification is under <Directory “/var/www/html”>
This will affect the access to /var/www/html/.htaccess.
● XIII-9 for the vhost
You can install a new WordPress in the directory /var/lib/nethserver/vhost/devnet(adjust devnet) by following the same procedures as those used previously, but using FQDN of the vhost and a new MariaDB database 10.2.
It is absolutely necessary to add the lines below at the end of the 2nd WordPress wp-config.php file.
“/var/lib/nethserver/vhost/a5…7d/”
and
<Directory “/var/www”>
● This is wrong, the first one is for the vhost and the second one is for the default NS web page (the default WordPress). Those are not related at all.
The creation of a vhost will create a conf file for it: (/etc/httpd/conf.d/virtualhosts.conf) that will be added to the standard httpd.conf and it will restart httpd.
In the created conf file for the vhost, NS will add the directive: AllowOverride All
and this directive will give access to the .htaccess file in the vhost directory. There is nothing to change in that new created file.
A lot to think about. I have not yet reached chapter XIII. While implementing the instructions in Chapter II/III I replaced the default directory with my vhost directory. Was that overhasty?
Thanks, Marko