I just finished setting up the application server on an Amazon EC2 instance, and as much for my own future reference as to help someone else, I thought I would document a few things to remember. Setting up the App Server is easy. Getting MS SQL SERVER to be remotely accessible is a little more tricky.
Here's the steps that worked for me:
1 Install the Alpha Application Server on the EC2 instance. (I used remote desktop to the instance, and a normal install)
2. Next step was to get MS SQL Server to allow remote connections. I used SQLEXPRESS, but I think this works for a full version of SQL Server as well.
a. On the Amazon instance (using remote desktop) open and connect to SQLEXPRESS. In the Object Explorer pane, right click the sql server name, and choose properties. Select the "connections" page and insure "Allow Remote Connections to this server" is checked.
b. Start SQL Server Configuration Manager and expand the "SQL SERVER Network Configuration" entry. Select Protocols for your instance. Ensure that TCP/IP is "Enabled". (It's disabled by default in SQLEXPRESS). Then right click on "TCP/IP" and choose "Properties". Choose the IP Addresses tab, and scroll to the bottom of the list. For IPAll, enter the Port you wish to use to access SQL Server (1433 is the normal default, but you can choose something else if you need to). Apply your changes and close the dialog. While you're here, select "SQL Server Services" in the left pane, then right click the SQL Server (SQLEXPRESS) (or the service you are using) and restart the service. Also, insure that the SQL Server Browser is running.
c. Next, in the windows firewall, create a new inbound rule which opens port 1434 for the SQL Server Browser. Then, create a new CUSTOM inbound rule for the SQLEXPRESS service. My understanding is that this will automatically open the ports it needs. If you haven't done it yet, also allow the Alpha Web Server through the firewall (in my case port 8080). This may have been done by the program during setup, I'm not sure.
3. Now go to your Amazon EC2 control panel and make sure your security settings are allowing ports for the Alpha Web Server (Whatever port you choose to put it on, 8080 in this example), Port 1433 or the port you chose (for the SQLSERVER service) and Port 1434 for the SQL Server Browser Service.
4. One last important point to remember. If you are using a remote connection which uses TCP/IP (such as www.mydomain.com,1433) as the server name, be sure to allow the port to be access from anywhere in the security settings. If you don't, the connection will work from you development machine, but not from within the server instance itself. Oddly, that nearly drove me crazy until I saw what was going on.
Don't forget you will need to add a user account and password as well from the SQL Management Console.
Then, back on the development machine, your connection string would use " www.mydomain.com" as the server name, the port would be "1433" , and you would set the Authroization to SQL Server authorization and enter the username and password that you set up. Then cross your fingers and hope the Test Connection works! (I could never get the Windows Authorization to work remotely. It might be possible, but I didn't ever quite get it to).
I think that about covers all that I finally found I needed to setup in order to allow a connection to MS SQL SERVER from my development machine, and to get the connection string to work both on my dev machine and on the remote server.
Here's a link to a helpful video on getting the SQL Server remote access setup: http://youtu.be/aIovZluNmNs
Folks, I'm not an expert in this, so my apologies if something here misleads you, or causes you grief. Please use at your own risk! I just hope it saves someone some time down the road.
Here's the steps that worked for me:
1 Install the Alpha Application Server on the EC2 instance. (I used remote desktop to the instance, and a normal install)
2. Next step was to get MS SQL Server to allow remote connections. I used SQLEXPRESS, but I think this works for a full version of SQL Server as well.
a. On the Amazon instance (using remote desktop) open and connect to SQLEXPRESS. In the Object Explorer pane, right click the sql server name, and choose properties. Select the "connections" page and insure "Allow Remote Connections to this server" is checked.
b. Start SQL Server Configuration Manager and expand the "SQL SERVER Network Configuration" entry. Select Protocols for your instance. Ensure that TCP/IP is "Enabled". (It's disabled by default in SQLEXPRESS). Then right click on "TCP/IP" and choose "Properties". Choose the IP Addresses tab, and scroll to the bottom of the list. For IPAll, enter the Port you wish to use to access SQL Server (1433 is the normal default, but you can choose something else if you need to). Apply your changes and close the dialog. While you're here, select "SQL Server Services" in the left pane, then right click the SQL Server (SQLEXPRESS) (or the service you are using) and restart the service. Also, insure that the SQL Server Browser is running.
c. Next, in the windows firewall, create a new inbound rule which opens port 1434 for the SQL Server Browser. Then, create a new CUSTOM inbound rule for the SQLEXPRESS service. My understanding is that this will automatically open the ports it needs. If you haven't done it yet, also allow the Alpha Web Server through the firewall (in my case port 8080). This may have been done by the program during setup, I'm not sure.
3. Now go to your Amazon EC2 control panel and make sure your security settings are allowing ports for the Alpha Web Server (Whatever port you choose to put it on, 8080 in this example), Port 1433 or the port you chose (for the SQLSERVER service) and Port 1434 for the SQL Server Browser Service.
4. One last important point to remember. If you are using a remote connection which uses TCP/IP (such as www.mydomain.com,1433) as the server name, be sure to allow the port to be access from anywhere in the security settings. If you don't, the connection will work from you development machine, but not from within the server instance itself. Oddly, that nearly drove me crazy until I saw what was going on.
Don't forget you will need to add a user account and password as well from the SQL Management Console.
Then, back on the development machine, your connection string would use " www.mydomain.com" as the server name, the port would be "1433" , and you would set the Authroization to SQL Server authorization and enter the username and password that you set up. Then cross your fingers and hope the Test Connection works! (I could never get the Windows Authorization to work remotely. It might be possible, but I didn't ever quite get it to).
I think that about covers all that I finally found I needed to setup in order to allow a connection to MS SQL SERVER from my development machine, and to get the connection string to work both on my dev machine and on the remote server.
Here's a link to a helpful video on getting the SQL Server remote access setup: http://youtu.be/aIovZluNmNs
Folks, I'm not an expert in this, so my apologies if something here misleads you, or causes you grief. Please use at your own risk! I just hope it saves someone some time down the road.
Comment