Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Shaiya > Shaiya Private Server > Shaiya PServer Guides & Releases
You last visited: Today at 23:24

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[How To]Web Server Start and basic Services

Discussion on [How To]Web Server Start and basic Services within the Shaiya PServer Guides & Releases forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2013
Posts: 461
Received Thanks: 561
[How To]Web Server Start and basic Services

In this thread i will try to teach some of the basic things for a good website. I can't explain all details but i will try to be as detailed as possible. Some of the things that i will say here can be bullshits for a expert webmaster but i will try to make me understand for who don't know the web languages.

before buy a website that already have a space, you must know that you don't need it, you can manage your website from your own server-host.

there are more ways for install a webserver on your host, a good way is already explained by castor: using apache.

I start to explain how to install a webserver and configure it using IIS.

Installation IIS

1. Click Start -> All Programs -> Administrative Tools -> Server Manager.



2. In the Server Manager window, scroll down to Roles Summary, and then click Add Roles. The Add Roles Wizard will start with a Before You Begin page.

3. Select Web Server (IIS) on the Select Server Roles page. An introductory page will open with links for further information.



4. Select the IIS services to be installed on the Select Role Services page. Add only the modules necessary and click Next.



5. Add any required role services.



6. IIS is now installed with a default configuration for hosting, enable the "CGI" checkbox under "Application Development" and click Next



7. Confirm that the Web server works by using .


PHP Configuration

1. Download , open it, go on Products and search 'PHP 5.3.28' press Add on the right of the page under the php version and press install.



2. now open 'Internet Information Services(IIS) Manager' in the "Features View" page open the "Handler Mappings" feature.



3. In the "Actions" pane click "Add Module Mapping..." and enter the following:
Request path: *.php
Module: FastCgiModule
Executable: C:\[Path to PHP installation]\php-cgi.exe
Name: PHP_via_FastCGI
Click "Request Restrictions" button and then configure the mapping to invoke handler only if request is mapped to a file or a folder, and click ok on all dialogs for safe the configuration.
and again "Add Module Mapping..." and enter the following:
Request path: *.php
Module: FastCgiModule
Executable: C:\[Path to PHP installation]\php-cgi.exe
Name: PHP53_via_FastCGI
Click "Request Restrictions" button and then configure the mapping to invoke handler only if request is mapped to a file or a folder, On Verbs select "One of the following verbs" and in the space insert 'GET,HEAD,POST', click ok on all dialogs for safe the configuration.

(Can be that after install the php version using the web platform installer this step is automatically done by the program)



