• Resolved ismailfatih

    (@ismailfatih)


    Hi, i made web server for WordPress on raspberry pi (single board computer linux). In local network everything is ok. i bought static ip from my ISP and i forwarded 80 port of raspberry to global network. while trying to connect WordPress by global ip from external network (e.g. smartphone with 4G) pages are too slow(images not shown and theme is basic).

    screenshot

    To solve that i change wordpress site url&wordpress url from local ip to global ip. at this time i can connect from external network with global ip too fast, but i cannot connect it by desktop computer which is on local network(browser going to router(huawei HG658)main page when global ip was entered) so that i can’t use dashboard, write posts anything else. How can i solve this ?

    • This topic was modified 6 years, 10 months ago by ismailfatih.
    • This topic was modified 6 years, 10 months ago by ismailfatih.
    • This topic was modified 6 years, 10 months ago by ismailfatih.
    • This topic was modified 6 years, 10 months ago by ismailfatih.
Viewing 4 replies - 1 through 4 (of 4 total)
  • You might be able to get a piece of your LAN software to map/forward the global IP to the RaPi’s LAN server. Can the router/modem be configured to forward the global IP when it is use on the LAN side ?

    Now for a solution that will work:
    – Configure the DHCP server in your router/modem to permanently assign a local IP to the RaPi, say “192.168.1.31”
    – buy a domain name, say “myuniquename.com”
    – set the domain name to resolve to your global IP
    – configure the RaPi to use VirtualHost technique, details here:
    https://httpd.apache.org/docs/current/vhosts/name-based.html
    This will entail add VirtualHost directives in /etc/apache2/sites-enabled/001-local
    Something like:

    <VirtualHost *:80>
    DocumentRoot /var/www
    ServerName myuniquename.com
    ServerAlias www.myuniquename.com
    </VirtualHost>

    – do the “Moving WordPress” procedure and reconfigure the RaPi to use the domain name in site address and WordPress address.
    The website is now accessible from the world using the domain name, now for all the PCs on the LAN.
    – on each PC on the LAN that will access the RaPi site, add these line to the “hosts” file:

    192.168.1.31	myuniquename.com
    192.168.1.31	www.myuniquename.com

    On the RaPi this would be:

    127.0.0.1	myuniquename.com
    127.0.0.1	www.myuniquename.com

    Details on the hosts file for various flavors of Windows/Linux/Mac at:
    https://en.wikipedia.org/wiki/Hosts_(file)

    Thread Starter ismailfatih

    (@ismailfatih)

    it works perfect thank you so much

    Would you please describe what you did ? This way this support thread becomes more useful to the wider community.
    Also if you think it is appropriate would you mark this thread as closed.

    Thread Starter ismailfatih

    (@ismailfatih)

    i bought domain. i forwarded it to my static ip. than i added below settings in rpi

    <VirtualHost *:80>
    DocumentRoot /var/www
    ServerName myuniquename.com
    ServerAlias www.myuniquename.com
    </VirtualHost>

    i changed wordpress site&wordpress adress url to my domain. than i configured hosts file on my desktop.

    192.168.1.31	myuniquename.com
    192.168.1.31	www.myuniquename.com
    • This reply was modified 6 years, 10 months ago by ismailfatih.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘web server WAN/LAN connection problem’ is closed to new replies.