No puedo acceder a otra URL que no sea el home

Puedo leer las respuestas en Inglés (sí o no): Sí

Mi dominio es: www.rgo.com.ve

Ejecuté este comando: Instalé un certificado Let's Encrypt

Produjo esta salida: me redirecciona a https://www.rgo.com.ve cuando escribo www.rgo.com.ve pero no puedo acceder a otra web diferente a la principal

Mi servidor web es (incluya la versión): Apache/2.4.41 (Ubuntu)

El sistema operativo en el que se ejecuta mi servidor web es (incluya la versión): Ubuntu 20.04

Mi proveedor de alojamiento web (si aplica) es: DigitalOcean

Puedo iniciar una sesión en una shell root en mi servidor (sí, no o no lo sé): No lo sé

Estoy usando un panel de control para administrar mi sitio (no o proporcione el nombre y la versión del panel de control): No

La versión de mi cliente es (por ejemplo, si usa certbot, muestre la salida de certbot --version o certbot-auto --version): certbot 0.40.0

Antes quiero comentar que no puedo hacer uso del dominio sin el www (rgo.com.ve), al intentar acceder no encuentra el sitio (Uf. Tenemos problemas para encontrar ese sitio.) solo puedo acceder a la web por medio de www.rgo.com.ve

Al entrar en www.rgo.com.ve me sale sale el logo de la empresa que coloqué en el home, pero si trato de acceder a cualquier sitio diferente por ejemplo: www.rgo.com.ve/contacto u otro, obtengo el siguiente error:

Not Found
The requested URL was not found on this server.

Apache/2.4.41 (Ubuntu) Server at www.rgo.com.ve Port 443

Instalé el certificado y configuré el archivo

sudo nano /etc/apache2/sites-available/rgo.com.ve.conf

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName rgo.com.ve
    ServerAlias www.rgo.com.ve
    DocumentRoot /var/www/rgo.com.ve/public
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.rgo.com.ve
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

cambié <VirtualHost *:80> por <VirtualHost *:443> y tampoco funcionó

Your DNS for that name does not include the same A record as your www domain name. You need to add one.

nslookup rgo.com.ve
*** Can't find rgo.com.ve: No answer

nslookup www.rgo.com.ve
A Address: 143.198.112.227

Yeah, do not set the port to 443 for that VirtualHost. Port 443 is only for HTTPS VirtualHosts that include SSL settings. You should have two VirtualHosts one for port 80 and one for port 443.

3 Likes

Where exactly is that "contacto" folder [in the disk]?
Try: "find / -name contacto"

If it is NOT at:
/var/www/rgo.com.ve/public/contacto
Then you have your problem - that root is not pointing to where the files are.

The HTTP config shows:

What does the HTTPS config show?

www.rgo.com.ve/contacto is in the route /var/www/rgo.com.ve/resources/views/contacto without installing the certificate I can use the entire website without problem

I should talk to the domain administrator to see if he can point rgo.com.ve to the IP, since it is pointing to another IP that they use for the email server

Please show both vhost config files.
I can't see how that file/folder can be accessed from that location.

1 Like

Then email server should have it's own name [and IP].
[like: smtp.rgo.ve]

2 Likes

In nano /etc/apache2/sites-enabled/000-default.conf I have

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/rgo.com.ve/public

        <Directory /var/www/rgo.com.ve/public/>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted

            RewriteEngine On
            RewriteBase /var/www/rgo.com.ve/public
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        <IfModule mod_dir.c>
            DirectoryIndex index.php index.pl index.cgi index.html index.xhtml >
        </IfModule>

</VirtualHost>

Without SSL it worked fine

Something doesn't add up right.
That can't be the vhost that serves that location.

Please show:
sudo apachectl -t -D DUMP_VHOSTS

2 Likes
[Fri Dec 22 17:23:03.171404 2023] [alias:warn] [pid 20603] AH00671: The Alias directive in /etc/phpmyadmin/apache.conf at line 3 will probably never match because it overlaps an earlier Alias.
VirtualHost configuration:
*:443 rgo.com.ve (/etc/apache2/sites-enabled/rgo.com.ve-le-ssl.conf:2)
*:80  rgo.com.ve (/etc/apache2/sites-enabled/rgo.com.ve.conf:1)

Why then do you show us?:

You probably placed a file in the sites-enabled folder that isn't actually [in use] enabled.
Please show us:

  • ls -l /etc/apache2/sites-enabled/
  • grep -i include /etc/apache2/apache2.conf

Also, this file needs review:

2 Likes

root@rgo:~# ls -l /etc/apache2/sites-enabled/

total 0
lrwxrwxrwx 1 root root 51 Dec 22 06:47 rgo.com.ve-le-ssl.conf -> /etc/apache2/sites-available/rgo.com.ve-le-ssl.conf
lrwxrwxrwx 1 root root 34 Dec 22 06:45 rgo.com.ve.conf -> ../sites-available/rgo.com.ve.conf

root@rgo:~# grep -i include /etc/apache2/apache2.conf

# * ports.conf is always included from the main configuration file. It is
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
# Include of directories ignores editors' and dpkg's backup files,
# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf
Include /etc/phpmyadmin/apache.conf
Alias /phpmyadmin /usr/share/phpmyadmin

    <Directory /usr/share/phpmyadmin>
    Options SymLinksIfOwnerMatch
    DirectoryIndex index.php

    # limit libapache2-mod-php to files and directories necessary by pma
    <IfModule mod_php7.c>
        php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
        php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/v>
    </IfModule>

    </Directory>

    # Disallow web access to directories that don't need it
    <Directory /usr/share/phpmyadmin/templates>
        Require all denied
    </Directory>

Where is that file? ^^
I don't see it in the output below:

2 Likes

This looks normal:

This is "extra":

We may need to look in there too ...

2 Likes

I suppose that was aliased somewhere else already.
What shows?:
grep -Ri alias /etc/apache2 | grep phpmyadmin
grep -i alias /etc/phpmyadmin/apache.conf

2 Likes

root@rgo:/var/www/rgo.com.ve# grep -Ri alias /etc/apache2 | grep phpmyadmin
/etc/apache2/conf-available/phpmyadmin.conf:Alias /phpmyadmin /usr/share/phpmyadmin
/etc/apache2/conf-enabled/phpmyadmin.conf:Alias /phpmyadmin /usr/share/phpmyadmin

root@rgo:/var/www/rgo.com.ve# grep -i alias /etc/phpmyadmin/apache.conf
Alias /phpmyadmin /usr/share/phpmyadmin
root@rgo:/var/www/rgo.com.ve#

Include /etc/phpmyadmin/apache.conf
 Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
Options SymLinksIfOwnerMatch
DirectoryIndex index.php

# limit libapache2-mod-php to files and directories necessary by pma
<IfModule mod_php7.c>
    php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
    php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/v>
</IfModule>

</Directory>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/templates>
    Require all denied
</Directory>