4. Now select 'root' under "Sites" and open the "Default Document" feature. Select index.php and move it Up to first position (if don't exist add ''index.php" and move it at first position).



5. Now open MIME Types and press on Add..
File name extension: .ini
MIME type: text/plain
and OK. Now again Add..
File name extension: .patch
MIME type: application/octet-stream
OK. (this is needed for make work your updater)

6. Now open Program Files(x86) --> PHP --> v5.3 --> php.ini
on line 226 edit short_open_tag = On

7. Open the folder C: --> root delete all what there is and with your text editor create index.php
PHP Code:
<!doctype html>
<html>
<body>
<?
    phpinfo
(1);
?>
</body>
</html>
Launch your browser, type-in the url "localhost/index.php".
if work you have succesfully installed and configure PHP on IIS.
if don't work please check your error using google before ask here about a solution!



Web Site Start

This is only a quickly introdution to html side of a website, but i can't explain you how to create a template by 0, so i give you only some suggestions.

First of all you need a template and i suggest you to steal it from another website (always make a new one is better, but if you don't have experience you can learn more by a website that is already maked).. download search a website that you like and follow the instruction on this program for take the html/css codes. copy your 'new' template in the folder "root". now you have html,css,javascript that you can reconfigure as you like, but not php.

You can show your result opening it by your url "localhost/.."

Now you need a web editer and i suggest this one that is free:

Open Brackets and on the left open folder (root). Rename all .html files to .php (remember you need to edit in your website menu/buttons all the path from .html to .php). The next step you must make alone using a bit of intelligence and searching the language words that you don't understand. You need to make now your website and the only suggestion that i can give you is to learn more using this tutiorals:



I hope you will quickly learn to edit the html pages and the css.

For css a good way for edit is directly on your browser, open your website, press rightclick, press on 'Inspect Element' and you can manage from there your style editing and then replacing the codes on the css file.

You can already go on your website in remote using your IP, or you can register your self on for have a free url, or if you want to buy a web domain i suggest you to buy it on where the .net cost only 9eu/year or check for a domain that have a lower cost. Remember, you don't need a webspace, u need only a domain and the staff will help you to configure your webhost to the domain name!



Web Services using PHP

Php start ever with this command
PHP Code:
<?
and close with this one:
PHP Code:
?> 
We use php for send and get the results from SQL database and for execute them on our website. but php isn't only this, it allow you to make commands on your web pages.
You can open and close it where you want inside a php page, the fine of php page is that read as html when php is closed. For insert a text or a html language in php the line must be similar at this:
PHP Code:
echo "example text"
When you test your php and get a error the answer of your browser will ever say you what error and the line where it is. If you don't understand the error search it on google for a solution.
Here is a tutorial for learn how to use php:

You can add every php script that you have found for shaiya simple with a include or copying the script in one of your pages and not need to use iframe.
the include function is very simple: insert this php code in your own php page where you want show it editing the path:
PHP Code:
<?
include('./path');
?>
For First create a folder in 'root' and call it 'inc' where we create a new php file that we call 'pdoConnect.php', then open it and insert this script where you need to edit your server credentials.
PHP Code:
//    Connect to MSSQL server with Shaiya credentials using PDO
    
$sqlUser  'User';        //    YOUR SHAIYA ACCOUNT NAME
    
$sqlPass  'Password';    //    YOUR SHAIYA ACCOUNT PASSWORD
    
$database 'PS_UserData';

    try {
        
$conn  = new PDO("sqlsrv:Server=127.0.0.1;Database=$database"$sqlUser$sqlPass);
    }
    catch (
PDOException $e){
        die(
$e->getMessage());
    } 
(this is the same one from castor, so you can include him scripts to mines)

Now make a top account info using php, you need to add this script after the tag <body> in every web page or make it in a clean php page and call with a include.
PHP Code:
<?
if (session_id() == ""){
    
session_start();
}
if(!isset(
$_SESSION['UserUID'])){
        
$uid 0;
    }else{
        
$uid $_SESSION['UserUID'];
}
    include(
'./inc/pdoConnect.php');
    
// Account name
if ($uid != 0){
    
$query $conn->prepare('SELECT UserID FROM PS_UserData.dbo.Users_Master WHERE UserUID=?');
    if (
$query != null){
        if (
$query->bindValue(1$uidPDO::PARAM_INT) && $query->execute()){
            
$name $query->fetch(PDO::FETCH_NUM);
    
$usrname$name[0];
}        
        
$query->closeCursor();
        
$query null;
    }
// Account Points
    
$query $conn->prepare('SELECT Point FROM PS_UserData.dbo.Users_Master WHERE UserUID=?');
    if (
$query != null){
        if (
$query->bindValue(1$uidPDO::PARAM_INT) && $query->execute()){
            
$point $query->fetch(PDO::FETCH_NUM);
                       
$usrpoint $point[0];
        }        
        
$query->closeCursor();
        
$query null;
    }
    
$conn null;
} else {
$usrname"Guest";
$usrpoint "No";
}
    
?>
<div style='float: right; text-align: right;'>
<? 
echo "Welcome ".$usrname ." </br>You have " .$usrpoint " points";
?>
</div>
(all files where you edit it must be in the root path, not in a subfolder)

now you can proceed to login section button, insert where you have your login/logout button and edit only the <a></a>:
PHP Code:
<?
if ($uid == 0){
echo 
"<a href='login.php'>Login</a>";
} else {
echo 
"<a href='logout.php'>Logout</a>";
}
?>
now we create the login.php in the root folder.
Replace your template and in the middle insert this script:
PHP Code:
<?
//    placeholder for invalid verification attempt
    
$verificationFailed false;

//    upon form validation, this page is processed with posted params, check them
    
if (isset($_POST['name']) && isset($_POST['pass'])){
    
//    enable cookies
        
session_start();
    
//    clear any previously defined IDs
        
if (isset($_SESSION['UserUID']))
            unset(
$_SESSION['UserUID']);
    
    
//    connect to database using a PDO
        
include('./inc/pdoConnect.php');
    
//    setup a query to get information on player account
        
$query $conn->prepare('SELECT UserUID, Pw, Status FROM PS_UserData.dbo.Users_Master WHERE UserID=?');
        if (
$query === false)
            die(
FormatErrors($query->errorInfo()));
    
//    bind the parameter
        
$query->bindParam(1$_POST['name'], PDO::PARAM_STR);
    
//    execute the query
        
if ($query->execute() === false)
            die(
FormatErrors($query->errorInfo()));
    
//    get response (a single row is expected)
        
$row $query->fetch(PDO::FETCH_NUM);
        if (
$row == null){
        
//    UserID was invalid, loop back on login form or display error or ...
$query->closeCursor();
$verificationFailed true;
}
else {
$uid $row[0];
$pwd $row[1];
$status $row[2];
            
$query->closeCursor();
        
//    verify password, depending on actual DB you may have to verify a hash
            
if ($pwd == '' || ''.$pwd != $_POST['pass']){
            
//    password was invalid
                
$verificationFailed true;
            }
            else {
                if (
$status == '-5'){
                
$query null;
                
$conn  null;
            
//    redirect to ban section
                
header("Location: ban_status.php?uid=".$uid."");
                exit(); 
                } else {
            
//    UserID / Pwd are valid, store the UserUID (the numerical unique ID)
                
$_SESSION['UserUID'] = $uid;
                
            
//    release resources
                
$query null;
                
$conn  null;
            
//    redirect to Char selection page
                
header("Location: index.php");
                exit();
                }
            }
        }
    }
//    we continue with html code in case of error or first display (no form validated)
?>
<style>
#login {
    background: url('./png/login.png') no-repeat right top;
    color: #ffffff;
    font: normal 9pt Verdana, Arial, Helvetica, sans-serif;
    margin: 0px;
    padding: 0px;
    position: relative;
margin: 0 auto;
    width: 252px;
    height: 200px;
}
#login p{
    text-align: center;
}
#login form {
    position: relative;
    padding: 50px 20px 0px 20px;
}
label.capt {
    display: inline-block;
    font: normal 9pt Verdana, Arial, Helvetica, sans-serif;
    width: 70px;
    padding: 4px 0 6px 0;
}
#login input {
    width: 130px;
}
#login #submit {
    margin: 0;
    padding: 0;
    width:100%;
    text-align: center;
}
#login input.btn {
    color: transparent;
    background: url('./png/ok.png') 0 0;
    border: none;
    margin: 0;
    padding: 0;
    height: 26px;
    width: 65px;
}
#login input.btn:hover {
    background: url('./png/ok.png') 0 -26px;
}
</style>
<div id="login">
    <form method="post" action="login.php">
        <label for="name" class="capt">User ID:</label>
        <input id="name"  name="name" type="text"/>
        <br/>
        <label for="pass" class="capt">Password:</label>
        <input id="pass"  name="pass" type="password"/>
        <br/>
