Install Grav on linux ubuntu 20.04

Good morning,

I am trying to install Grav, using without understanding >>

https://doc.ubuntu-fr.org/grav

but I’m still stuck.

Here are the details :

type or paste code here $ sudo certbot --apache --agree-tos --redirect --staple-ocsp --email you@example.com -d example.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
There seem to be problems with that address. Enter email address (used for
urgent renewal and security notices)

If you really want to skip this, you can run the client with
--register-unsafely-without-email but make sure you then backup your account key
from /etc/letsencrypt/accounts

 (Enter 'c' to cancel):
Invalid email address: .
Enter email address (used for urgent renewal and security notices)

If you really want to skip this, you can run the client with
--register-unsafely-without-email but make sure you then backup your account key
from /etc/letsencrypt/accounts

 (Enter 'c' to cancel): @@@@@@g...fr

Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Obtaining a new certificate
An unexpected error occurred:
The server will not issue certificates for the identifier :: Error creating new order :: Cannot issue for "example.com": The ACME server refuses to issue a certificate for this domain name, because it is forbidden by policy
Please see the logfiles in /var/log/letsencrypt for more details.

IMPORTANT NOTES:
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
kftx@jksx-IdeaPad-3-15IML05:~$ sudo apache2ctl -t
AH00112: Warning: DocumentRoot [/var/www/grav] does not exist
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
SyntaxOK
kftx@jksx-IdeaPad-3-15IML05:~$ sudo systemctl reload apache2
kftx@jksx-IdeaPad-3-15IML05:~$ ls /etc/apache2/sites-available/
000-default.conf default-ssl.conf grav.conf grav.conf.save grav.conf.save.1
kftx@jksx-IdeaPad-3-15IML05:~$ cat /etc/apache2/sites-available/site_name.conf
cat: /etc/apache2/sites-available/site_name.conf: No such file or folder
kftx@jksx-IdeaPad-3-15IML05:~$ sudo nano /etc/apache2/sites-available/grav.conf
kftx@jksx-IdeaPad-3-15IML05:~$
kftx@jksx-IdeaPad-3-15IML05:~$ sudo apache2ctl -t
AH00112: Warning: DocumentRoot [/var/www/grav] does not exist
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
SyntaxOK

Can you help me please?
THANKS.

@Thi, This forum is about Grav and so far, I haven’t seen any Grav issues…

If you want the community to help you, you should, at least:

  • Show what you have done yourself. Which steps have you taken to install Grav?
  • Describe where you got stuck while installing Grav (not while setting up linux, certificates, or Apache)

Please be aware, that when a question is not succinct, clear and to the point, readers will generally skip the question and move on to the next.

1 Like

Will hopefully give you a few things to check
As you have multiple errors of different things

Hopefully this will help you

sudo systemctl status apache2.service -l --no-pager

sudo nano /etc/apache2/apache2.conf

Include the virtual host configurations:

IncludeOptional sites-enabled/*.conf
ServerName 127.0.0.1

*Save and exit

`sudo nano /etc/httpd/conf/httpd.conf`

#Supplemental configuration
# Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf
ServerName 127.0.0.1
  • save and exit

Enable apache rewrite module for virtual hosts / multi domain

sudo a2enmod rewrite
sudo systemctl restart apache2.service

check for errors


it looks like you are setting up virtual directories rather than using the default working apache directory, which is generally used for a single host.

the error /var/www/grav does not exist … is exactly that or that no permissions to the folder have been given so we will create it

sudo md /var/www/grav

then check reference in the /etc/apache2/sites-available/grav.conf

We can ensure the permissions are correct

For single default apache web directory

sudo chown -R $USER:$USER /var/www/html
sudo chmod -R 755 /var/www/html

this will use the 000-default.conf and again it needs to point to /var/www/html/

then check your

`/etc/apache2/sites-available/grav.conf

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName yourdomainlocal
ServerAlias www.yourdomain.local
DocumentRoot /var/www/grav/

<Directory /var/www/grav/>
Options FollowSymLinks
AllowOveride All
Order allow,deny
allow form all
</ Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
` ** Save and exit

to then enable the site in apache

sudo a2enmod grav.conf

then you need to disables the 000-default.conf which disables the default apache host directory /var/www/html do this

sudo a2dissite 000-default.conf


the issue about the server name could not reliably determine the servers fully qualified domain to resolve

add this line to the following file

sudo nano /etc/apache2/apache2.conf
ServerName localhost

*save and exit

restart apache

sudo systemctl reload apache2

Installing Grav

to install to the default apache install document root directory /var/www/html

sudo cd /var/www/html
sudo git clone -b master https//github.com/getgrav/grav.git .
sudo bin/grav install

or to set up a virtual host folder

sudo cd /var/www/grav
sudo git clone -b master https//github.com/getgrav/grav.git .
sudo bin/grav install