change "localhost" to something else
Posted by: sKunKbad (---.lsanca.fios.verizon.net)
Date: June 04, 2009 06:45PM

Because I am now running a VM and quest needs something other than "localhost", I changed my hosts file on both host O/S and guest O/S. This works fine for me, but I would like to change wampserver so that the Menu.Left is updated in wampserver.ini. When I make the changes, and restart wampserver, wampserver is automatically rewriting the ini file back to localhost. What can I do to make sure wampserver knows that localhost is now changed to something else. I was using "rbg72.web".

Brian G.
www.brianswebdesign.com

Options: ReplyQuote
Re: change "localhost" to something else
Posted by: toumimi (---.14.115-78.rev.gaoland.net)
Date: June 04, 2009 06:55PM

Hi,

As you said, wampserver is automatically rewriting the ini file.
From the refresh script, it uses wampmanager.tpl to generate wampmanager.ini

So, you only need to modify this file and when you start wamp (or refresh), modifications are now effective.

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: change "localhost" to something else
Posted by: yfastud (Moderator)
Date: June 04, 2009 07:54PM

you might have more than 1 project later on, so I suggest you undo what you did and setup vh instead
to setup vh, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: change "localhost" to something else
Posted by: sKunKbad (68.183.30.---)
Date: June 05, 2009 12:33AM

OK, I've got it working by changing the TPL file. Thanks for the info.

@yfastud, I do have multiple sites on this development server. I just put them in their own directory, and write my scripts to use the domain of wherever they happen to be at the time, such as with CodeIgniter's base_url function, or Kohana's url::base(); If I use virtual hosts, would I have to alter my hosts file when I want to see the site on the production server?

Options: ReplyQuote
Re: change "localhost" to something else
Posted by: yfastud (Moderator)
Date: June 05, 2009 02:04AM

In my vh guide which is very basic and was built to help beginners, the host file is used to help when using short local domains which can be fake, mostly for quick and convenient local test or access; however, people from outside your network have to use full url in order to access your sites on your pc, don't they? in short words, host file has nothing to do when your sites are accessed from outside; the production server? if you don't host your sites but load them to live host or transfer them from 1 pc to another, you don't need to include the host file, right?

bw, I don't use neither CodeIgniter's base_url function nor Kohana's url::base(), so please flatter me; for example, you host your own sites on your pc and have only 1 IP and have 10 domains as follows

domain1.com has document root c:/wamp/www/domain1
domain2.com has document root c:/wamp/www/domain2
domain3.com has document root c:/wamp/www/domain3
..........

please, tell me how those functions work when visitor1 from Japan, for example, will be provided the contents from folder c:/wamp/www/domain1 when type in domain1.com in browser while in the same time visitor2 from French will access contents from folder c:/wamp/www/domain2 when type in domain2.com in browser...

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: change "localhost" to something else
Posted by: sKunKbad (---.lsanca.fios.verizon.net)
Date: June 05, 2009 06:30PM

OK, so in regards to base_url() or url::base(), both of these functions will derive a domain in url context from the current page visited.

So, for instance, if you are visiting http:/ / www.brianswebdesign.com/estimates.php , the base_url() or url::base() function would return http:/ / www.brianswebdesign.com/

Likewise, if I was on localhost, the base_url() or url::base() function would return http:/ / localhost/

In my php file, when I am making a link, I can use something like this:

<?php echo '<a href="' . base_url() . 'estimates.php">Website Estimates</a>'; ?>

and if I was on my development server the link would be made to work on localhost, and if I am on my production server, the link is made to work with [www.brianswebdesign.com]. Yes, I could use relative URLs, but this gets messy when going into subdirectories, or when creating links to CSS files and javascript files.

So, this is why what I did with the hosts files and wampserver.tpl is enough for my needs. Oh, and I also edited english.lang so that my left click menu shows rbg72.web instead of localhost.

