Jump to content

Recommended Posts

It is very easily done. Simply create a name based host in the virtual host configuration file to respond to your IP address. I use XAMPP on my windows webserver and it's entry looks like this

 

<VirtualHost *:80>

    ServerName 123.456.789.123

    DocumentRoot "c:\program files\xampp\htdocs\site_folder"

</VirtualHost>

 

If you have a nat-router on your network, you may need to forward port 80 to that machine. I have 3 machines on my network, and I have to port forward to the proper machine so it is accesible to the general public.

 

My cousin has a domain that she don't have a host set up for (and the site is not ready yet) so I simply went to the registrar's control panel and forwarded that domain name to my IP address and by setting the above v-host, my machine will receive the forward from www.millstarkaraoke.com which is translated into my ip address by the registrar, and my machine responds to that IP and serves the index.php file in that folder.

 

If you have a dynamic IP address, meaning if it changes on ya every once in a while, you may need to keep track of it and change the above v-host entry to respond to the new IP address. You must restart Apache when you make this change.

 

Hope it helps get ya up and running.

 

Nate

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250347
Share on other sites

sometimes i wonder what the big advantage is of haveing your own server at home. i peronally think its better to buy a server and then find an internet provider that also provides services of running it, usually this saves alot of money on electricity bills and you get a far faster connection, whilst still being able to run whatever you want on it

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250349
Share on other sites

Dear Only One,

When it comes to production, yes i definitely agree, server space providers are preferable as the speed is better and they should be 24/7 beside the machine.

Now I am testing my work the cheapest way, if I hire a server space provider while developing he will charge me, yayaya it is cheap, but i want to spend it on dinner.

 

Dear Chronister,

Port forwarding should not be a problem.

Where shell i type your commands, mean while I have enabled serveronline.

what address should i type to see my index page?

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250355
Share on other sites

sometimes i wonder what the big advantage is of haveing your own server at home. i peronally think its better to buy a server and then find an internet provider that also provides services of running it, usually this saves alot of money on electricity bills and you get a far faster connection, whilst still being able to run whatever you want on it

 

Well, I am doing it right now simply because the website is in development, and there is no need to spend money on a webhost right now.

 

I did it too when I was just starting out with this stuff. I have a disabled wife and 3 kids so money is tight. Since I did not have the extra $$$$, I opted to just run it from my home computer. If the site is getting slammed with hundreds of requests per hour, then yeah a big time host that has the hardware up to snuff for that kind of thing is going to be better, but if only a few people are hitting it per day there is no noticeable speed decrease on my end or their end.

 

You don't HAVE to have a screaming powerful system to run a webserver. The site I mentioned above is running on a p3 733Mhz with 384Mb ram and 10gig hard drive. That is plenty powerful enough to serve it to the small amount of traffic it gets now, but I would not dare trying to run it if the site was getting a bunch of hits per day or even 20-30 connections simultaneously.

 

It is very cheap too. The pc was given to me, the software is Win XP (*cough*pirated*cough*) with XAMPP. So in reality this machine only costs me it's share of my internet connection and it's share of electricity.

 

Plus it's a geeky satisfaction knowing friends and family are browsing a site on the web hosted on a machine sitting next to me. The same geek satisfaction when you fire up your first custom built PC and it gets past POST and you get the wonderful INVALID SYSTEM DISK (because you have not installed an os yet).

 

It's a geek thing  ;D

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250356
Share on other sites

Port forwarding should not be a problem.

Where shell i type your commands, mean while I have enabled serveronline.

what address should i type to see my index page?

 

You will have to find the v-host config file in WAMP and add the entry there. You will use your public IP address as found by visiting www.whatismyip.com

 

I am not familiar with WAMP, but the file in XAMPP is in /xampp/apache/conf/extra/httpd-vhosts.conf

 

I would guess that WAMP has a *similar* structure, but you would have to check their FAQ's if you cannot locate it yourself

 

Nate

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250359
Share on other sites

its not really a webhost... there are places where you can put your server, where i live in holland there is a phone companie called KPN that runs your server for a charge of 30 euro a month with an internt speed of 30mbps

 

I will stick to either a 3.74 USD per month shared host or do it myself for free. With that setup, you have to own the hardware, and pay a bit more. But all in all, not a bad deal compared to some of the dedicated servers I have seen

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250360
Share on other sites

