-4

Well, I searched for it so much! But I couldn't find anything useful about it.

I have a server with windows server 2008 r2 running on it.

I configured DNS and domain name and they are working properly.

Now I want to run my website with xampp not with IIS. I've installed xampp.

The problem is, xampp is using port 80 for http requests. Some other programs also use port 80 like svchost (That can not be terminated because system crashes.)

So we have to change the xampp port to 8080 or somrthing else. In this case yes xampp works. But just if we type

mydomain.com:8080

in the browser.

I don't want this. I want

mydomain.com

(Which is on port 80) directly point to xampp.

These are the solutions I've thought about for solving the problem:

1.Port forwarding: Like forward all incoming requests in port 80 to 8080(Xampp)

2.Changing default http listening port to 8080

I can't find a way to do one of the cases above. Maybe I'm wrong.

That was the main problem. Any idea?

  • You need to find out which service is using port 80 and make sure it doesn't start. You didn't tell exactly what you did when you terminated `svchost`, but I'm quite sure you didn't do it correctly. There shouldn't be any required service bound to port 80. – Tero Kilkanen Aug 22 '16 at 20:18
  • There are some services on windows servers which use port 80. I don't want to close them all every time I reboot the server. About svchost, I connect to my server remotely. When I terminate it, I'm disconnected. – robert sinior Aug 22 '16 at 20:23
  • You can disable the services so that they don't start. – Tero Kilkanen Aug 22 '16 at 20:44
  • 2
    Don't. XAMPP is a dev tool and not suitable for production use. – Sven Aug 22 '16 at 20:56
  • 1
    Beside, "share your experience" is not a suitable approach for [SF]. – Sven Aug 22 '16 at 20:57

1 Answers1

1

I solved the problem!

1. Change apache port to whatever you want. e.g 8080

2. In xampp folder open this file apache/conf/extra/httpd-vhosts.conf

  1. Add lines below to file and save it.

    <VirtualHost *:80>
         ServerAdmin webmaster@mydomain.com
         DocumentRoot "C:/xampp/htdocs/"
         ServerName mydomain.com
         ServerAlias www.mydomain.com:8080
         ErrorLog "logs/mydomain.com-error.log"
         CustomLog "logs/mydomain.com-access.log" common
    </VirtualHost>
    
    <VirtualHost *:8080>
         ServerAdmin webmaster@mydomain.com
         DocumentRoot "C:/xampp/htdocs/"
         ServerName mydomain.com
         ServerAlias www.mydomain.com:80
         ErrorLog "logs/mydomain.com-error.log"
         CustomLog "logs/mydomain.com-access.log" common
    </VirtualHost>
    

Good luck.