Apache and the website on the home server are not working

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Maxximus999
Level 1
Level 1
Posts: 1
Joined: Tue Feb 07, 2023 2:16 pm

Apache and the website on the home server are not working

Post by Maxximus999 »

I have a problem with the site on my home server. Runs on LinuxMint Vera, Apache 2.4, MariaDB 10.6, PHP 8.1, Wordpress 6.1.1 Bind9 9.18, DDClient 3.91 and domains at namecheap.com.
Accessing the website from outside, from the Internet, does not work for me. I have a dynamic public IP and I solved it through ddclient. It updates the public IP just fine. If I enter my current IP in the search engine and I don't have the port directed to the server on the router, it shows me the router interface, if I point to the server IP, it loads the page on the server, but only as if in basic mode, as if I didn't have PHP on the server. The site runs on Wordpress.
Can it be in the router? The TP-link entry router is like a gateway with DHCP for both LAN and Wifi. The server has a reserved IP on this router and a static IP is set on the server. The second router, because I had few LAN ports, so I used it as an extender, a static IP is also reserved on Tp-link, wifi is turned off and DHCP is also turned off on it. Thus, TP-link assigns an IP to all devices. Can this extender somehow block ports or access to the server?
In the LAN network, it does not display the page under the domain name in full, but it does under the LAN IP. I can't deal with it.

localhost working
Any IP in the server's range displays the website
weblandic.com only shows as in the picture

I am attaching some configurations and outputs:

```

Code: Select all

I turned off Bind:
named.service - BIND Domain Name Server
Loaded: loaded (/lib/systemd/system/named.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2023-02-07 08:42:34 CET; 32s ago
Docs: man:named(8)
Process: 16296 ExecStop=/usr/sbin/rndc stop (code=exited, status=0/SUCCESS)
Main PID: 1008 (code=exited, status=0/SUCCESS)
CPU: 907 ms

feb 07 07:21:27 weblandic.local named\[1008\]: validating mirror.alwyzon.net/A: no valid signature found
feb 07 07:21:27 weblandic.local named\[1008\]: validating mirror.alwyzon.net/AAAA: no valid signature found
feb 07 08:42:34 weblandic.local systemd\[1\]: Stopping BIND Domain Name Server...
feb 07 08:42:34 weblandic.local named\[1008\]: received control channel command 'stop'
Feb 07 08:42:34 weblandic.local named\[1008\]: no longer listening on 192.168.10.21#53
feb 07 08:42:34 weblandic.local named\[1008\]: shutting down: flushing changes
Feb 07 08:42:34 weblandic.local named\[1008\]: stopping command channel on 127.0.0.1#953
Feb 07 08:42:34 weblandic.local named\[1008\]: exiting
feb 07 08:42:34 weblandic.local systemd\[1\]: named.service: Deactivated successfully.
> Feb 07 08:42:34 weblandic.local systemd\[1\]: Stopped BIND Domain Name Server.
```
hosts is set as follows:

```

Code: Select all

127\.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

# End of section]

192\.168.10.21 ns1.weblandic.com ns1
192\.168.10.30 weblandic.com

# 192.168.10.22 ns2.weblandic.com ns2

# 192.168.10.31 weblandic.cloud
```

dig website:
```

Code: Select all

; \<\<\>\> DiG 9.18.1-1ubuntu1.3-Ubuntu \<\<\>\> weblandic.com
;; global options: +cmd
;; Got answer:
;; -\>\>HEADER\<\<- opcode: QUERY, status: NOERROR, id: 5907
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 56c5aced062081020100000063e2050f89aa2f82a99a4086 (good)
;; QUESTION SECTION:
;weblandic.com. IN A

;; ANSWER SECTION:
weblandic.com. 180 IN A XX.XX.XX.XX

;; Query time: 48 months
;; SERVER: 195.28.64.99#53(195.28.64.99) (UDP)
;; WHEN: Tue Feb 07 09:00:15 CET 2023
;; MSG SIZE rcvd: 86
```
The site does not appear to me either through the public IP or through the name weblandic.com. DDclient is set to namecheap and updates the public address regularly when it changes it will also change it.Websites should still serve as a home cloud, media center and blog.Three domains should be running on it. Can you help me?
[Screenshot website from localhost as domain name](https://i.stack.imgur.com/ydOuV.jpg)
[Screenshot website from public IP][1]
[Screenshot from local LAN adress][2]


Here is also example.com.conf

Code: Select all

```
<VirtualHost *:80>
    DocumentRoot /var/www/weblandic.com
    ServerName weblandic.com
    <Directory "/var/www/weblandic.com">
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.weblandic.com.log
    CustomLog ${APACHE_LOG_DIR}/access.weblandic.com.log combined
    #SSLEngine                on
    #SSLCertificateFile       /etc/ssl/certs/weblandic.com.crt
    #SSLCertificateKeyFile    /etc/ssl/private/weblandic.com.key
    #SSLCertificateChainFile  /etc/ssl/certs/ca-certificates.crt
</VirtualHost>
```
Status networking

```

Code: Select all

networking.service - Raise network interfaces
     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
     Active: active (exited) since Tue 2023-02-07 07:00:20 CET; 2h 11min ago
       Docs: man:interfaces(5)
   Main PID: 865 (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 4470)
     Memory: 1.9M
        CPU: 57ms
     CGroup: /system.slice/networking.service

feb 07 07:00:20 weblandic.local systemd[1]: Starting Raise network interfaces...
feb 07 07:00:20 weblandic.local ifup[915]: /etc/network/if-up.d/resolved: 12: mystatedir: not found
feb 07 07:00:20 weblandic.local systemd[1]: Finished Raise network interfaces.
```


[1]: https://i.stack.imgur.com/XyLtf.jpg
[2]: https://i.stack.imgur.com/UJCsL.jpg
Last edited by LockBot on Mon Aug 07, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
axrusar
Level 7
Level 7
Posts: 1515
Joined: Sat Jan 30, 2021 5:30 pm

Re: Apache and the website on the home server are not working

Post by axrusar »

Maxximus999 wrote: Tue Feb 07, 2023 2:23 pm If I enter my current IP in the search engine and I don't have the port directed to the server on the router, it shows me the router interface, if I point to the server IP, it loads the page on the server, but only as if in basic mode, as if I didn't have PHP on the server. The site runs on Wordpress.
You should start setting up your router properly.
Try disabling remote login on port 80 in the router, and forward 80, 443 to your web server. You can't have both, the router and web server listening on port 80 at the same time.
Use certificates with lets encrypt. Hopefully you have nothing sensitive on this server as it looks like you are just learning to set it up.
You should be able to open the apache page from a remote location (like your cellphone using the provider's network, not your wifi) if port 80 is forwarded to your server on the TPlink.
Try with the wan IP first, once you connect this way, then continue with the domain part.
Linux Mint Una Cinnamon 20.3 Kernel: 5.15.x | Quad Core I7 4.2Ghz | 24GB Ram | 1TB NVMe | Intel Graphics
Image
Locked

Return to “Networking”