I found the file in similar location, the already exhisting entry

 

"

 

<VirtualHost *:80>

    ServerAdmin webmaster@dummy-host.localhost

    DocumentRoot /www/docs/dummy-host.localhost

    ServerName dummy-host.localhost

    ServerAlias www.dummy-host.localhost

    ErrorLog logs/dummy-host.localhost-error_log

    CustomLog logs/dummy-host.localhost-access_log common

</VirtualHost>

 

<VirtualHost *:80>

    ServerAdmin webmaster@dummy-host2.localhost

    DocumentRoot /www/docs/dummy-host2.localhost

    ServerName dummy-host2.localhost

    ErrorLog logs/dummy-host2.localhost-error_log

    CustomLog logs/dummy-host2.localhost-access_log common

</VirtualHost>

 

"

 

please advise shell I repalce the above with yours or just append to it.

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250368
Share on other sites

Patience dear lad... I am typing.....

 

change the document root to whatever your document root is, and put your ip address in the ServerName spot

 

linux path version..

 

<VirtualHost *:80>

    DocumentRoot /path/to/your/sites/folder/here

    ServerName ip.address.goes.here

</VirtualHost>

 

windows path version

 

<VirtualHost *:80>

    DocumentRoot "c:\path\to\your\sites\folder\here"

    ServerName ip.address.goes.here

</VirtualHost>

 

If you need further instruction, then post back with your PUBLIC ip address as found at www.whatismyip.com, the full location of the folder you are serving pages from, and whether you're running a windows machine or a linux machine

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250374
Share on other sites

Thanks for your time,

(1)I am at office, I will try at home later (dial Up), thus no forwarding.

(2)You have requested me to replace the already existing entry with yours.

(3)I am using winXP.

(4)IP, I can find out at home later

(5)My Index file is : "C:\wamp\www\Index.php"

Note in the Index.php, I will redirect to another page which is in a proper folder system "C:\wamp\www\MyPHP\*.*"

 

Please write me the instruction set, thanks

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250379
Share on other sites

If your going to try to do this on a dial up connection at home, then you will have to change the IP part of the virtualhost  every time you dial in, as your IP address will change.

 

There is no need to point to the index file and then redirect. If you want to serve pages out of

"C:\wamp\www\MyPHP\", then just use that in the DocumentRoot

 

Copy and paste this code into your own virtual host file. All you have to do is find your ip address, replace it in the part labeled ip.address.goes.here, save the file, and then restart apache. You should then be able to reach your home server by using your public IP address.

 

<VirtualHost *:80>

    DocumentRoot "C:\wamp\www\MyPHP\",

    ServerName ip.address.goes.here

</VirtualHost>

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250385
Share on other sites

If you want to serve pages out of C:\wamp\www\MyPHP\, then by setting this path in the DocumentRoot it becomes "localhost"

 

You will type the IP address of your machine to get to that page. You can set up as many sites on one machine as you want. You access the site with whatever you set as ServerAlias.

 

For example Here is a v-host file I use on my linux webserver. It is 6 different sites.

 

I access them by typing the following in the address bar.

jen

blogw

a

k

music

test

 

<VirtualHost jen>

    ServerName jen   

    DocumentRoot /var/www/jen

    </VirtualHost>

 

 

    <VirtualHost blogw>

    ServerName blogw

    DocumentRoot /var/www/wordpress

    </VirtualHost>

 

 

    <VirtualHost music>

    ServerName music

    DocumentRoot /var/www/music

    </VirtualHost>

 

 

    <VirtualHost a>

    ServerName a

    DocumentRoot /var/www/phpMyAdmin

    </VirtualHost>

 

 

    <VirtualHost k>

    ServerName k   

    DocumentRoot /var/www/karaoke

    </VirtualHost>

 

    <VirtualHost test>

    ServerName test   

    DocumentRoot /var/www/test

    </VirtualHost>

 

 

Hope this helps

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250395
Share on other sites

Ok,

 

I understand your note,

 

Lets get in Sync.

 

I am using my home server now, when I type my ip number,

I see "http://ip number/ blablabla.php" when it gets redirected I see "http://ip number/ blablabla2.php".

 

When I assign my domain name and get my first page to be the same blablabla.php, will i see blablabla.php or blablabla.com. this is my concern.

Link to comment
https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-251771
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.