I have Ubuntu 14.04, installed & configured apache2
And running three websites in the default port 80, those websites are working fine, but I want to run a another website in the port number of 8081, the url must be example.com:8081.
Can anyone help me, how to assign a particular port number to particular website in Ubuntu apache2 & Centos too thanks
For example, to make the Apache server to accept requests on port 80 and different ports say 81, 82, 83 and so on…
You need to add “Listen” directives to each number of addresses and ports to your Apache configuration file as shown below.
Or else to make the requests accept on different interfaces and port numbers, you should add like this:
Apache comes with two Virtual Host’s method, one is name-based and other is IP-based, so here we going to use IP-based as our requirement is to run sites on different ports and addresses.
So, our IP-based Virtual Host’s configuration look like this:
CustomLog "/website/logs/website/access_log" combined
CustomLog "/website1/logs/website1/access_log" combined
CustomLog "/website2/logs/website2/access_log" combined
CustomLog "/website3/logs/website3/access_log" combined
Finally restart the Apache service and test the configuration of sites
Test each site..
Modify config file of apache , then restart apache web server by
/etc/init.d/apachectl restart or /etc/init.d/httpd restart