No puedo acceder a wp-admin desde WAN haciendo NAT?
Drakaris:
Hola, al instalar LAMP en mi servidor RPi3, creé tres VirtualHosts en apache2:
Para trabajos de HTML/CSS (80) Proyecto personal (puerto 8080) Wordpress (puerto 8000)
configuré el router para que cuando vaya a mi dominio "losheredia.ddns.net:8000" se redirija al puerto 8000 del server:
Lista de Servidores Virtuales
Nombre WAN IP LAN LAN Protocolo Estado Opciones
....
wordpress 8000 192.168.0.2 8000 TCP Activado Modificar/Eliminar
/etc/apache2/sites-enabled/000-default.conf
Código:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /home/webserver
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
<VirtualHost *:8080>
ServerName GTE
ServerAdmin webmaster@localhost
#ServerAlias pruebas2.local
DocumentRoot /home/gte/
ErrorLog ${APACHE_LOG_DIR}/error_gte.log
CustomLog ${APACHE_LOG_DIR}/access_gte.log combined
</VirtualHost>
<VirtualHost *:8000>
ServerName wordpress
ServerAdmin webmaster@localhost
DocumentRoot /home/wordpress/
ErrorLog ${APACHE_LOG_DIR}/error_wordpress.log
CustomLog ${APACHE_LOG_DIR}/access_wordpress.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
/etc/apache2/sites-available/000-default.conf
Código:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /home/webserver
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
<VirtualHost *:8080>
ServerName GTE
ServerAdmin webmaster@localhost
#ServerAlias pruebas2.local
DocumentRoot /home/gte/
ErrorLog ${APACHE_LOG_DIR}/error_gte.log
CustomLog ${APACHE_LOG_DIR}/access_gte.log combined
</VirtualHost>
<VirtualHost *:8000>
ServerName wordpress
ServerAdmin webmaster@localhost
DocumentRoot /home/wordpress/
ErrorLog ${APACHE_LOG_DIR}/error_wordpress.log
CustomLog ${APACHE_LOG_DIR}/access_wordpress.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
y toda la configuración de wordpress esta bién (esta instalada en /home/wordpress/), en LAN va todo bien, pero al acceder desde el exterior (WAN) e inserto en el navegador "losheredia.ddns.net:8000" me accede a la página que estoy creando pero si accedo a "losheredia.ddns.net:8000/wp-admin" se queda cargando...
También pasa que me devuelve la ip local (http://192.168.0.2:8000) al hacer http://losheredia.ddns.net:8000
Temo que es alguna problematica de puertos. Mi pregunta es, ¿porque al acceder al losheredia.ddns.net:8000 puedo acceder pero al losheredia.ddns.net:8000/wp-admin no puedo?
MinusFour:
No es error de apache, es error de tu wordpress. Tu servidor me contesta correctamente con la instalación de wordpress pero tu HTML tiene rutas apuntando a tu ip privada. Por lo que significa que tu wordpress está mal configurado.
Drakaris:
Cita de: MinusFour en 6 Noviembre 2019, 00:32 am
No es error de apache, es error de tu wordpress. Tu servidor me contesta correctamente con la instalación de wordpress pero tu HTML tiene rutas apuntando a tu ip privada. Por lo que significa que tu wordpress está mal configurado.
Es tema de puertos o urls?
Además en el colegio me redirreccionaba a http://192.168.0.2:8000/wp-admin, que es aquello que provoca que me de la ip local y no la wan?
MinusFour:
Cita de: Drakaris en 6 Noviembre 2019, 00:37 am
Es tema de puertos o urls?
URLs. No hay ninguna URL cuando cargo tu wordpress que apunte a "losheredia.ddns.net:8000". Todas las URLs apuntan a tu IP privada.
Drakaris:
Cita de: MinusFour en 6 Noviembre 2019, 00:44 am
URLs. No hay ninguna URL cuando cargo tu wordpress que apunte a "losheredia.ddns.net:8000". Todas las URLs apuntan a tu IP privada.
Si y me fijé que me da una ip local
Es decir, cuando hago http://losheredia.ddns.net:8000/wp-admin me da http://192.168.0.2:8000/wp-admin haciendo así que no me vaya.
Pero en losheredia.ddns.net:8000 va bien.
Navegación
[#] Página Siguiente