From: Alexander D. <me...@ea...> - 2003-03-08 19:37:32
|
I have installed phpwiki and am using it with mySQL. I am hosting the site on my own computer. Part of it runs just fine, but I have two questions. First, when I access the phpwiki site locally, there is no problem. When I access the site remotely from the internet there is a problem. The links created using [ and ] point to "http://mycomputername.local/phpwiki/index.php/thenameofthewikipage". As I said, this works on my local network, but obviously not from the web. If I manually type in "http://myipaddress/phpwiki/index.php/thenameofthewikipage" the page does come up fine. Is there a way to change the "mycomputername.local" in the index.php so that it just points to the local server instead of the name my computer has in the local network? What part of index.php do I need to change, and how do I need to change it? My second questions is, where are the new pages being created? In the "INSTALL" file it says that new pages are created in a "tmp" folder. I do not have a "tmp" folder in my phpwiki folder. So where are these pages being created? The first question is more practical and the second question is more academic. Thank you for any help you can offer me. Alexander |
From: Jeff D. <da...@da...> - 2003-03-08 20:56:35
|
> First, when I access the phpwiki site locally, there is no problem. > When I access the site remotely from the internet there is a problem. > The links created using [ and ] point to > "http://mycomputername.local/phpwiki/index.php/thenameofthewikipage". > As I said, this works on my local network, but obviously not from the > web. If I manually type in > "http://myipaddress/phpwiki/index.php/thenameofthewikipage" the page > does come up fine. It's really a problem with your http server configuration. By default, PhpWiki deduces the server host name from the $SERVER_NAME environment variable which is set by the http server (e.g. apache). So the best way to fix the problem is to fix your web server configuration so that it reports the correct server name. > Is there a way to change the "mycomputername.local" > in the index.php so that it just points to the local server instead of > the name my computer has in the local network? What part of index.php > do I need to change, and how do I need to change it? As a work-around you can manually set SERVER_NAME in index.php. Uncomment the line which says: if (!defined('SERVER_NAME')) define('SERVER_NAME', 'some.host.com'); and change 'some.host.com' to something more appropriate. > My second questions is, where are the new pages being created? In the > "INSTALL" file it says that new pages are created in a "tmp" folder. I > do not have a "tmp" folder in my phpwiki folder. So where are these > pages being created? The pages are stored in the MySQL database (if you're using the MySQL backend, which you are.) -- -- Jeff Dairiki <da...@da...> |
From: Jeff D. <da...@da...> - 2003-03-09 04:04:47
|
> My SERVER_NAME is not defined in my apache configuration and I think > this is a good thing. This allows me to have relative links that work > in my local network and also when people are accessing my website from > the internet. Yes, but your server really ought to be able to tell it's CGI programs how to form a complete URL to themselves. If you're using apache this should be possible, though I'm unsure of the details. Probably it involves setting up multiple virtual hosts with (slightly) different configuration, depending on what ethernet interface the request is coming from. Another common solution to your problem, is to use separate internal and external DNS nameservers, so you can have the same host name resolve to different IP numbers depending on whether you're on your internal network or the external internet. (Since it's the same machine, it should have the same name.) > For example, my web pages include links such as > "/images/mycoolpic.gif". Yes. That's a fine solution. Getting PhpWiki to do that would take a bit of work, but you could try. (It may be as simple as editing lib/config.php so that SERVER_URL gets defined to the empty string. You could try that --- I'm not sure it will work, and it probably will break something (e.g. RSS RecentChanges).) As a hack, you could try setting SERVER_NAME from $_SERVER['HTTP_HOST'] (in index.php, that is). That picks up the host name from the Host: HTTP header sent by most modern browsers. (The Host: header is required by HTTP/1.1.) It may not work with a few rather old browsers. Something like: if (isset($_SERVER['HTTP_HOST'])) define('SERVER_NAME', $_SERVER['HTTP_HOST']); else define('SERVER_NAME', 'pick.one.com'); // punt and hope you guess right. |