Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 12.03.2007, 19:19   #1
goodtimeshaxor
Архивный участник
 
Join Date: Oct 2006
Posts: 108
Default MSSQL + Web server connection

For testing purposes I disabled the firewall on the main server machine with the databases so that the web server could connect to the main machine and register accounts. Now, I have turned on the firewall and, of course, the web server can't connect to the MSSQL because it's being blocked. Normally I would know how to enable the connection with any other SQL service but since I am using MSSQL I have no idea how it's done.

I am using MSSQL 2005 on machine 1 and apache on machine 2.

Here are the errors:
Code:
arning: mssql_connect() [function.mssql-connect]: Unable to connect to server: xx.xx7.2xx.xx5 in C:\www\account\load\functions.php on line 131

Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link resource in C:\www\account\load\functions.php on line 132
I know why I'm getting them, just don't know how to fix them. These are for your reference. Thanks in advance!
goodtimeshaxor is offline  
Old 12.03.2007, 20:25   #2
ateh
Архивный участник
 
Join Date: Apr 2006
Posts: 118
Default

If both machines are in Lan then unblock sql port in firewall for lan connections. If they are not in lan then it'd be very unsafe. Best option I can think of now is to put php scripts on database machine (you can use < iframe > on you website, or return data from php script in special format which would be parsed by other php script on web server. Of course this 'link' would have to be secured.
ateh is offline  
Old 12.03.2007, 21:38   #3
goodtimeshaxor
Архивный участник
 
Join Date: Oct 2006
Posts: 108
Default

They are both on the same network (lan) but I don't understand where I can find these settings. More specifically, I know where the windows firewall settings are and see "exceptions" which I have added l2server.exe, l2AuthD.exe, etc to but I don't know how to unblock a specific SQL port in the firewall for only LAN connections.
goodtimeshaxor is offline  
Old 12.03.2007, 21:49   #4
Lord_Neo
Архивный участник
 
Join Date: Dec 2005
Posts: 55
Default

You have to click in the "change scope" thing located in the add port tab and then change the "range" in wich you are opening the port.
You should also open only the ports to your world and auth (2106 and 7777 if you did not change them) and not give full permission to the .exe to acess the web imo..
Lord_Neo is offline  
Old 15.07.2007, 04:16   #5
moogle
Архивный участник
 
Join Date: Jul 2007
Posts: 23
Default

I've been messing around with this quite a bit and I've figured most errors new server devs would get.

Sometimes if your connecting to the local pc it still gives the error unable to connect. Make sure Authentication mode is on SQL Server + Windows. Do that by logging into the db, right click the db, goto the security tab and its there. If you still get the error, then change the server address to your pc name. for example mine is "server-pc", so replace "localhost" or "127.0.0.1" with that and you will be able to connect. I still havent managed to change the username from sa but if you have thats great.

Since you could register before and now you have the firewall on you cant, I'm guessing its the port, MSSQL uses port 1433, open that in your firewall if you want. You can change it also somewhere but I dont know the exact details. Also Goto Start > SQL Server 2005 > Config Tools > Surface Area Configuration, click surface area config for services and connections expand the database engine, click settings and you can change the connection type, when you do you will have to restart the database engine. do that by logging in and right clicking the db and choosing restart.

when i mean logging in i mean into sql server management studio.

hope this helps you, most likely you've already fixed it but anyone else who gets the same probs will see this

EDIT: Oh yea also try copying the dll i posted into your php dir, its a fix for connecting to sql server, i can connect to sql server using easyphp 2 which has php5 installed.

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
ntwdblib.rar — 100893 байт
moogle is offline  
Old 15.07.2007, 10:41   #6
LoVeRSaMa
Архивный участник
 
Join Date: Jun 2006
Posts: 111
Default

//off topic
Wow... its moogle.
Long time no see man, Remember me ? xD
LoVeRSaMa is offline  
Old 15.07.2007, 13:57   #7
moogle
Архивный участник
 
Join Date: Jul 2007
Posts: 23
Default

yeap i remember you
i stopped the patcher anyway =D
gotta finish alot of other stuff before i can do that.
moogle is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 16:03.