Vice City Multiplayer

VC:MP 0.4 (Beta) => Script Discussion => Topic started by: Honey. on September 27, 2014, 03:21:38 pm

Title: Cannot Create a Symbolic Link
Post by: Honey. on September 27, 2014, 03:21:38 pm
Hello,

I am facing a problem while symlimking my DataBase.db.The problem is that the file is not symlinked correctly therefore leaving my webstats page with a line "Database doesn't exist."When i create a symbolic link the file appears like this :

(http://i.imgur.com/pGCYYtq.jpg) (http://imgur.com/pGCYYtq)

This is the image of the console :

(http://i.imgur.com/Ikod48s.jpg) (http://imgur.com/Ikod48s)

The Line I am using to Create a Symlink : ln -s /root/efe/efe/Files/DataBase.db /var/www/html/stats/DataBase.db

My webstats Page : http://webhost.efe-vcmp.tk/stats/
Title: Re: Cannot Create a Symbolic Link
Post by: Honey. on September 28, 2014, 10:32:09 am
Bump!
Title: Re: Cannot Create a Symbolic Link
Post by: thijn on September 28, 2014, 12:58:41 pm
First of all. Don't ever run the server as root. For fucks sake people. This is common sense.
Second, that should work fine. As you can see from the ls command it is symlinked, and should have the correct permissions. Make sure you have the name right in your config file, it is case sensitive.
Title: Re: Cannot Create a Symbolic Link
Post by: Honey. on September 28, 2014, 05:40:32 pm
I think that my config file is okay.You can check it yourself :

Code: [Select]
<?php
/*
         config.php | Holds all the necessary information
 
 ------------------------------------------------
 
 MaDKiLLeR's Online Stats v1.0.
   
     http://online-stats.madkiller.tk/
   
     Copyright (c) MaDKiLLeR 2013 - All Rights Reserved.
   
     You cannot remove this message and my name from the footer as the "creater" of this webstats script.

*/

           /* 
     This is the path to your Online Stats.
 Examples:
 
 http://stats.server.com/
 
 http://myserver.com/stats/
 
 etc..
  */

          
$stats_url "http://http://webhost.efe-vcmp.tk/stats";
  
  //Add you server's name here
  $servername "Extreme Fighting Era 2015";
  
  //If you've a logo, specify it here. i.e replace the empty string with
  //Logo.png and place the image within images/ directory.
  $serverlogo "http://i.imgur.com/b5wumV8.png";
  
  //Sepcify the path to the database.
  $databasepath "DataBase.db";
  
  //Declare the main fields.
          
$mainfields = array (
         
 //Replace "Stats" with the name of your stats table.
         'stats_table' => "Account",
 
 //Replace "User" with the name of the column which holds the player's name in the stats table.
         'nick_name' => "Name",
 
 //Replace "Kills" with column's name which holds the kills.
 'stats_kills' => "Kills,,",
 
 //Replace "Deaths" with the column's name which holds the deaths.
 'stats_deaths' => "Deaths",
 
 //Replace "Joins" with the column's name which holds the joins.
 'stats_joins' => "Joins",
  );
  
  
  /*
           Weapon's Statistics part.
  */
  
  //You've wep stats? Change this to true.
  $wep_stats_enabled true;
  
  //If wepstats is enabled, specify the name of the table holding wepstats.
  $wep_stats_table "Wstats";
  
  //Sepcify the column's name in bstats table which consists of nicknames.
  $wep_stats_nickname "User";
  
  //You must edit these fields with the name of columns holding the data for associated weapon.
  $wep_stats_fields = array ( 
'stats_m60' => "M60",
'stats_flames' => "FlameThrower",
'stats_laser_sniper' => "LaserScope",
'stats_sniper_rifle' => "SniperRifle",
'stats_ruger' => "Ruger",
'stats_mp5' => "MP5",
'stats_m4' => "M4",
'stats_ingram' => "Ingrams",
'stats_uzi' => "Uzi",
'stats_tec9' => "Tec9",
'stats_stubby' => "Stubby",
'stats_spaz' => "Spaz",
'stats_shotgun' => "Shotgun",
'stats_python' => "Python",
'stats_fist'  => "Fist",
'stats_screwdriver'  => "ScrewDriver",
'stats_golf_club'  => "GolfClub",
'stats_nightstick' => "NightStick",
'stats_knife'  => "Knife",
'stats_baseball_bat'  => "BaseballBat",
'stats_hammer' => "Hammer",
'stats_cleaver'  => "Cleaver",
'stats_machete'  => "Machete",
'stats_katana'  => "Katana",
'stats_chainsaw'  => "Chainsaw",
'stats_colt45'  => "Colt45"
  );
  
  //Weapons you would like to see on Wep Stats page. Please limit these to a reasonable number.
  //Before adding any weapon, check the correct name for it!
          /*    
      For Example, if you want to show Heli Blades, then in the array,
  add heli_blades.
  
  Select the weapon correct name for the weapon according to this:
  
  heli_blades = HeliBaldes
explosion = Explosion
driveby = Driveby
vehicle = Vehicle
heli_canon = HeliCanon
m60 = M60
flames = FlameThrower
laser_sniper = LaserScope
sniper_rifle = SniperRifle
ruger = Ruger
mp5 = MP5
m4 = M4
ingram = Ingrams
uzi = Uzi
tec9 = Tec9
stubby = Stubby
spaz = Spaz
shotgun = Shotgun
python = Python
fist  = Fist
screwdriver  = ScrewDriver
golf_club  = GolfClub
nightstick = NightStick
knife  = Knife
baseball_bat  = BaseballBat
hammer = Hammer
cleaver  = Cleaver
machete  = Machete
katana  = Katana
chainsaw  = Chainsaw
colt45  = Colt45
       
  */
  
  $wep_show = array (
             'm4',
 'm60',
 'mp5',
 'ruger',
 'ingram',
 'uzi',
 'stubby',
 'spaz',
 'shotgun'
  ); 
  
  /*
        Body Parts Statistics
  */
  
  //You've Body Parts stats? Set this to true then.
  $bp_stats_enabled true;
  
  //Sepcify the name of the table which holds the bstats.
  $bp_stats_table "Bstats";
  
  //Sepcify the column's name in bstats table which consists of nicknames.
  $bp_stats_nickname "User";
  
  //Edit these fields with the name of columns in your bstats table, holding stats for the respective bodypart.
  $bp_stats_fields = array (
      'stats_left_arm' => "LeftArm",
   'stats_right_arm' => "RightArm",
   'stats_left_leg' => "LeftLeg",
   'stats_right_leg' => "RightLeg",
   'stats_body' => "Body",
   'stats_torso' => "Torso",
   'stats_head' => "Head"
  );
  
  //Don't edit this array, move on.
  $bp_show = array (
                'left_arm',
'right_arm',
'left_leg',
'right_leg',
'body',
'torso',
'head'
  );
  
  /*
       Live Map
  */
  
  //You've live map? If so, set this to true.
  $live_map_enabled false;
  
  //Set the path to your live map. i.e http://98.25.63.125/server/map
  //If on the same server, then specify the directory containing live map.
  //Just for example, using EA's Live Map. Follow the same pattern:
  $live_map_path "";
  
  /*
       Clan Stats
  */
  
  //Have clans stats? Set this to true
  $clan_stats_enabled false;
  
  //The name of your table consisting clanstats
  $clan_stats_table "";
  
  //Column in the clanstats table which holds the clan's name.
  $clan_stats_field "";
  
  //Edit these fields with the name of the columns holding kills & deaths.
  $clan_stats_fields = array (
      'stats_kills' => "Kills",
  'stats_deaths' => "Deaths",
  );

?>

Title: Re: Cannot Create a Symbolic Link
Post by: thijn on September 28, 2014, 06:01:25 pm
I don't know where MadKiller's script wants the database, but I see your stats_url is wrongly copied.

If you're okay with permissions, you can just put /root/efe/efe/Files/DataBase.db in that variable. It should work atleast, I don't know how his script works.
Title: Re: Cannot Create a Symbolic Link
Post by: Honey. on September 28, 2014, 06:33:49 pm
Still says the same thing.I tried to change the Database route to /root/efe/efe/Files/DataBase.db but it still didn't work.My permissions are okay.IDK what causes this problem.I've faced this problem once before but it automatically got fixed over time.
Title: Re: Cannot Create a Symbolic Link
Post by: soulshaker on September 29, 2014, 04:56:36 pm
in ssh console try this:-

Code: [Select]
cd /var/www/html/stats
ln -s /root/efe/efe/Files/DataBase.db

if everything in your config file is correct, webstats will be up :)
Title: Re: Cannot Create a Symbolic Link
Post by: Honey. on September 29, 2014, 05:13:25 pm
Nah, Still the same error :/
Title: Re: Cannot Create a Symbolic Link
Post by: soulshaker on September 29, 2014, 06:38:49 pm
well try the files i gave you, and it will work like THIS (http://souly.vcmp.in/stats/)
Title: Re: Cannot Create a Symbolic Link
Post by: thijn on September 29, 2014, 07:54:48 pm
Place this in a new file and post a link to the file here:
Code: [Select]
<?php
phpinfo
();
?>

Title: Re: Cannot Create a Symbolic Link
Post by: Honey. on September 29, 2014, 08:18:32 pm
http://107.182.186.206/info.php
Title: Re: Cannot Create a Symbolic Link
Post by: thijn on September 29, 2014, 10:59:51 pm
That seems fine, you can remove that file now.



Go to your server directory (the one which should have your database file, and scripts), and post the output of ls -lha
Title: Re: Cannot Create a Symbolic Link
Post by: Honey. on September 30, 2014, 01:32:29 pm
ls -lha of my Server Dir :

(http://i.imgur.com/FBNsrjE.png) (http://imgur.com/FBNsrjE)

ls -lha of my Database Directory :

(http://i.imgur.com/0Ov6ryH.png) (http://imgur.com/0Ov6ryH)
Title: Re: Cannot Create a Symbolic Link
Post by: Gudio on September 30, 2014, 03:23:03 pm
Symbolic link to the /root directory.
(http://i2.kym-cdn.com/photos/images/newsfeed/000/698/489/2f7.png)

You should never use Linux.
Ensure you have unloaded SymLinksIfOwnerMatch and loaded FollowSymLinks.
Title: Re: Cannot Create a Symbolic Link
Post by: Honey. on September 30, 2014, 03:33:11 pm
What are you talking about?I've never heard of  SymLinksIfOwnerMatch and FollowSymLinks.
Title: Re: Cannot Create a Symbolic Link
Post by: heekz.shadow on September 30, 2014, 04:00:33 pm
I ain't no linux genius but I'd advice you to use google....
Title: Re: Cannot Create a Symbolic Link
Post by: Gudio on September 30, 2014, 04:07:21 pm
What are you talking about?I've never heard of  SymLinksIfOwnerMatch and FollowSymLinks.

Quote from: Callum Crayshaw
I'm talking about hopes... dreams... the magic of television. Especially public television. [...]

Only root user can access to root's directory. Notice that your server probably uses www-data user with www-data group permission and I guess you're running apache - please read about SymLinksIfOwnerMatch and FollowSymLinks to understand why they are needed.
You have three methods suggested by me:

1) Move server files to for example /opt and don't run the server as root for security reasons*, then make a symbolic link to /opt instead of /root.
2) You can use cron to set simply task that will be executed every 15 mins which copies your server's database to your website directory, change permissions to www-data and is read-only. (more secure than the first method)
3) Use MySQL.

* - This refers to all options listed above.
Title: Re: Cannot Create a Symbolic Link
Post by: Honey. on September 30, 2014, 06:32:56 pm
Finally Its working :)

I've used Option 1 and now i changed my user to honey from root.Thank you gudio,thijn and Souly
Title: Re: Cannot Create a Symbolic Link
Post by: stormeus on September 30, 2014, 09:47:20 pm
What are you talking about?I've never heard of  SymLinksIfOwnerMatch and FollowSymLinks.

RTFM. http://httpd.apache.org/docs/2.2/mod/core.html
Title: Re: Cannot Create a Symbolic Link
Post by: Honey. on October 01, 2014, 01:21:28 pm
The topic is already solved but thanks for link. Topic Locked.