What's new

Help Pointing different servers behind a firewall to different domains each?

thedarkdragon11

Honorary Poster
Established
Need help pointing each servers to domains...

Bale nasa local network yung parehong servers tapos may firewall... Naka port forward yung required ports sa static IP ng firewall, kailangan maipoint each si Server 1 kay Domain 1, and kay Server 2 kay Domain 2 na hindi dapat kailangan na ilagay pa yung port sa dulo ng domain para maaccess... Dapat pag ang pupuntahan ay si Domain 1, matic dapat sa Server 1 ang landing, same sa isang server...

Pahelp po sa config... Using Ubuntu with Apache2 po for the servers and Pfsense for the firewall...

Thanks sa makakasagot...
 
To achieve the setup you described, you can use Apache's Virtual Hosts feature along with the configuration on your PfSense firewall. Here's a high-level guide on how to configure this setup:

1. Configure PfSense Firewall:
- Make sure port forwarding is correctly set up for both servers.
- Ensure that the required ports for each server are forwarded to the correct internal IP address of the respective server.

2. Configure Apache Virtual Hosts on Ubuntu:
- For Server 1 (Domain 1):
- Edit Apache's configuration file for virtual hosts:
Code:
bash
       sudo nano /etc/apache2/sites-available/domain1.conf
- Add the following configuration (replace placeholders with actual values):
Code:
apache
       <VirtualHost *:80>
           ServerName domain1.com
           DocumentRoot /var/www/domain1
       </VirtualHost>
- Enable the virtual host:
Code:
bash
       sudo a2ensite domain1.conf
- Reload Apache for changes to take effect:
Code:
bash
       sudo systemctl reload apache2

- For Server 2 (Domain 2):
- Follow similar steps as above but create a separate configuration file for Domain 2.

3. DNS Configuration:
- Ensure that the DNS records for Domain 1 and Domain 2 point to the public IP address of your PfSense firewall.

4. Testing:
- Once the configuration is done, you should be able to access Server 1 by entering Domain 1 in a web browser and Server 2 by entering Domain 2.

This setup ensures that incoming requests to Domain 1 are directed to Server 1 and requests to Domain 2 are directed to Server 2 without needing to specify the port at the end of the domain. Make sure to adjust the configuration based on your actual domain names and server settings.

If you encounter any issues during the setup process or need further assistance with specific configurations, feel free to ask for help!
 
To achieve the setup you described, you can use Apache's Virtual Hosts feature along with the configuration on your PfSense firewall. Here's a high-level guide on how to configure this setup:

1. Configure PfSense Firewall:
- Make sure port forwarding is correctly set up for both servers.
- Ensure that the required ports for each server are forwarded to the correct internal IP address of the respective server.

2. Configure Apache Virtual Hosts on Ubuntu:
- For Server 1 (Domain 1):
- Edit Apache's configuration file for virtual hosts:
Code:
bash
       sudo nano /etc/apache2/sites-available/domain1.conf
- Add the following configuration (replace placeholders with actual values):
Code:
apache
       <VirtualHost *:80>
           ServerName domain1.com
           DocumentRoot /var/www/domain1
       </VirtualHost>
- Enable the virtual host:
Code:
bash
       sudo a2ensite domain1.conf
- Reload Apache for changes to take effect:
Code:
bash
       sudo systemctl reload apache2

- For Server 2 (Domain 2):
- Follow similar steps as above but create a separate configuration file for Domain 2.

3. DNS Configuration:
- Ensure that the DNS records for Domain 1 and Domain 2 point to the public IP address of your PfSense firewall.

4. Testing:
- Once the configuration is done, you should be able to access Server 1 by entering Domain 1 in a web browser and Server 2 by entering Domain 2.

This setup ensures that incoming requests to Domain 1 are directed to Server 1 and requests to Domain 2 are directed to Server 2 without needing to specify the port at the end of the domain. Make sure to adjust the configuration based on your actual domain names and server settings.

If you encounter any issues during the setup process or need further assistance with specific configurations, feel free to ask for help!
Didn't work... Domain still needs the port in order to continue...
 
Didn't work... Domain still needs the port in order to continue...
If your domains still require specifying the port number even after setting up Apache virtual hosts, it could be due to a few reasons. Here are some troubleshooting steps you can take:

1. Check Apache Configuration:
- Double-check the Virtual Host configuration files for both Server 1 and Server 2 to ensure they are correctly set up.
- Make sure the ServerName directive matches the domain name you are trying to access.
- Verify that the DocumentRoot is set correctly for each domain.

2. Apache Restart:
- After making any changes to the Apache configuration, restart Apache to apply the changes:
Code:
bash
     sudo systemctl restart apache2

