ADD ANOTHER SITE
First, designate an unused IP address in the 10.0.0.0/24 range you want to be attached to your second site. Let’s say it’s 10.0.0.222 for demonstration purposes. Next, create a virtual host file for the new site in “/etc/apache2/ vhosts.d.” In it we designate < VirtualHost 10.0.0.222:80> so Apache responds to that IP address. Restart Apache with systemctl restart
httpd . Finally, add 10.0.0.222 to the tun0 interface by running ip address add 10.0.0.222 dev tun0 . This attaches the IP address to tun0 so the device responds to it. Verify it’s added with ip address
show . Change your after.local command to
openvpn --config /etc/openvpn/server.conf &&
sleep 10s && ip address add 10.0.0.222 dev tun0 so it’s executed on a reboot. The “&&” makes sure the previous command runs properly before executing the next command, and the “sleep” function waits for OpenVPN to create tun0 before adding another IP address to it.
Now you’re ready to test your second secret site. Connect to your server as usual, and point your browser to http://10.0.0.222. Your second secret site should be up and running.