<?    if ($verificationFailed){    ?>
        <p>The ID and/or password was invalid. Type in them carefully.</p>
<?    }
    else {    
?>
        <p>Please type in your ID and password to login your game account.</p>
<?    }    ?>    
        <div id="submit"><input type="submit" value="OK" class="btn"/></div>
    </form>
    <a style="float: right; color: white" href="recover.php">Recover Date</a>
</div>
</body>
</html>
for have a images response download this png folder: and insert it in root. (my script is a bit different on the ones from castor so better if you use this but you can work with the files that castor had relase on him thread [how To]Shaiya Web Service. this script have days bann and recover date inside.)

The logout.php must only contain this code:
PHP Code:
<?
    session_start
();
    
$_SESSION = array();
    
session_destroy();
    
header("Location: index.php");
?>
beetols is offline  
Thanks
26 Users
Old 11/04/2014, 09:21   #2
 
delux153's Avatar
 
elite*gold: 0
Join Date: Apr 2013
Posts: 59
Received Thanks: 10
after installing IIS I does not display webmall
Help please
delux153 is offline  
Old 11/04/2014, 14:33   #3
 
elite*gold: 0
Join Date: Jan 2013
Posts: 461
Received Thanks: 561
More PHP Versions in same IIS server

Quote:
Originally Posted by delux153 View Post
after installing IIS I does not display webmall
Help please
Not all php scripts will work using the php version 5.3

but you can add more php versions in IIS.

