oceans Posted May 11, 2007 Share Posted May 11, 2007 Dear People, Does any one know how to host your own server? For a start, let me use my ip address instead of my web domain name address. I will use WAMP5. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/ Share on other sites More sharing options...
chronister Posted May 11, 2007 Share Posted May 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250347 Share on other sites More sharing options...
only one Posted May 11, 2007 Share Posted May 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250349 Share on other sites More sharing options...
oceans Posted May 11, 2007 Author Share Posted May 11, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250355 Share on other sites More sharing options...
chronister Posted May 11, 2007 Share Posted May 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250356 Share on other sites More sharing options...
only one Posted May 11, 2007 Share Posted May 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250357 Share on other sites More sharing options...
chronister Posted May 11, 2007 Share Posted May 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250359 Share on other sites More sharing options...
chronister Posted May 11, 2007 Share Posted May 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250360 Share on other sites More sharing options...
only one Posted May 11, 2007 Share Posted May 11, 2007 yes but with that 30 euro a month you can run your own dns and server at full speed with up to id say around 100 websites Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250362 Share on other sites More sharing options...
oceans Posted May 11, 2007 Author Share Posted May 11, 2007 People, As I mentioned, either side there are relative advantages. I belive, test board do at home, production hire server space. Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250367 Share on other sites More sharing options...
oceans Posted May 11, 2007 Author Share Posted May 11, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250368 Share on other sites More sharing options...
oceans Posted May 11, 2007 Author Share Posted May 11, 2007 Dear Chronister, Can you help please. Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250372 Share on other sites More sharing options...
chronister Posted May 11, 2007 Share Posted May 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250374 Share on other sites More sharing options...
oceans Posted May 11, 2007 Author Share Posted May 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250379 Share on other sites More sharing options...
chronister Posted May 11, 2007 Share Posted May 11, 2007 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> Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250385 Share on other sites More sharing options...
oceans Posted May 11, 2007 Author Share Posted May 11, 2007 Thanks, I will try. But I was told that the Index file should be placed where the "local host" location is I forgot, What should I type at the browser to get to my index page? Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250392 Share on other sites More sharing options...
chronister Posted May 11, 2007 Share Posted May 11, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-250395 Share on other sites More sharing options...
oceans Posted May 13, 2007 Author Share Posted May 13, 2007 Thanks, It works, just to ask you in *.php pages, the extension appears in at the address box, is there any way we can mask it, I prefer the address to be with no extension. Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-251751 Share on other sites More sharing options...
chronister Posted May 13, 2007 Share Posted May 13, 2007 ummmmm.. I believe that would be a mod_rewrite... but I am not sure. Why hide the extension?? What is the purpose of that?? Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-251753 Share on other sites More sharing options...
oceans Posted May 13, 2007 Author Share Posted May 13, 2007 hahaha, i have visited a lot of sites, i felt w/o extension appears to be more professional. eg: which you prefer www.yahoo.com or www.yahoo.php Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-251760 Share on other sites More sharing options...
chronister Posted May 13, 2007 Share Posted May 13, 2007 .com is a top level domain .php is a file extension .html is a file extension .asp is a file extension I don't see a purpose for hiding the file extension in pages Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-251763 Share on other sites More sharing options...
oceans Posted May 13, 2007 Author Share Posted May 13, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-251771 Share on other sites More sharing options...
chronister Posted May 13, 2007 Share Posted May 13, 2007 well.. since your ip is what your using instead of a .com address, you will see http://ip_number/ blablabla2.php Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-251776 Share on other sites More sharing options...
oceans Posted May 13, 2007 Author Share Posted May 13, 2007 I got it, I just noted all the web pages works this way. Thanks friend ;) ;) Quote Link to comment https://forums.phpfreaks.com/topic/50890-solved-help-please/#findComment-251777 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.