Knowledge Base

I have installed Apache, How do I access my website with no IPv4 from outside the server?

Once you have Apache installed, by default, the web server will be running on port 80, which your NAT server will not have access to, on IPv4. Your server will be able to access port 80 through IPv6. You can obtain your IPv6 address in the SolusVM Control Panel. If you would like to set up an IPv6 to IPv4 proxy take a look at our guide on how to do this using Cloudflare, HERE.

To continue the setup of accessing your website through IPv4 directly, we would need to change the web server from running on port 80 to one of the ports that have been assigned to your server, the following guide will walk you through this process.

1. In Debian/Ubuntu based system, the configuration file that needs modified is /etc/apache2/ports.conf on RHEL/CentOS based distributions edit /etc/httpd/conf/httpd.conf. Open the file specific to your distribution with a console text editor and add the new port statement as shown below.

# nano /etc/apache2/ports.conf     [On Debian/Ubuntu]
# nano /etc/httpd/conf/httpd.conf  [On RHEL/CentOS]

2. In this example we’ll configure the Apache HTTP server to listen to connections on port 8081. Make sure you add the below statement in this file, after the directive that instructs the web server to listen on port 80, as illustrated in the below image.

Listen 8081
Change Apache Port on Debian and Ubuntu
Change Apache Port on CentOS and RHEL

3. In CentOS/RHEL distributions, the change is applied directly to the default virtual host. (Skip to step 6)

4. In Debian/Ubuntu based distribution you need to create or alter an Apache virtual host in order to start the binding process, specific to your own vhost requirements. Open and edit 000-default.conf file and change the port to 8081 as shown in the below image.

# nano /etc/apache2/sites-enabled/000-default.conf 
Debian/Ubuntu Change Apache Port on Virtualhost

5. Finally, to apply changes and make Apache bind on the new port, restart the daemon

# systemctl restart apache2

6. Check in your browser

http://server.ip:8081 

Credits for this tutorial go to, Tecmint.

Please rate this article to help us improve our Knowledge Base.

2 0