Options: ReplyQuote
Re: change "localhost" to something else
Posted by: yfastud (Moderator)
Date: June 05, 2009 09:13PM

just as I guess, those functions are good for deploying a single site but can't substitute vh to host multiple sites; anyway, different people have different desires and glad you've found yours winking smiley

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: change "localhost" to something else
Posted by: sKunKbad (---.lsanca.fios.verizon.net)
Date: June 06, 2009 03:50AM

You are correct about this working for one site, but for multiple sites I simply put them in their own directory, andI rewrite all urls in an associated .htaccess file, with rewritebase as the name of the root directory. So if I have a site at C:/wamp/www/website, my .htaccess has rewritebase /website/

The nature of the frameworks I use is that they rewrite all requests to be routed through index.php, so making a quick change to the provided .htaccess file is simple.

Options: ReplyQuote
Re: change "localhost" to something else
Posted by: yfastud (Moderator)
Date: June 06, 2009 03:03PM

please, don't get me wrong since I didn't mean about your work but I've been looking for something else to substitute vh cause I have to restart server every time add or remove (sub)domains

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: change "localhost" to something else
Posted by: sKunKbad (---.lsanca.fios.verizon.net)
Date: June 07, 2009 07:51AM

@yfastud:

No offense taken. I can tell you are smart, as I have seen your posts. Each of us has our own style of working, coding, and solving problems.

I hope you will look at the codeigniter framework, at codeigniter.com . Even though I was always opposed to using a framework in the past, I have tried a couple now, and am really enjoying it. It can make you a faster programmer, but if you have your sites VH because they are online in a production environment, I don't think anything will be able to replace that. IF you are talking about your development server, then my way is nice for me... perhaps for you as well.

Options: ReplyQuote
Re: change "localhost" to something else
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: June 07, 2009 08:03AM

can i jsut point out that frameworks are great for web-designers... , they may not know much php etc and it will definitly help them speed up there project..

but the downside is that you never leave the language you are using. you end up learning the frameworks "madeup" language which is only useful for that framework,

once you know php/mysql inside out there is no speed difference... your code ends up smaller and easier to understand and any php programmer can edit/maintain the code.

there is two definitive groups - programmer/designer

so for someone building a small site them selfs and are mainly concerned with the design etc then framework is great, but as a programmer they have no real benifits - as frameworks stop your learning curve of php/mysql and start a new smaller learning curve of its own language.

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: change "localhost" to something else
Posted by: sKunKbad (68.183.30.---)
Date: June 08, 2009 09:45PM

stevenmartin99 Wrote:
-------------------------------------------------------
> can i jsut point out that frameworks are great
> for web-designers... , they may not know much
> php etc and it will definitly help them speed up
> there project..
>
> but the downside is that you never leave the
> language you are using. you end up learning the
> frameworks "madeup" language which is only
> useful for that framework,
>
> once you know php/mysql inside out there is no
> speed difference... your code ends up
> smaller and easier to understand and any php
> programmer can edit/maintain the code.
>
> there is two definitive groups -
> programmer/designer
>
> so for someone building a small site them selfs
> and are mainly concerned with the design etc then
> framework is great, but as a programmer they
> have no real benifits - as frameworks stop your
> learning curve of php/mysql and start a new
> smaller learning curve of its own language.


I used to believe this same thing. Not that I am a php guru, but I learned to use php, and would find myself making my own framework to accomplish common tasks. Since I use a framework, either my own or somebody else's, then I made the decision to use somebody else's based on the fact that through community usage, bugs can be found/fixed, plug-ins and other community based code can be acquired, and I can work faster. While you may not think that my 3+ years of php experience is much, I learned the bulk of php in that time, and only recently started using somebody else's framework. Frameworks are definitely worth checking out. That said, I more-or-less support your position too. A person that does not know php should not use a php framework.

Options: ReplyQuote


Sorry, only registered users may post in this forum.