Change port of all websites in apache from 80 to 8080

thunn

Verified User
Joined
Mar 13, 2012
Messages
166
Dear Supporters,
I want to use port of website 8080 instead of default 80 for all of my websites.
Example: http://mysite.com:8080/index.php, http://abcsite.com:8080/

I have tried to change in 2 location:
Change port from 80 to 8080 in /etc/httpd/conf/httpd.conf
Change port from 80 to 8080 in each domain site:
Code:
nano /usr/local/directadmin/data/users/mysite/httpd.conf
<VirtualHost 112.211.10.40:8080 >  
        ServerName www.mysite.com
        ServerAlias www.mysite.com mysite.com


nano /usr/local/directadmin/data/users/abcsite/httpd.conf
<VirtualHost 112.211.10.40:8080 >  
        ServerName www.abcsite.com
        ServerAlias www.abcsite.com abcsite.com

I tried to restart the apache, and get the following warning:
Starting httpd: [Tue Jun 12 05:23:40 2012] [warn] VirtualHost 112.211.10.40:8080 overlaps with VirtualHost 112.211.10.40:8080, the first has precedence, perhaps you need a NameVirtualHost directive

And when I typed in browser: abcsite.com and it redirect me to mysite.com
I have tried with another site and it redirect me to mysite.com too :(
 
Last edited:
You should change virtual_host2*.conf file in /usr/local/directadmin/data/template/custom

Ok, there should not be in custom, you need to copy there from /usr/local/directadmin/data/template than edit.

Once done, you need to let directadmin rewrite confs.

Also please notice that the error is just a warning, to understand why you get redirected you should read apache logs.

Regards
 
Back
Top