Logs

Posted by Metsuro on Mon 24 Jul 2006 11:12 PM — 14 posts, 41,689 views.

USA #0
Alright this doesn't really pretain to coding smaug exactly... but I'm looking for a way to display logs on the web, or able to read the from the web, with a password and such. I'm not exactly the best with making things like this, But it could be a very useful feature, for atleast me anyway.
USA #1
You will need to give your webserver permission to read files in the log/ directory. Then you should be able to just build an index of files with links to each file. If you want a password you could do it with .htaccess (assuming you're running Apache). You can google for .htaccess, or if you're not using Apache, search your webserver's docs for HTTP authentication.
USA #2
Seeing as I dont really know how to do either or, I'll have to look into those and do some research then.
USA #3
Well, first and foremost, you have to figure out if your MUD host also gives you webspace. Then you need to figure out if the process the webserver runs under has permission to read you MUD's log directory. Get the basics working first, then worry about passwords etc.
USA #4
well i know i have 20mb for a webspace for the mud, and it has a short cut in it... which i find weird cause its a short cut in the directory... to the directory...
USA #5
What do you mean by "short cut"? Is this on a Windows system? Or is it a symlink on a Unix system?

Try putting in a link to /YourMudDirectory/log in the web space and see what happens.

You should also try talking to your sysadmin.
USA #6
well when you cd the directory, it brings you right back to the directory... using winscp when you look at the properties it shows that its a shortcut to the directory, where my webstuff is stored.
USA #7
Quote:
Is this on a Windows system? Or is it a symlink on a Unix system?
USA #8
Its not windows, the place I get shell from is gensismuds.com, and its like fedora core 4 or something like that... So i'm not exactly sure?
USA #9
OK, it's a Linux system. (Fedora is a Linux distribution.) That means that the 'short cut' is a symbolic link (symlink for short).

You can create symlinks like this: ln -s DEST_DIR LINK_NAME. For example, ln -s /my/mud/directory/log logdir. You could do something like that from your web dir, logged in from the shell.
USA #10
alright, theres a link to the dir, but of course its not viewable, so next step would be to...? A, ask the sysadmin, or B, create a way for a page to view the files?
USA #11
You need to be more precise... Where is the link to which dir? Did you make a symlink to your log dir, and is the symlink in your webspace dir? Why is it not visible? Not visible how? Do you get an error message? Etc...
USA #12
the link is in the webspace dir, i get an error message...

 You don't have permission to access /logdir/1001.log on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
USA #13
OK. That means that permissions aren't set up right.

You need to talk to the sysadmin and ask what user the web server runs under, and ask how to give that user permission to your MUD's log directory.

You might have to make your log directory world-readable, which would give access to everybody on the server.