Virtualhost problem port 9090

Hi, I need some help please i am changing the port to listen 9090,I want to create virtualhost for my site but i am confuse in the host file what should i put there

127.0.0.1:9090 mysite

is that valid?

and in the httpd-vhosts.conf i put something like this



<VirtualHost  *:9090>
    ServerAdmin admin@mysite
	DocumentRoot "C:/wamp/www/testsite"
	ServerName mysite
	ServerAlias www.mysite
	ErrorLog "logs/mylocalsite-error.log"
	CustomLog "logs/mylocalsite-access.log" common
</VirtualHost>

it’s not working when i tried to type in the url like this

[noparse]http://mysite[/noparse]

please help me.

Thank you in advance.

If you use port 9090 the URL becomes [noparse]http://mysite:9090[/noparse]. If you leave out the port number browsers will assume port 80 for HTTP and port 443 for HTTPS, which is why that works. For everything else, you must supply the port number in the URL. There is no way around this.

Hi ScallioXTX, but the problem is that i could not access anymore my phpmyadmin,if i type this in url localhost:9090 this will show my site.

What URL are you using for phpMyAdmin and what is the vhost configuration?

Hi ScallioXTX,

I mean the wampserver index the listing directory…

<VirtualHost *:9090>
ServerAdmin admin@mysite
DocumentRoot “C:/wamp/www/testsite”
ServerName mysite
ServerAlias www.mysite
ErrorLog “logs/mylocalsite-error.log”
CustomLog “logs/mylocalsite-access.log” common
</VirtualHost>

If i will do this http://mysite:9090 it open my site.

and if i will type in the url http://localhost:9090 still it opens to mysite…it should be the listing directory of the wampserver.

That’s because your using VirtualHost *:9090. Make that VirtualHost mysite:9090

That won’t quite help – you still cant go to http://mysite:80 and get http://mysite:9090.

Now that you are out on custom ports you don’t need to mess with host files or host headers – just hit http://localhost:9090

Still doesn’t work…

This is what i put in my hostfile

127.0.0.1 mysite:9090

Remove the :9090 from your host file

Nothing happens, it will still open to mysite if i will use this url http://localhost:9090,it should be open to the index of my wampserver.

In your Apache config file (httpd.conf), change VirtualHost *:9090 to VirtualHost mysite:9090. That is, replace * with mysite.
Right now that vhost is listening on port 9090 for any domain name, which is not what you want, since it should only listen to mysite.

Yup i also do that but still i could not open the wampserver,i already followed your suggestion…

Did you add 127.0.0.1 mysite to your hosts file (assuming you are running this all locally and you don’t have a domain pointed to your PC)?

Yes,I already done putting the 127.0.0.1 mysite but still it will not open the index of my wampserver…it will open to my local site.