I am a first-timer with this stuff. I have a new Ubuntu server. I have PostFix and SSH working.
I have installed Wordpress (Lamp stack, apache2, and MariaDB). I also installed NextCloud and uninstalled it again.
Now, Localhost shows my wordpress site just fine. But my static IP and domain name do not.
When I go to my static IP:
Unable to connect
Firefox can’t establish a connection to the server at [Static ip here].
When I go to my domain name:
Hmm. We’re having trouble finding that site.
We can’t connect to the server at [domain name].
It is always hard to know what data to present here. But from other posts (I have tried to follow them but to no success) I see some stuff, I'll add it, but please ask if you need more.
iptables -L -n | grep 80
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:80
/etc/hosts
127.0.0.1 localhost
127.0.1.1 [computername]
# 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
netstat -ltnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1013/mysqld
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 713/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 913/sshd: /usr/sbin
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1091/cupsd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2251/master
tcp6 0 0 :::80 :::* LISTEN 1048/apache2
tcp6 0 0 :::22 :::* LISTEN 913/sshd: /usr/sbin
tcp6 0 0 ::1:631 :::* LISTEN 1091/cupsd
tcp6 0 0 :::443 :::* LISTEN 1048/apache2
ufw status verbose
To Action From
-- ------ ----
22/tcp ALLOW IN Anywhere
80/tcp ALLOW IN Anywhere
25/tcp (Postfix) ALLOW IN Anywhere
25/tcp ALLOW IN Anywhere
465/tcp ALLOW IN Anywhere
80 ALLOW IN Anywhere
443 ALLOW IN Anywhere
22/tcp (v6) ALLOW IN Anywhere (v6)
80/tcp (v6) ALLOW IN Anywhere (v6)
25/tcp (Postfix (v6)) ALLOW IN Anywhere (v6)
25/tcp (v6) ALLOW IN Anywhere (v6)
465/tcp (v6) ALLOW IN Anywhere (v6)
80 (v6) ALLOW IN Anywhere (v6)
443 (v6) ALLOW IN Anywhere (v6)
lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
apache2 1048 root 4u IPv6 31553 0t0 TCP *:http (LISTEN)
apache2 4128 www-data 4u IPv6 31553 0t0 TCP *:http (LISTEN)
apache2 4129 www-data 4u IPv6 31553 0t0 TCP *:http (LISTEN)
apache2 4130 www-data 4u IPv6 31553 0t0 TCP *:http (LISTEN)
apache2 4131 www-data 4u IPv6 31553 0t0 TCP *:http (LISTEN)
apache2 4132 www-data 4u IPv6 31553 0t0 TCP *:http (LISTEN)
apache2 4134 www-data 4u IPv6 31553 0t0 TCP *:http (LISTEN)
a2dissite command only shows my own domain.
my config for the domain (is in sites-enabled)
<VirtualHost *:80>
ServerName [domain name]
ServerAlias www.[domain name]
ServerAdmin [my mail]
DocumentRoot /var/www/[domain name]
<Directory "/var/www/[domain name]">
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I feel I have tried many things now, but I cannot seem to find the right post to guide me to the answer.
One final thing is that my domain name is .dk, I do not know if that changes anything, but now you know.
I hope you can.