An easy way to configure Apache with multiple listening ports and different website directories



Open in /etc/apache2 : ports.conf

in Listen 80

Add multiple listening ports as follows

Listen 8011
Listen 8088

This increases the monitoring of ports 8011 and 8088

in /apache2/sites-available/000-default.conf

<VirtualHost *:80>
           ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:8011>
           ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:8088>
           ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>



Restart the Apache service, you can use


localhost

localhost:8011

localhost:8088

Visit your different website

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325524968&siteId=291194637