3. Check PfSense Firewall Configuration:
- Verify that the port forwarding rules on your PfSense firewall are correctly set up to forward traffic to the correct internal IP addresses of Server 1 and Server 2.
- Ensure that the port forwarding rules are active and applied.

4. DNS Configuration:
- Confirm that the DNS records for Domain 1 and Domain 2 point to the public IP address of your PfSense firewall.
- Allow some time for DNS propagation if you have recently made changes to your DNS records.

5. Browser Cache:
- Clear the cache in your web browser to ensure you are not seeing cached responses that might be affecting the access to your domains.

6. Check Firewall Rules:
- Ensure that there are no additional firewall rules on your servers that could be affecting the traffic flow.

7. Testing with Another Device:
- Test accessing the domains from another device or network to rule out any local issues.

If you have checked all the above steps and are still facing issues where the domain requires specifying the port number, please provide more details about your configuration and any error messages you encounter. This will help in further troubleshooting the problem and providing you with a more specific solution.
 
If your domains still require specifying the port number even after setting up Apache virtual hosts, it could be due to a few reasons. Here are some troubleshooting steps you can take:

1. Check Apache Configuration:
- Double-check the Virtual Host configuration files for both Server 1 and Server 2 to ensure they are correctly set up.
- Make sure the ServerName directive matches the domain name you are trying to access.
- Verify that the DocumentRoot is set correctly for each domain.

2. Apache Restart:
- After making any changes to the Apache configuration, restart Apache to apply the changes:
Code:
bash
     sudo systemctl restart apache2

3. Check PfSense Firewall Configuration:
- Verify that the port forwarding rules on your PfSense firewall are correctly set up to forward traffic to the correct internal IP addresses of Server 1 and Server 2.
- Ensure that the port forwarding rules are active and applied.

4. DNS Configuration:
- Confirm that the DNS records for Domain 1 and Domain 2 point to the public IP address of your PfSense firewall.
- Allow some time for DNS propagation if you have recently made changes to your DNS records.

5. Browser Cache:
- Clear the cache in your web browser to ensure you are not seeing cached responses that might be affecting the access to your domains.

6. Check Firewall Rules:
- Ensure that there are no additional firewall rules on your servers that could be affecting the traffic flow.

7. Testing with Another Device:
- Test accessing the domains from another device or network to rule out any local issues.

If you have checked all the above steps and are still facing issues where the domain requires specifying the port number, please provide more details about your configuration and any error messages you encounter. This will help in further troubleshooting the problem and providing you with a more specific solution.
All is configured properly... But it still needs port...
 
All is configured properly... But it still needs port...
If your setup is correctly configured with Apache virtual hosts for Server 1 and Server 2, and the port forwarding rules on your PfSense firewall are accurate, yet the domains still require specifying the port number, there might be a few additional considerations to address:

1. Check for Any Default Ports:
- Ensure that there are no default ports specified in the Apache configuration files or any other server configuration that might be causing the issue. Check for any global configurations that could be overriding the virtual host settings.

2. Verify Port 80 and 443:
- Confirm that your Apache server is listening on ports 80 (HTTP) and 443 (HTTPS). You can check this using the following command:
Code:
bash
     sudo netstat -tuln | grep -E '80|443'
Make sure Apache is bound to these ports.

3. Check for Reverse Proxy:
- Ensure there are no reverse proxy configurations in Apache that might be redirecting requests to a different port. Check for any ProxyPass or ProxyPassReverse directives in your Apache configuration files.

4. Verify DNS Settings:
- Double-check your DNS settings to ensure that the domain names are resolving correctly to the public IP address of your PfSense firewall. You can use tools like nslookup or dig to troubleshoot DNS resolution.

5. Inspect Browser Behavior:
- Test accessing the domains from different browsers or devices to see if the issue is consistent across all platforms. Sometimes, browser extensions or local settings can impact how domains are resolved.

6. Check for Transparent Proxy:
- Ensure that there are no transparent proxy configurations on your network that might be intercepting and redirecting traffic to a different port.

7. Review Firewall Rules:
- Double-check the firewall rules on your PfSense firewall to ensure that there are no restrictions or rules that could be affecting the traffic flow to the servers.

If after going through these additional checks the issue persists, consider capturing network traffic using tools like Wireshark to analyze the packets and see if there are any unexpected redirects happening. This can help identify where the port redirection is occurring.

If the problem still persists after these checks, providing more details about your configuration and any error messages encountered can help in further troubleshooting the issue.
 

Users search this thread by keywords

  1. pfsense
  2. network server setup
  3. apache
  4. firewall
  5. domain network
Back
Top