My websites became inaccessible when I installed a vpn on the same droplet

July 19, 2017 150 views
Apache VPN Ubuntu 16.04

Since I installed a vpn on my droplet using this tutorial https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04
The 4 websites I had hosted on my droplet have become inaccessible. I can still log in to the droplet via ssh and sftp, could setting up the vpn have blocked the websites?
I've tried restarting the server, stopping the vpn and been through this troubleshooting tutorial https://www.digitalocean.com/community/tutorials/how-to-troubleshoot-common-site-issues-on-a-linux-server

logs:

/var/log/apache2/access.log
<blank>

/var/log/apache2/error.log
[Wed Jul 19 06:25:04.293027 2017] [mpm_prefork:notice] [pid 1654] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Wed Jul 19 06:25:04.293087 2017] [core:notice] [pid 1654] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jul 19 07:55:15.734026 2017] [mpm_prefork:notice] [pid 1654] AH00169: caught SIGTERM, shutting down
[Wed Jul 19 07:55:16.939529 2017] [mpm_prefork:notice] [pid 8537] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Wed Jul 19 07:55:16.939675 2017] [core:notice] [pid 8537] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jul 19 08:07:55.955741 2017] [mpm_prefork:notice] [pid 8537] AH00171: Graceful restart requested, doing restart
[Wed Jul 19 08:07:56.087312 2017] [mpm_prefork:notice] [pid 8537] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Wed Jul 19 08:07:56.087355 2017] [core:notice] [pid 8537] AH00094: Command line: '/usr/sbin/apache2'

service apache2 status
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since Wed 2017-07-19 07:55:17 UTC; 51min ago
Docs: man:systemd-sysv-generator(8)
Process: 8492 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 8638 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
Process: 8519 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
Tasks: 6
Memory: 16.6M
CPU: 642ms
CGroup: /system.slice/apache2.service
├─8537 /usr/sbin/apache2 -k start
├─8658 /usr/sbin/apache2 -k start
├─8659 /usr/sbin/apache2 -k start
├─8660 /usr/sbin/apache2 -k start
├─8661 /usr/sbin/apache2 -k start
└─8662 /usr/sbin/apache2 -k start

Jul 19 07:55:16 willhayhosting.com systemd[1]: Stopped LSB: Apache2 web server.
Jul 19 07:55:16 willhayhosting.com systemd[1]: Starting LSB: Apache2 web server...
Jul 19 07:55:16 willhayhosting.com apache2[8519]: * Starting Apache httpd web server apache2
Jul 19 07:55:17 willhayhosting.com apache2[8519]: *
Jul 19 07:55:17 willhayhosting.com systemd[1]: Started LSB: Apache2 web server.
Jul 19 08:07:55 willhayhosting.com systemd[1]: Reloading LSB: Apache2 web server.
Jul 19 08:07:55 willhayhosting.com apache2[8638]: * Reloading Apache httpd web server apache2
Jul 19 08:07:56 willhayhosting.com apache2[8638]: *
Jul 19 08:07:56 willhayhosting.com systemd[1]: Reloaded LSB: Apache2 web server.

2 Answers

Hi @williamfmhay

They shouldn't work against each other, so it's a little strange.
When I visit willhayhosting.com I see a text saying Hello World! - is that correct or just a test to try to figure out what's going on?

Can you make sure that the 4 websites VirtualHost configuration is files located in:

/etc/apache2/sites-enabled/
  • Hey, yeh. Sorry I didn't update this. I looking back at the vpn tutorial and it had created/enabled a firewall. So I just needed to allow apache, http, https and port 80 through that. So the Hello World! you can see is it working. Thanks for your answer though.

For future reference, the VPN tutorial enabled a firewall that blocked http traffic to apache, so to fix a similar issue, run:
sudo ufw allow http
or
sudo ufw allow 80

then

sudo ufw allow https
or
sudo ufw allow 443

more details here https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands

UFW is a firewall configuration tool for iptables that is included with Ubuntu by default. This cheat sheet-style guide provides a quick reference to UFW commands that will create iptables firewall rules are useful in common, everyday scenarios. This includes UFW examples of allowing and blocking various services by port, network interface, and source IP address.
Have another answer? Share your knowledge.