Topic on Project:Support desk

Changing $wgserver is not updating the url for my wiki

13
Summary by Whytekong

Apache not configured properly.

24.77.173.145 (talkcontribs)

Hello there,

  • Apache/2.2.16 (Debian)
  • MySQL client version: 5.1.49
  • MediaWIki 1.20.3 (it appears)

So I have recently joined a volunteer group where I was to help develop and improve their wiki. On almost my first day the server partition (/var) where the wiki was being developed filled up. Talking the the server administrator caused me to now become the server administrator. I have experience coding but not with wiki's or with server administration.

Here is what I have done. I backed up the sql database, which in my case was called hertiage_media and created a duplicate of it, heritage_media_old. I took my site and changed the wgdbname from the former database to my heritage_media_old database. I then used rsync to duplicate the entire /var/www directory to /home/www where I have a lot more space to play. I then changed the wgserver on my first site from "http://heritage.apegm.mb.ca" to "http://heritage.apegmold.mb.ca" and the used "http://heritage.apegm2.mb.ca" for the wgserver variable on my new, synchronized location at /home/www. Neither of the urls i have created work, and the original site url of "http://heritage.apegm.mb.ca" is still there but with broken formatting.

What have I missed? I just want to get the wiki at the /home directory to work so i can delete the old directory at /var and get back to developing functionality.

Thanks for reading and for your help and time,

Trent

87.123.40.18 (talkcontribs)

> Talking the the server administrator caused me to now become the server administrator.

Haha, I know that one!

MediaWiki configuration is only one part of your question.

If you have different folders, which both should be accessible from the web, then you need to configure Apache accordingly. Basically, you need a virtual host pointing to each of the two folders. That way, each of them should be available under _some_ URL.

Currently, I cannot call the URLs with "old" and "2" in it at all. I get a server error. No MediaWiki involved here. It seems, like the Apache configuration (or anything else, I am not an expert here) for these two virtual hosts is wrong. Or: Did you create Apache configuration for the according directories at all? (_Missing_ configuration could also be the reason for this.)

Coming to MediaWiki, the value of $wgServer always needs to be the URL, under which the page should be reachable. Basically for each host this is the URL, which you have configured in the Apache configuration. So in case of the URL _without_ old in it, this "old" also should not be in $wgServer.

For the URL _with_ old in its name, this "old" also needs to be in $wgServer.

Whytekong (talkcontribs)

Ok I was wondering about apache but don't really know wanything about it. So there would have originally been an apache configuration somewhere for the original site, if i find it and set the url to "old" like wgserver than that url should work. So then i would need to create and new apache configuration for the new location correct? Does it need to be in the same directory as the /www ?

Whytekong (talkcontribs)

Also the only place I can find an apache2.conf file is in /etc/apache2. Does that sound right?

87.123.40.18 (talkcontribs)

> So there would have originally been an apache configuration somewhere for the original site, if i find it and set the url to "old" like wgserver than that url should work.

Yes, I think so. On the page, which currently is available under the URL _without_ old, $wgServer already seems to be set that way. At least certain internal links inside MediaWiki contain that "old" already.

> So then i would need to create and new apache configuration for the new location correct?

Right, I think what you want to create is a virtual host. Basically like the one, which currently is configured for the URL without "old" in it.

> Does it need to be in the same directory as the /www ?

The _configuration itself_ always needs to be stored at the place where such configuration is stored. I think that is in the same folder as the configuration of the other host is as well.

The _web root directory_ can then be anywhere. It can e.g. be /home/www while for the other virtual host it is somewhere different. It does not have to be the same folder as for the other host.

87.123.40.18 (talkcontribs)

apache2.conf might be such a file. httpd.conf might be another file name. Also, there might be a folder called something like "sites-available". This might also be the place for the configuration. In order to take effect, changes to Apache configuration files usually need an Apache restart.

Whytekong (talkcontribs)

Ok i believe that i got my apache problems fixed. I believe that my virtual host is now pointing at my new website directory. Now im having an issue where when i upload files to my website, its saving the files at the old var/www directory.

Any thoughts?

Ciencia Al Poder (talkcontribs)

You may need to change other configuration settings in LocalSettings.php related to upload directory, etc

Whytekong (talkcontribs)

It doesn't look like there are any configuration settings in my LocalSettings.php related to upload directory. Just to enabling uploading and file extensions. Forgive the inexperienced question but how does MediaWiki upload? Does uploading files utilize mySql in anyway or does LocalSettings direct the uploads directly to /images? Would any of my extensions or mySql have a configuration option that would still be pointing back to /var/www/wiki/images instead of /home/www/wiki/images?

87.123.58.199 (talkcontribs)
Whytekong (talkcontribs)

Ok thanks. Ill take a look into this after work.

Whytekong (talkcontribs)

ok one last question. It appears my last statement was incorrect. For some reason when I upload a file, both my /var directory and /home directory are both increasing in size according to df. When i updated mysql conf file i only changed the data directory variable. Would this issue be a result of that or did i do something else thats causing my /var directory to still take on data?

Whytekong (talkcontribs)

Also if i manually set the uploadpath it kills my image and pdf thumbnails. Like i can still access the files at http://heritage.apegm.mb.ca/images/ but they dont work on the site.