Download a different php version (better if u don't use the windows platform installer but make it manually, so will not change your impostation that u have setup for work using principally the version 5.3.28).

Select the subfolder that will contain your scripts that need the different php version, by your "Internet Information Services(IIS) Manager"(Be sure to select only the subfolder that you want change or it will take effect to all things that are selected), open the "Handler Mappings" feature and in In the "Actions" panel click "Add Module Mapping..." and enter the following:
Request path: *.php
Module: FastCgiModule
Executable: C:\[Path to PHP installation from the new php version]\php-cgi.exe
Name: PHP(version)_via_FastCGI

Click "Request Restrictions" button and then configure the mapping to invoke handler only if request is mapped to a file or a folder, and click ok on all dialogs for safe the configuration.

Select the handler mapping for the PHP version that you want use for the new folder and use “Move Up” action to move it to the top of the list. This will enable that particular PHP version for the currently selected IIS configuration scope.
beetols is offline  
Thanks
3 Users
Old 11/05/2014, 15:24   #4
 
elite*gold: 0
Join Date: Jan 2013
Posts: 461
Received Thanks: 561
Online Status Script
here is a online status script maked using PDO for the php version 5.3, insert it in your root
PHP Code:
<?php 
    
include ('./inc/pdoConnect.php');

    
$queryLogin=$conn->prepare("SELECT Family FROM PS_GameData.dbo.Chars WHERE LoginStatus=1");
    
$queryLogin->execute();
    
$rowLogin $queryLogin->fetch(PDO::FETCH_NUM);
    
$human 0;
    
$elf 0;
    
$vail 0;
    
$nordein 0;
    
$online 0;
    while (
$rowLogin $queryLogin->fetch(PDO::FETCH_NUM)){
    switch(
$rowLogin[0]){
                case 
0$human++;break;
                case 
1$elf++;break;
                case 
2$vail++;break;
                case 
3$nordein++;break;
             };
    }
    
    
$online$human $elf $vail$nordein;
    echo 
"<center>";
    echo 
"<table>
          <tr><td colspan=2>Players online: </td><td>"
.$online."</td></tr>
          <tr><td colspan=2>Human: </td><td>"
.$human."</td></tr>
          <tr><td colspan=2>Elf: </td><td>"
.$elf."</td></tr>
          <tr><td colspan=2>Vail: </td><td>"
.$vail."</td></tr>
          <tr><td colspan=2>Nordein: </td><td>"
.$nordein."</td></tr>
          </table>"
;
    echo 
"</center>";
?>
beetols is offline  
Thanks
4 Users
Old 09/01/2015, 02:06   #5
 
elite*gold: 0
Join Date: Jan 2013
Posts: 461
Received Thanks: 561
Hide php extension on IIS

IIS have a configuration file in root (predefinted folder: wwwroot) called web.config
if you open it will see a begin side
Code:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
And end with

Code:
    </system.webServer>
</configuration>
inside there are some others impostations like

Code:
<defaultDocument>
    ...
</defaultDocument>
at same level than this we can add our script side for remove the extension:

Code:
        <rewrite>
            <rules>
                <rule name="rewritephp">
                           <match url="(.*)" />
                           <conditions logicalGrouping="MatchAll">
                             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                           </conditions>
                           <action type="Rewrite" url="{R:1}.php" />
                </rule>     
            </rules>
        </rewrite>
At this point you can remove the extension '.php' or '.html' in the urls!

IIS will continue to read both ways!
beetols is offline  
Thanks
1 User
Old 09/03/2015, 13:43   #6
 
SkuulCandy's Avatar
 
elite*gold: 0
Join Date: Apr 2015
Posts: 424
Received Thanks: 113
Very nice
SkuulCandy is offline  
Old 10/21/2015, 18:51   #7
 
admin_lewis's Avatar
 
elite*gold: 195
Join Date: Jul 2014
Posts: 63
Received Thanks: 88
nice guide! you are the best!
admin_lewis is offline  
Old 10/22/2015, 18:32   #8
 
elite*gold: 0
Join Date: Apr 2013
Posts: 69
Received Thanks: 21
IIS is abit more complicated why dont u use wamp or xamp they have most of the things presetuped and do the same job. When i coded the webmall i used mysql to store items tables. wamp with php 5.3 so mssql_connect string work.
[ADM]Pain is offline  
Old 10/23/2015, 08:03   #9
 
elite*gold: 0
Join Date: Jan 2013
Posts: 461
Received Thanks: 561
Quote:
Originally Posted by [ADM]Pain View Post
IIS is abit more complicated why dont u use wamp or xamp they have most of the things presetuped and do the same job. When i coded the webmall i used mysql to store items tables. wamp with php 5.3 so mssql_connect string work.
Wamp or xampp use apache as web server, and you need only apache, all other functions are not needed. Castor did a tutorial for apache and I for IIS.

None is more complicated than the others, install IIS don't take more to 5 minutes, and I know devs that have prefer use IIS instead xampp for the addictional features that IIS provide. I find IIS easy, if you think that is complicated is just because u didn't apply yourself about.
beetols is offline  
Thanks
1 User
Old 02/09/2017, 15:25   #10
 
elite*gold: 0
Join Date: Nov 2016
Posts: 60
Received Thanks: 12
i think iis is more safer than apache? am i right?
balongskie123 is offline  
Old 11/17/2018, 11:55   #11
 
elite*gold: 0
Join Date: Nov 2018
Posts: 23
Received Thanks: 4
IIS

Quote:
Originally Posted by beetols View Post
Wamp or xampp use apache as web server, and you need only apache, all other functions are not needed. Castor did a tutorial for apache and I for IIS.

None is more complicated than the others, install IIS don't take more to 5 minutes, and I know devs that have prefer use IIS instead xampp for the addictional features that IIS provide. I find IIS easy, if you think that is complicated is just because u didn't apply yourself about.



does folder Shaiya and patch still needed in IIS ?
copain is offline  
Old 11/17/2018, 12:08   #12
 
elite*gold: 0
Join Date: Jan 2013
Posts: 461
Received Thanks: 561
Quote:
Originally Posted by copain View Post
does folder Shaiya and patch still needed in IIS ?
I have to admit that what you wrote make no sense at all to me.. if you can express yourself more clearly i may understand and give you a more supporting answer aswell.
beetols is offline  
Old 11/17/2018, 12:54   #13

 
{Skrillex}'s Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 850
Received Thanks: 408
Code:
        $query = $conn->prepare('SELECT UserUID, Pw, Status FROM PS_UserData.dbo.Users_Master WHERE UserID=?');
        if ($query === false)
            die(FormatErrors($query->errorInfo()));
    //    bind the parameter
        $query->bindParam(1, $_POST['name'], PDO::PARAM_STR);
Why you dont escape UserID?....

Regards
{Skrillex} is offline  
Old 11/17/2018, 15:30   #14
 
elite*gold: 0
Join Date: Jan 2013
Posts: 461
Received Thanks: 561
Quote:
Originally Posted by .:Skrillex:. View Post
Code:
        $query = $conn->prepare('SELECT UserUID, Pw, Status FROM PS_UserData.dbo.Users_Master WHERE UserID=?');
        if ($query === false)
            die(FormatErrors($query->errorInfo()));
    //    bind the parameter
        $query->bindParam(1, $_POST['name'], PDO::PARAM_STR);
Why you dont escape UserID?....

Regards
PDO BindParam() give the UserID as STR variable and cannot be injected and it's fine like this, if I right understood your question..
beetols is offline  
Old 06/15/2019, 07:34   #15
 
elite*gold: 0
Join Date: May 2018
Posts: 67
Received Thanks: 4
Its giving me this problem


anon112 is offline  
Reply


Similar Threads Similar Threads
Help!!! Cant start any server services
09/07/2013 - Shaiya Private Server - 1 Replies
hi can any one please help me i have installed sql.... i falow this turtorial: Video Tutorials 2013 - Tutorials - Shaiya Projekte but when it coms 2 starting all server services non of them start they are all II and green but non of them wont start ... i was looking on forums they say 2 chech logs... check what? i did check and i saw somwhere some conection failed but what should i do?
services won't start and "server is full" issue
08/11/2013 - Fiesta Online - 0 Replies
Helloo, I've faced a strange problem. Everything worked fine, all services started, I was able to play etc.etc. But then, I restarted my PC. And still all my services worked. BUT, when I started the game it said that the server was full. And now, a few PC restarts later (lol) the services Accountlog, character DB, Gamelog DB Aren't working.. And if they work I still have the "server is full" problem. Could anybody help me? Tips are appreciated and if you can fix it I'm also willing to...
i can't start the services pls help with server
04/07/2013 - 4Story - 7 Replies
i can't start TCTRL_GSP and all the services that i need to start... i go to services and i got many errors
HELP! 5.3 Cant start services
06/17/2012 - Shaiya Private Server - 8 Replies
Hey, i got through my last problem, but now, when i was going to start the services using PSMServer_Mgr it gave me a message with alot of weird symbols.... I read some threads and i found that the Server wasnt connected to SQL or something... how do i solve this? i know its in other threads but i didnt find exactly my problem. If i did wrong during SQL setup, send me a link to SQL server and Management studio + a setup guide please :P Thanks!
Can't start services
05/21/2012 - Shaiya Private Server - 5 Replies
Hi all.I have problem i click Start Server he start for 2-3 sec and again back to pause and i don't know how to i fix please help me TY !



All times are GMT +1. The time now is 23:30.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.