I would like to maintain port 80 for Apache2 to handle freepbx and sugarcrm portal). how could I set up 000-default.conf? If I can’t use port 80 for 2 portals, can I do port mapping such as 128.168.188.12:8081? Once I port map which part of the firewall must I set up to reflect it? iptables or csf or ufw?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
There are a number of ways to approach this. Do you have a domain name for your server? If so, the best way to serve both FreePBX and SugarCRM on port 80 would be to use subdomains. pbx.yourdomain.com could point to your FreePBX instance while yourdomain.com can point to SugarCRM. This article should point you in the right direction.
If that’s not an option, you can edit your Apache VirtualHost to simply listen on a different port. In your FreePBX’s VirtualHost, just change 80 to 8081
Listen *:8081
<VirtualHost *:8081>
ServerName pbx.yourdomain.com
ServerAdmin yourname@yourdomain.com
ErrorLog /var/log/apache2/freepbx.error.log
CustomLog /var/log/apache2/freepbx.access.log combined
DocumentRoot /var/www/freepbx
<Directory /var/www/freepbx>
Options Indexes FollowSymLinks MultiViews
Order allow,deny
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
FreePBX’s will now be available at your.ip.address:8081
As far as firewalling goes, csf and ufw are actually both just wrappers around IP Tables. You just need to open port 8081. With ufw, that would be:
sudo ufw allow 8081/tcp
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.